Merge topic 'minor-cleanups'
6652afe6
CTest: Use clear instead of erase-all.75661fdf
cmListCommand: Move size variable out of loop.10e53e23
cmAlgorithms: Add missing const to functors.74906322
cmAlgorithms: Remove sort of already-sorted container.2acd04c9
cmcmd: Remove some comment copy-pasta.2d833232
cmCoreTryCompile: Remove variable assignment.26602cf5
cmLocalGenerator: Move variable population inside of condition.cfb84834
Update comment to match recent dashboard testing.6010f936
Revert "cmGlobalGenerator: Fix value type pushed into autogens vector"0550b9e3
Revert "Attempt to fix the compile of cmake on Sun CC."1ee4721f
Help: Fix formatting of command parameter.62429a1e
cmGlobalGenerator: Remove unneeded pointer check.c697c1fa
cmTarget: Remove template argument workaround.
This commit is contained in:
commit
93a38a2abc
|
@ -9,7 +9,7 @@ Add compile definitions to a target.
|
||||||
<INTERFACE|PUBLIC|PRIVATE> [items1...]
|
<INTERFACE|PUBLIC|PRIVATE> [items1...]
|
||||||
[<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])
|
[<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])
|
||||||
|
|
||||||
Specify compile definitions to use when compiling a given <target. The
|
Specify compile definitions to use when compiling a given ``<target>``. The
|
||||||
named ``<target>`` must have been created by a command such as
|
named ``<target>`` must have been created by a command such as
|
||||||
:command:`add_executable` or :command:`add_library` and must not be an
|
:command:`add_executable` or :command:`add_library` and must not be an
|
||||||
:ref:`Imported Target <Imported Targets>`.
|
:ref:`Imported Target <Imported Targets>`.
|
||||||
|
|
|
@ -28,34 +28,6 @@ Some implementations have a ``std::auto_ptr`` which can not be used as a
|
||||||
return value from a function. ``std::auto_ptr`` may not be used. Use
|
return value from a function. ``std::auto_ptr`` may not be used. Use
|
||||||
``cmsys::auto_ptr`` instead.
|
``cmsys::auto_ptr`` instead.
|
||||||
|
|
||||||
Template Parameter Defaults
|
|
||||||
---------------------------
|
|
||||||
|
|
||||||
On ancient compilers, C++ template must use template parameters in function
|
|
||||||
arguments. If no parameter of that type is needed, the common workaround is
|
|
||||||
to add a defaulted pointer to the type to the templated function. However,
|
|
||||||
this does not work with other ancient compilers:
|
|
||||||
|
|
||||||
.. code-block:: c++
|
|
||||||
|
|
||||||
template<typename PropertyType>
|
|
||||||
PropertyType getTypedProperty(cmTarget* tgt, const char* prop,
|
|
||||||
PropertyType* = 0) // Wrong
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.. code-block:: c++
|
|
||||||
|
|
||||||
template<typename PropertyType>
|
|
||||||
PropertyType getTypedProperty(cmTarget* tgt, const char* prop,
|
|
||||||
PropertyType*) // Ok
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
and invoke it with the value ``0`` explicitly in all cases.
|
|
||||||
|
|
||||||
size_t
|
size_t
|
||||||
------
|
------
|
||||||
|
|
||||||
|
|
|
@ -520,8 +520,8 @@ if(APPLE)
|
||||||
target_link_libraries(CMakeLib "-framework CoreFoundation")
|
target_link_libraries(CMakeLib "-framework CoreFoundation")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# On some platforms we need the rpcrt4 library for the VS 7 generators.
|
|
||||||
if(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW)
|
if(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW)
|
||||||
|
# We need the rpcrt4 library for at least the VS7-VC10 generators.
|
||||||
target_link_libraries(CMakeLib rpcrt4)
|
target_link_libraries(CMakeLib rpcrt4)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -32,8 +32,7 @@ cmCTestBuildAndTestHandler::cmCTestBuildAndTestHandler()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void cmCTestBuildAndTestHandler::Initialize()
|
void cmCTestBuildAndTestHandler::Initialize()
|
||||||
{
|
{
|
||||||
this->BuildTargets.erase(
|
this->BuildTargets.clear();
|
||||||
this->BuildTargets.begin(), this->BuildTargets.end());
|
|
||||||
this->Superclass::Initialize();
|
this->Superclass::Initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,7 @@ template<typename Container,
|
||||||
bool valueTypeIsPair = cmIsPair<typename Container::value_type>::value>
|
bool valueTypeIsPair = cmIsPair<typename Container::value_type>::value>
|
||||||
struct DefaultDeleter
|
struct DefaultDeleter
|
||||||
{
|
{
|
||||||
void operator()(typename Container::value_type value) {
|
void operator()(typename Container::value_type value) const {
|
||||||
delete value;
|
delete value;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -107,7 +107,7 @@ struct DefaultDeleter
|
||||||
template<typename Container>
|
template<typename Container>
|
||||||
struct DefaultDeleter<Container, /* valueTypeIsPair = */ true>
|
struct DefaultDeleter<Container, /* valueTypeIsPair = */ true>
|
||||||
{
|
{
|
||||||
void operator()(typename Container::value_type value) {
|
void operator()(typename Container::value_type value) const {
|
||||||
delete value.second;
|
delete value.second;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -163,7 +163,7 @@ struct BinarySearcher
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator()(argument_type const& item)
|
bool operator()(argument_type const& item) const
|
||||||
{
|
{
|
||||||
return std::binary_search(m_range.begin(), m_range.end(), item);
|
return std::binary_search(m_range.begin(), m_range.end(), item);
|
||||||
}
|
}
|
||||||
|
@ -275,7 +275,6 @@ typename Range::const_iterator cmRemoveDuplicates(Range& r)
|
||||||
{
|
{
|
||||||
return r.end();
|
return r.end();
|
||||||
}
|
}
|
||||||
std::sort(indices.begin(), indices.end());
|
|
||||||
return cmRemoveIndices(r, indices);
|
return cmRemoveIndices(r, indices);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -685,8 +685,7 @@ void cmCoreTryCompile::FindOutputFile(const std::string& targetName)
|
||||||
command += tmpOutputFile;
|
command += tmpOutputFile;
|
||||||
if(cmSystemTools::FileExists(command.c_str()))
|
if(cmSystemTools::FileExists(command.c_str()))
|
||||||
{
|
{
|
||||||
tmpOutputFile = cmSystemTools::CollapseFullPath(command);
|
this->OutputFile = cmSystemTools::CollapseFullPath(command);
|
||||||
this->OutputFile = tmpOutputFile;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,10 +24,7 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
#if !defined(__SUNPRO_CC) || __SUNPRO_CC > 0x510
|
static void reportError(cmGeneratorExpressionContext *context,
|
||||||
static
|
|
||||||
#endif
|
|
||||||
void reportError(cmGeneratorExpressionContext *context,
|
|
||||||
const std::string &expr, const std::string &result)
|
const std::string &expr, const std::string &result)
|
||||||
{
|
{
|
||||||
context->HadError = true;
|
context->HadError = true;
|
||||||
|
|
|
@ -74,11 +74,7 @@ cmGlobalGenerator::cmGlobalGenerator()
|
||||||
cmGlobalGenerator::~cmGlobalGenerator()
|
cmGlobalGenerator::~cmGlobalGenerator()
|
||||||
{
|
{
|
||||||
this->ClearGeneratorMembers();
|
this->ClearGeneratorMembers();
|
||||||
|
delete this->ExtraGenerator;
|
||||||
if (this->ExtraGenerator)
|
|
||||||
{
|
|
||||||
delete this->ExtraGenerator;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmGlobalGenerator::SetGeneratorPlatform(std::string const& p,
|
bool cmGlobalGenerator::SetGeneratorPlatform(std::string const& p,
|
||||||
|
@ -1391,7 +1387,7 @@ void cmGlobalGenerator::CreateQtAutoGeneratorsTargets(AutogensType &autogens)
|
||||||
cmQtAutoGenerators autogen;
|
cmQtAutoGenerators autogen;
|
||||||
if(autogen.InitializeAutogenTarget(&target))
|
if(autogen.InitializeAutogenTarget(&target))
|
||||||
{
|
{
|
||||||
autogens.push_back(AutogensType::value_type(autogen, &target));
|
autogens.push_back(std::make_pair(autogen, &target));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -202,12 +202,12 @@ bool cmListCommand::HandleGetCommand(std::vector<std::string> const& args)
|
||||||
std::string value;
|
std::string value;
|
||||||
size_t cc;
|
size_t cc;
|
||||||
const char* sep = "";
|
const char* sep = "";
|
||||||
|
size_t nitem = varArgsExpanded.size();
|
||||||
for ( cc = 2; cc < args.size()-1; cc ++ )
|
for ( cc = 2; cc < args.size()-1; cc ++ )
|
||||||
{
|
{
|
||||||
int item = atoi(args[cc].c_str());
|
int item = atoi(args[cc].c_str());
|
||||||
value += sep;
|
value += sep;
|
||||||
sep = ";";
|
sep = ";";
|
||||||
size_t nitem = varArgsExpanded.size();
|
|
||||||
if ( item < 0 )
|
if ( item < 0 )
|
||||||
{
|
{
|
||||||
item = (int)nitem + item;
|
item = (int)nitem + item;
|
||||||
|
@ -216,8 +216,8 @@ bool cmListCommand::HandleGetCommand(std::vector<std::string> const& args)
|
||||||
{
|
{
|
||||||
std::ostringstream str;
|
std::ostringstream str;
|
||||||
str << "index: " << item << " out of range (-"
|
str << "index: " << item << " out of range (-"
|
||||||
<< varArgsExpanded.size() << ", "
|
<< nitem << ", "
|
||||||
<< varArgsExpanded.size()-1 << ")";
|
<< nitem - 1 << ")";
|
||||||
this->SetError(str.str());
|
this->SetError(str.str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -485,10 +485,10 @@ bool cmListCommand::HandleRemoveAtCommand(
|
||||||
|
|
||||||
size_t cc;
|
size_t cc;
|
||||||
std::vector<size_t> removed;
|
std::vector<size_t> removed;
|
||||||
|
size_t nitem = varArgsExpanded.size();
|
||||||
for ( cc = 2; cc < args.size(); ++ cc )
|
for ( cc = 2; cc < args.size(); ++ cc )
|
||||||
{
|
{
|
||||||
int item = atoi(args[cc].c_str());
|
int item = atoi(args[cc].c_str());
|
||||||
size_t nitem = varArgsExpanded.size();
|
|
||||||
if ( item < 0 )
|
if ( item < 0 )
|
||||||
{
|
{
|
||||||
item = (int)nitem + item;
|
item = (int)nitem + item;
|
||||||
|
@ -497,8 +497,8 @@ bool cmListCommand::HandleRemoveAtCommand(
|
||||||
{
|
{
|
||||||
std::ostringstream str;
|
std::ostringstream str;
|
||||||
str << "index: " << item << " out of range (-"
|
str << "index: " << item << " out of range (-"
|
||||||
<< varArgsExpanded.size() << ", "
|
<< nitem << ", "
|
||||||
<< varArgsExpanded.size()-1 << ")";
|
<< nitem - 1 << ")";
|
||||||
this->SetError(str.str());
|
this->SetError(str.str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1952,14 +1952,13 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries,
|
||||||
// Write the library flags to the build rule.
|
// Write the library flags to the build rule.
|
||||||
fout << linkLibs;
|
fout << linkLibs;
|
||||||
|
|
||||||
// Get the RPATH entries.
|
|
||||||
std::vector<std::string> runtimeDirs;
|
|
||||||
cli.GetRPath(runtimeDirs, relink);
|
|
||||||
|
|
||||||
// Check what kind of rpath flags to use.
|
// Check what kind of rpath flags to use.
|
||||||
if(cli.GetRuntimeSep().empty())
|
if(cli.GetRuntimeSep().empty())
|
||||||
{
|
{
|
||||||
// Each rpath entry gets its own option ("-R a -R b -R c")
|
// Each rpath entry gets its own option ("-R a -R b -R c")
|
||||||
|
std::vector<std::string> runtimeDirs;
|
||||||
|
cli.GetRPath(runtimeDirs, relink);
|
||||||
|
|
||||||
std::string rpath;
|
std::string rpath;
|
||||||
for(std::vector<std::string>::iterator ri = runtimeDirs.begin();
|
for(std::vector<std::string>::iterator ri = runtimeDirs.begin();
|
||||||
ri != runtimeDirs.end(); ++ri)
|
ri != runtimeDirs.end(); ++ri)
|
||||||
|
|
|
@ -4711,13 +4711,11 @@ bool cmTarget::IsNullImpliedByLinkLibraries(const std::string &p) const
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
template<typename PropertyType>
|
template<typename PropertyType>
|
||||||
PropertyType getTypedProperty(cmTarget const* tgt, const std::string& prop,
|
PropertyType getTypedProperty(cmTarget const* tgt, const std::string& prop);
|
||||||
PropertyType *);
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
template<>
|
template<>
|
||||||
bool getTypedProperty<bool>(cmTarget const* tgt, const std::string& prop,
|
bool getTypedProperty<bool>(cmTarget const* tgt, const std::string& prop)
|
||||||
bool *)
|
|
||||||
{
|
{
|
||||||
return tgt->GetPropertyAsBool(prop);
|
return tgt->GetPropertyAsBool(prop);
|
||||||
}
|
}
|
||||||
|
@ -4725,8 +4723,7 @@ bool getTypedProperty<bool>(cmTarget const* tgt, const std::string& prop,
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
template<>
|
template<>
|
||||||
const char *getTypedProperty<const char *>(cmTarget const* tgt,
|
const char *getTypedProperty<const char *>(cmTarget const* tgt,
|
||||||
const std::string& prop,
|
const std::string& prop)
|
||||||
const char **)
|
|
||||||
{
|
{
|
||||||
return tgt->GetProperty(prop);
|
return tgt->GetProperty(prop);
|
||||||
}
|
}
|
||||||
|
@ -4937,8 +4934,7 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
|
||||||
CompatibleType t,
|
CompatibleType t,
|
||||||
PropertyType *)
|
PropertyType *)
|
||||||
{
|
{
|
||||||
PropertyType propContent = getTypedProperty<PropertyType>(tgt, p,
|
PropertyType propContent = getTypedProperty<PropertyType>(tgt, p);
|
||||||
0);
|
|
||||||
const bool explicitlySet = tgt->GetProperties()
|
const bool explicitlySet = tgt->GetProperties()
|
||||||
.find(p)
|
.find(p)
|
||||||
!= tgt->GetProperties().end();
|
!= tgt->GetProperties().end();
|
||||||
|
@ -4991,7 +4987,7 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
|
||||||
!= theTarget->GetProperties().end();
|
!= theTarget->GetProperties().end();
|
||||||
PropertyType ifacePropContent =
|
PropertyType ifacePropContent =
|
||||||
getTypedProperty<PropertyType>(theTarget,
|
getTypedProperty<PropertyType>(theTarget,
|
||||||
interfaceProperty, 0);
|
interfaceProperty);
|
||||||
|
|
||||||
std::string reportEntry;
|
std::string reportEntry;
|
||||||
if (ifaceIsSet)
|
if (ifaceIsSet)
|
||||||
|
|
|
@ -287,8 +287,6 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
||||||
// Command to create a symbolic link. Fails on platforms not
|
|
||||||
// supporting them.
|
|
||||||
else if (args[1] == "environment" )
|
else if (args[1] == "environment" )
|
||||||
{
|
{
|
||||||
std::vector<std::string> env = cmSystemTools::GetEnvironmentVariables();
|
std::vector<std::string> env = cmSystemTools::GetEnvironmentVariables();
|
||||||
|
@ -352,8 +350,6 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
|
||||||
{
|
{
|
||||||
for (std::string::size_type cc = 2; cc < args.size(); cc ++)
|
for (std::string::size_type cc = 2; cc < args.size(); cc ++)
|
||||||
{
|
{
|
||||||
// Complain if the file could not be removed, still exists,
|
|
||||||
// and the -f option was not given.
|
|
||||||
if(!cmSystemTools::Touch(args[cc], true))
|
if(!cmSystemTools::Touch(args[cc], true))
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in New Issue