summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeVersion.cmake4
-rw-r--r--Source/cmDocumentGeneratorExpressions.h3
-rw-r--r--Source/cmDocumentVariables.cxx8
-rw-r--r--Source/cmDocumentation.cxx4
-rw-r--r--Source/cmExportInstallFileGenerator.cxx2
-rw-r--r--Source/cmGeneratorExpression.cxx25
-rw-r--r--Source/cmGeneratorExpression.h2
-rw-r--r--Source/cmGeneratorExpressionEvaluator.cxx35
-rw-r--r--Source/cmGlobalGenerator.cxx12
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx23
-rw-r--r--Source/cmGlobalVisualStudio8Generator.h2
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx88
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx18
-rw-r--r--Source/cmMakefile.cxx13
-rw-r--r--Source/cmMakefileTargetGenerator.cxx10
-rw-r--r--Source/cmPolicies.cxx64
-rw-r--r--Source/cmQtAutomoc.cxx46
-rw-r--r--Source/cmTarget.cxx14
-rw-r--r--Source/cmake.cxx10
19 files changed, 266 insertions, 117 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 3003a3a..e7d0bb7 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,6 +1,6 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 2)
set(CMake_VERSION_MINOR 8)
-set(CMake_VERSION_PATCH 11)
-set(CMake_VERSION_TWEAK 20130909)
+set(CMake_VERSION_PATCH 12)
+set(CMake_VERSION_TWEAK 20131007)
#set(CMake_VERSION_RC 1)
diff --git a/Source/cmDocumentGeneratorExpressions.h b/Source/cmDocumentGeneratorExpressions.h
index 46cd77e..7bab741 100644
--- a/Source/cmDocumentGeneratorExpressions.h
+++ b/Source/cmDocumentGeneratorExpressions.h
@@ -40,6 +40,9 @@
"is exported using export(), or when the target is used by another " \
"target in the same buildsystem. Expands to the empty string " \
"otherwise.\n" \
+ " $<PLATFORM_ID> = The CMake-id of the platform " \
+ " $<PLATFORM_ID:comp> = '1' if the The CMake-id of the " \
+ "platform matches comp, otherwise '0'.\n" \
" $<C_COMPILER_ID> = The CMake-id of the C compiler " \
"used.\n" \
" $<C_COMPILER_ID:comp> = '1' if the CMake-id of the C " \
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index c4f6216..54f41af 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -1578,6 +1578,14 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"See that target property for additional information.",
false,
"Variables that Control the Build");
+ cm->DefineProperty
+ ("CMAKE_MAP_IMPORTED_CONFIG_<CONFIG>", cmProperty::VARIABLE,
+ "Default value for MAP_IMPORTED_CONFIG_<CONFIG> of targets.",
+ "This variable is used to initialize the "
+ "MAP_IMPORTED_CONFIG_<CONFIG> property on all the targets. "
+ "See that target property for additional information.",
+ false,
+ "Variables that Control the Build");
// Variables defined when the a language is enabled These variables will
// also be defined whenever CMake has loaded its support for compiling (LANG)
diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx
index 4edacbb..b19d847 100644
--- a/Source/cmDocumentation.cxx
+++ b/Source/cmDocumentation.cxx
@@ -829,10 +829,10 @@ int cmDocumentation::GetStructuredDocFromFile(
std::vector<cmDocumentationEntry>& commands,
cmake* cm)
{
- typedef enum sdoce {
+ enum sdoce {
SDOC_NONE, SDOC_MODULE, SDOC_MACRO, SDOC_FUNCTION, SDOC_VARIABLE,
SDOC_SECTION,
- SDOC_UNKNOWN} sdoc_t;
+ SDOC_UNKNOWN};
int nbDocItemFound = 0;
int docCtxIdx = 0;
std::vector<int> docContextStack(60);
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index c97d4ff..c8b4a79 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -162,7 +162,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
if (require2_8_12)
{
- this->GenerateRequiredCMakeVersion(os, "2.8.11.20130626");
+ this->GenerateRequiredCMakeVersion(os, "2.8.12");
}
// Now load per-configuration properties for them.
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index e962313..97853f3 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -71,7 +71,7 @@ const char *cmCompiledGeneratorExpression::Evaluate(
cmTarget *currentTarget,
cmGeneratorExpressionDAGChecker *dagChecker) const
{
- if (!this->NeedsParsing)
+ if (!this->NeedsEvaluation)
{
return this->Input.c_str();
}
@@ -129,9 +129,9 @@ cmCompiledGeneratorExpression::cmCompiledGeneratorExpression(
cmGeneratorExpressionLexer l;
std::vector<cmGeneratorExpressionToken> tokens =
l.Tokenize(this->Input.c_str());
- this->NeedsParsing = l.GetSawGeneratorExpression();
+ this->NeedsEvaluation = l.GetSawGeneratorExpression();
- if (this->NeedsParsing)
+ if (this->NeedsEvaluation)
{
cmGeneratorExpressionParser p(tokens);
p.Parse(this->Evaluators);
@@ -192,11 +192,12 @@ static std::string stripAllGeneratorExpressions(const std::string &input)
std::string result;
std::string::size_type pos = 0;
std::string::size_type lastPos = pos;
+ int nestingLevel = 0;
while((pos = input.find("$<", lastPos)) != input.npos)
{
result += input.substr(lastPos, pos - lastPos);
pos += 2;
- int nestingLevel = 1;
+ nestingLevel = 1;
const char *c = input.c_str() + pos;
const char * const cStart = c;
for ( ; *c; ++c)
@@ -224,7 +225,10 @@ static std::string stripAllGeneratorExpressions(const std::string &input)
pos += traversed;
lastPos = pos;
}
- result += input.substr(lastPos);
+ if (nestingLevel == 0)
+ {
+ result += input.substr(lastPos);
+ }
return cmGeneratorExpression::StripEmptyListElements(result);
}
@@ -234,9 +238,12 @@ static void prefixItems(const std::string &content, std::string &result,
{
std::vector<std::string> entries;
cmGeneratorExpression::Split(content, entries);
+ const char *sep = "";
for(std::vector<std::string>::const_iterator ei = entries.begin();
ei != entries.end(); ++ei)
{
+ result += sep;
+ sep = ";";
if (!cmSystemTools::FileIsFullPath(ei->c_str())
&& cmGeneratorExpression::Find(*ei) == std::string::npos)
{
@@ -253,6 +260,7 @@ static std::string stripExportInterface(const std::string &input,
{
std::string result;
+ int nestingLevel = 0;
std::string::size_type pos = 0;
std::string::size_type lastPos = pos;
while (true)
@@ -282,7 +290,7 @@ static std::string stripExportInterface(const std::string &input,
const bool gotInstallInterface = input[pos + 2] == 'I';
pos += gotInstallInterface ? sizeof("$<INSTALL_INTERFACE:") - 1
: sizeof("$<BUILD_INTERFACE:") - 1;
- int nestingLevel = 1;
+ nestingLevel = 1;
const char *c = input.c_str() + pos;
const char * const cStart = c;
for ( ; *c; ++c)
@@ -331,7 +339,10 @@ static std::string stripExportInterface(const std::string &input,
pos += traversed;
lastPos = pos;
}
- result += input.substr(lastPos);
+ if (nestingLevel == 0)
+ {
+ result += input.substr(lastPos);
+ }
return cmGeneratorExpression::StripEmptyListElements(result);
}
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index c20f130..bc0f6c2 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -126,7 +126,7 @@ private:
cmListFileBacktrace Backtrace;
std::vector<cmGeneratorExpressionEvaluator*> Evaluators;
const std::string Input;
- bool NeedsParsing;
+ bool NeedsEvaluation;
mutable std::set<cmTarget*> DependTargets;
mutable std::set<cmTarget*> AllTargetsSeen;
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index abe4e70..7fd0fdc 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -438,6 +438,39 @@ static const struct CxxCompilerVersionNode : public CompilerVersionNode
//----------------------------------------------------------------------------
+struct PlatformIdNode : public cmGeneratorExpressionNode
+{
+ PlatformIdNode() {}
+
+ virtual int NumExpectedParameters() const { return ZeroOrMoreParameters; }
+
+ std::string Evaluate(const std::vector<std::string> &parameters,
+ cmGeneratorExpressionContext *context,
+ const GeneratorExpressionContent *,
+ cmGeneratorExpressionDAGChecker *) const
+ {
+ const char *platformId = context->Makefile ?
+ context->Makefile->GetSafeDefinition(
+ "CMAKE_SYSTEM_NAME") : "";
+ if (parameters.size() == 0)
+ {
+ return platformId ? platformId : "";
+ }
+
+ if (!platformId)
+ {
+ return parameters.front().empty() ? "1" : "0";
+ }
+
+ if (cmsysString_strcasecmp(parameters.begin()->c_str(), platformId) == 0)
+ {
+ return "1";
+ }
+ return "0";
+ }
+} platformIdNode;
+
+//----------------------------------------------------------------------------
static const struct VersionGreaterNode : public cmGeneratorExpressionNode
{
VersionGreaterNode() {}
@@ -1356,6 +1389,8 @@ cmGeneratorExpressionNode* GetNode(const std::string &identifier)
return &cCompilerVersionNode;
else if (identifier == "CXX_COMPILER_VERSION")
return &cxxCompilerVersionNode;
+ else if (identifier == "PLATFORM_ID")
+ return &platformIdNode;
else if (identifier == "CONFIGURATION")
return &configurationNode;
else if (identifier == "CONFIG")
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 7f2b592..799bbdb 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -146,9 +146,17 @@ void cmGlobalGenerator::ResolveLanguageCompiler(const std::string &lang,
const char* cname = this->GetCMakeInstance()->
GetCacheManager()->GetCacheValue(langComp.c_str());
std::string changeVars;
- if(cname && (path != cname) && (optional==false))
+ if(cname && !optional)
{
- std::string cnameString = cname;
+ std::string cnameString;
+ if(!cmSystemTools::FileIsFullPath(cname))
+ {
+ cnameString = cmSystemTools::FindProgram(cname);
+ }
+ else
+ {
+ cnameString = cname;
+ }
std::string pathString = path;
// get rid of potentially multiple slashes:
cmSystemTools::ConvertToUnixSlashes(cnameString);
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index e4244e0..1a4c7ff 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -202,7 +202,7 @@ std::string cmGlobalVisualStudio8Generator::GetUserMacrosRegKeyBase()
}
//----------------------------------------------------------------------------
-void cmGlobalVisualStudio8Generator::AddCheckTarget()
+bool cmGlobalVisualStudio8Generator::AddCheckTarget()
{
// Add a special target on which all other targets depend that
// checks the build system and optionally re-runs CMake.
@@ -216,7 +216,7 @@ void cmGlobalVisualStudio8Generator::AddCheckTarget()
// Skip the target if no regeneration is to be done.
if(mf->IsOn("CMAKE_SUPPRESS_REGENERATION"))
{
- return;
+ return false;
}
std::string cmake_command = mf->GetRequiredDefinition("CMAKE_COMMAND");
@@ -315,21 +315,24 @@ void cmGlobalVisualStudio8Generator::AddCheckTarget()
cmSystemTools::Error("Error adding rule for ", stamps[0].c_str());
}
}
+
+ return true;
}
//----------------------------------------------------------------------------
void cmGlobalVisualStudio8Generator::Generate()
{
- this->AddCheckTarget();
-
- // All targets depend on the build-system check target.
- for(std::map<cmStdString,cmTarget *>::const_iterator
- ti = this->TotalTargets.begin();
- ti != this->TotalTargets.end(); ++ti)
+ if(this->AddCheckTarget())
{
- if(ti->first != CMAKE_CHECK_BUILD_SYSTEM_TARGET)
+ // All targets depend on the build-system check target.
+ for(std::map<cmStdString,cmTarget *>::const_iterator
+ ti = this->TotalTargets.begin();
+ ti != this->TotalTargets.end(); ++ti)
{
- ti->second->AddUtility(CMAKE_CHECK_BUILD_SYSTEM_TARGET);
+ if(ti->first != CMAKE_CHECK_BUILD_SYSTEM_TARGET)
+ {
+ ti->second->AddUtility(CMAKE_CHECK_BUILD_SYSTEM_TARGET);
+ }
}
}
diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h
index d181742..2376f8a 100644
--- a/Source/cmGlobalVisualStudio8Generator.h
+++ b/Source/cmGlobalVisualStudio8Generator.h
@@ -71,7 +71,7 @@ protected:
virtual bool VSLinksDependencies() const { return false; }
- void AddCheckTarget();
+ bool AddCheckTarget();
static cmIDEFlagTable const* GetExtraFlagTableVS8();
virtual void WriteSLNHeader(std::ostream& fout);
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 7cb2d1f..0a2b32b 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -431,13 +431,16 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
// Add XCODE depend helper
std::string dir = mf->GetCurrentOutputDirectory();
- cmCustomCommandLine makecommand;
- makecommand.push_back("make");
- makecommand.push_back("-C");
- makecommand.push_back(dir.c_str());
- makecommand.push_back("-f");
- makecommand.push_back(this->CurrentXCodeHackMakefile.c_str());
- makecommand.push_back(""); // placeholder, see below
+ cmCustomCommandLine makeHelper;
+ if(this->XcodeVersion < 50)
+ {
+ makeHelper.push_back("make");
+ makeHelper.push_back("-C");
+ makeHelper.push_back(dir.c_str());
+ makeHelper.push_back("-f");
+ makeHelper.push_back(this->CurrentXCodeHackMakefile.c_str());
+ makeHelper.push_back(""); // placeholder, see below
+ }
// Add ZERO_CHECK
bool regenerate = !mf->IsOn("CMAKE_SUPPRESS_REGENERATION");
@@ -477,17 +480,18 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
// run the depend check makefile as a post build rule
// this will make sure that when the next target is built
// things are up-to-date
- if((target.GetType() == cmTarget::EXECUTABLE ||
+ if(!makeHelper.empty() &&
+ (target.GetType() == cmTarget::EXECUTABLE ||
// Nope - no post-build for OBJECT_LIRBRARY
// target.GetType() == cmTarget::OBJECT_LIBRARY ||
target.GetType() == cmTarget::STATIC_LIBRARY ||
target.GetType() == cmTarget::SHARED_LIBRARY ||
target.GetType() == cmTarget::MODULE_LIBRARY))
{
- makecommand[makecommand.size()-1] =
+ makeHelper[makeHelper.size()-1] = // fill placeholder
this->PostBuildMakeTarget(target.GetName(), "$(CONFIGURATION)");
cmCustomCommandLines commandLines;
- commandLines.push_back(makecommand);
+ commandLines.push_back(makeHelper);
lg->GetMakefile()->AddCustomCommandToTarget(target.GetName(),
no_depends,
commandLines,
@@ -1027,18 +1031,21 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
}
}
- // Add object library contents as external objects. (Equivalent to
- // the externalObjFiles above, except each one is not a cmSourceFile
- // within the target.)
- std::vector<std::string> objs;
- this->GetGeneratorTarget(&cmtarget)->UseObjectLibraries(objs);
- for(std::vector<std::string>::const_iterator
- oi = objs.begin(); oi != objs.end(); ++oi)
+ if(this->XcodeVersion < 50)
{
- std::string obj = *oi;
- cmXCodeObject* xsf =
- this->CreateXCodeSourceFileFromPath(obj, cmtarget, "");
- externalObjFiles.push_back(xsf);
+ // Add object library contents as external objects. (Equivalent to
+ // the externalObjFiles above, except each one is not a cmSourceFile
+ // within the target.)
+ std::vector<std::string> objs;
+ this->GetGeneratorTarget(&cmtarget)->UseObjectLibraries(objs);
+ for(std::vector<std::string>::const_iterator
+ oi = objs.begin(); oi != objs.end(); ++oi)
+ {
+ std::string obj = *oi;
+ cmXCodeObject* xsf =
+ this->CreateXCodeSourceFileFromPath(obj, cmtarget, "");
+ externalObjFiles.push_back(xsf);
+ }
}
// some build phases only apply to bundles and/or frameworks
@@ -2765,13 +2772,6 @@ void cmGlobalXCodeGenerator
}
}
- // Skip link information for static libraries.
- if(cmtarget->GetType() == cmTarget::OBJECT_LIBRARY ||
- cmtarget->GetType() == cmTarget::STATIC_LIBRARY)
- {
- return;
- }
-
// Loop over configuration types and set per-configuration info.
for(std::vector<std::string>::iterator i =
this->CurrentConfigurationTypes.begin();
@@ -2784,6 +2784,31 @@ void cmGlobalXCodeGenerator
configName = 0;
}
+ if(this->XcodeVersion >= 50)
+ {
+ // Add object library contents as link flags.
+ std::string linkObjs;
+ const char* sep = "";
+ std::vector<std::string> objs;
+ this->GetGeneratorTarget(cmtarget)->UseObjectLibraries(objs);
+ for(std::vector<std::string>::const_iterator
+ oi = objs.begin(); oi != objs.end(); ++oi)
+ {
+ linkObjs += sep;
+ sep = " ";
+ linkObjs += this->XCodeEscapePath(oi->c_str());
+ }
+ this->AppendBuildSettingAttribute(target, "OTHER_LDFLAGS",
+ linkObjs.c_str(), configName);
+ }
+
+ // Skip link information for object libraries.
+ if(cmtarget->GetType() == cmTarget::OBJECT_LIBRARY ||
+ cmtarget->GetType() == cmTarget::STATIC_LIBRARY)
+ {
+ continue;
+ }
+
// Compute the link library and directory information.
cmComputeLinkInformation* pcli = cmtarget->GetLinkInformation(configName);
if(!pcli)
@@ -3338,8 +3363,11 @@ void cmGlobalXCodeGenerator
cmXCodeObject* t = *i;
this->AddDependAndLinkInformation(t);
}
- // now create xcode depend hack makefile
- this->CreateXCodeDependHackTarget(targets);
+ if(this->XcodeVersion < 50)
+ {
+ // now create xcode depend hack makefile
+ this->CreateXCodeDependHackTarget(targets);
+ }
// now add all targets to the root object
cmXCodeObject* allTargets = this->CreateObject(cmXCodeObject::OBJECT_LIST);
for(std::vector<cmXCodeObject*>::iterator i = targets.begin();
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 58cc6f4..bd6c860 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -1954,23 +1954,27 @@ cmLocalVisualStudio7Generator
// Compute the version of the Intel plugin to the VS IDE.
// If the key does not exist then use a default guess.
- std::string intelVersion = "9.10";
+ std::string intelVersion;
std::string vskey = gg->GetRegistryBase();
vskey += "\\Packages\\" CM_INTEL_PLUGIN_GUID ";ProductVersion";
cmSystemTools::ReadRegistryValue(vskey.c_str(), intelVersion,
cmSystemTools::KeyWOW64_32);
- if (intelVersion.find("13") == 0 ||
- intelVersion.find("12") == 0 ||
- intelVersion.find("11") == 0)
+ unsigned int intelVersionNumber = ~0u;
+ sscanf(intelVersion.c_str(), "%u", &intelVersionNumber);
+ if(intelVersionNumber >= 11)
{
- // Version 11.x, 12.x, and 13.x actually use 11.0 in project files!
- intelVersion = "11.0" ;
+ // Default to latest known project file version.
+ intelVersion = "11.0";
}
- else if(intelVersion.find("10") == 0)
+ else if(intelVersionNumber == 10)
{
// Version 10.x actually uses 9.10 in project files!
intelVersion = "9.10";
}
+ else
+ {
+ // Version <= 9: use ProductVersion from registry.
+ }
fout << "<?xml version=\"1.0\" encoding = \"Windows-1252\"?>\n"
<< "<VisualStudioProject\n"
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index fd06a33..34541e9 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1069,6 +1069,19 @@ void
cmMakefile::UpdateOutputToSourceMap(std::string const& output,
cmSourceFile* source)
{
+ OutputToSourceMap::iterator i = this->OutputToSource.find(output);
+ if(i != this->OutputToSource.end())
+ {
+ // Multiple custom commands produce the same output but may
+ // be attached to a different source file (MAIN_DEPENDENCY).
+ // LinearGetSourceFileWithOutput would return the first one,
+ // so keep the mapping for the first one.
+ //
+ // TODO: Warn the user about this case. However, the VS 8 generator
+ // triggers it for separate generate.stamp rules in ZERO_CHECK and
+ // individual targets.
+ return;
+ }
this->OutputToSource[output] = source;
}
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 0829cab..4e40f6c 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -21,6 +21,7 @@
#include "cmTarget.h"
#include "cmake.h"
#include "cmComputeLinkInformation.h"
+#include "cmGeneratorExpression.h"
#include "cmMakefileExecutableTargetGenerator.h"
#include "cmMakefileLibraryTargetGenerator.h"
@@ -131,7 +132,14 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
this->Makefile->GetProperty
("ADDITIONAL_MAKE_CLEAN_FILES"))
{
- cmSystemTools::ExpandListArgument(additional_clean_files,
+ const char *config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE");
+ cmListFileBacktrace lfbt;
+ cmGeneratorExpression ge(lfbt);
+ cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
+ ge.Parse(additional_clean_files);
+
+ cmSystemTools::ExpandListArgument(cge->Evaluate(this->Makefile, config,
+ false, this->Target, 0, 0),
this->CleanFiles);
}
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index a823f05..f9197e0 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -27,11 +27,11 @@ public:
cmPolicies::PolicyStatus status)
{
if (!idString || !shortDescription || ! longDescription)
- {
+ {
cmSystemTools::Error("Attempt to define a policy without "
"all parameters being specified!");
return;
- }
+ }
this->ID = iD;
this->IDString = idString;
this->ShortDescription = shortDescription;
@@ -61,29 +61,29 @@ public:
unsigned int tweakV)
{
if (majorV < this->MajorVersionIntroduced)
- {
+ {
return true;
- }
+ }
if (majorV > this->MajorVersionIntroduced)
- {
+ {
return false;
- }
+ }
if (minorV < this->MinorVersionIntroduced)
- {
+ {
return true;
- }
+ }
if (minorV > this->MinorVersionIntroduced)
- {
+ {
return false;
- }
+ }
if (patchV < this->PatchVersionIntroduced)
- {
+ {
return true;
- }
+ }
if (patchV > this->PatchVersionIntroduced)
- {
+ {
return false;
- }
+ }
return (tweakV < this->TweakVersionIntroduced);
}
@@ -609,9 +609,9 @@ cmPolicies::~cmPolicies()
std::map<cmPolicies::PolicyID,cmPolicy *>::iterator i
= this->Policies.begin();
for (;i != this->Policies.end(); ++i)
- {
+ {
delete i->second;
- }
+ }
}
void cmPolicies::DefinePolicy(cmPolicies::PolicyID iD,
@@ -626,11 +626,11 @@ void cmPolicies::DefinePolicy(cmPolicies::PolicyID iD,
{
// a policy must be unique and can only be defined once
if (this->Policies.find(iD) != this->Policies.end())
- {
+ {
cmSystemTools::Error("Attempt to redefine a CMake policy for policy "
"ID ", this->GetPolicyIDString(iD).c_str());
return;
- }
+ }
this->Policies[iD] = new cmPolicy(iD, idString,
shortDescription,
@@ -784,15 +784,15 @@ bool cmPolicies::GetPolicyDefault(cmMakefile* mf, std::string const& policy,
bool cmPolicies::GetPolicyID(const char *id, cmPolicies::PolicyID &pid)
{
if (!id || strlen(id) < 1)
- {
+ {
return false;
- }
+ }
std::map<std::string,cmPolicies::PolicyID>::iterator pos =
this->PolicyStringMap.find(id);
if (pos == this->PolicyStringMap.end())
- {
+ {
return false;
- }
+ }
pid = pos->second;
return true;
}
@@ -802,9 +802,9 @@ std::string cmPolicies::GetPolicyIDString(cmPolicies::PolicyID pid)
std::map<cmPolicies::PolicyID,cmPolicy *>::iterator pos =
this->Policies.find(pid);
if (pos == this->Policies.end())
- {
+ {
return "";
- }
+ }
return pos->second->IDString;
}
@@ -815,11 +815,11 @@ std::string cmPolicies::GetPolicyWarning(cmPolicies::PolicyID id)
std::map<cmPolicies::PolicyID,cmPolicy *>::iterator pos =
this->Policies.find(id);
if (pos == this->Policies.end())
- {
+ {
cmSystemTools::Error(
"Request for warning text for undefined policy!");
return "Request for warning text for undefined policy!";
- }
+ }
cmOStringStream msg;
msg <<
@@ -839,11 +839,11 @@ std::string cmPolicies::GetRequiredPolicyError(cmPolicies::PolicyID id)
std::map<cmPolicies::PolicyID,cmPolicy *>::iterator pos =
this->Policies.find(id);
if (pos == this->Policies.end())
- {
+ {
cmSystemTools::Error(
"Request for error text for undefined policy!");
return "Request for error text for undefined policy!";
- }
+ }
cmOStringStream error;
error <<
@@ -869,10 +869,10 @@ cmPolicies::GetPolicyStatus(cmPolicies::PolicyID id)
std::map<cmPolicies::PolicyID,cmPolicy *>::iterator pos =
this->Policies.find(id);
if (pos == this->Policies.end())
- {
+ {
// TODO is this right?
return cmPolicies::WARN;
- }
+ }
return pos->second->Status;
}
@@ -883,7 +883,7 @@ void cmPolicies::GetDocumentation(std::vector<cmDocumentationEntry>& v)
std::map<cmPolicies::PolicyID,cmPolicy *>::iterator i
= this->Policies.begin();
for (;i != this->Policies.end(); ++i)
- {
+ {
cmOStringStream full;
full << i->second->LongDescription;
full << "\nThis policy was introduced in CMake version ";
@@ -920,7 +920,7 @@ void cmPolicies::GetDocumentation(std::vector<cmDocumentationEntry>& v)
i->second->ShortDescription.c_str(),
full.str().c_str());
v.push_back(e);
- }
+ }
}
//----------------------------------------------------------------------------
diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx
index 93e39ab..54df12c 100644
--- a/Source/cmQtAutomoc.cxx
+++ b/Source/cmQtAutomoc.cxx
@@ -32,16 +32,28 @@
#include "cmQtAutomoc.h"
-static bool containsQ_OBJECT(const std::string& text)
+static bool requiresMocing(const std::string& text, std::string &macroName)
{
// this simple check is much much faster than the regexp
- if (strstr(text.c_str(), "Q_OBJECT") == NULL)
+ if (strstr(text.c_str(), "Q_OBJECT") == NULL
+ && strstr(text.c_str(), "Q_GADGET") == NULL)
{
return false;
}
cmsys::RegularExpression qObjectRegExp("[\n][ \t]*Q_OBJECT[^a-zA-Z0-9_]");
- return qObjectRegExp.find(text);
+ if (qObjectRegExp.find(text))
+ {
+ macroName = "Q_OBJECT";
+ return true;
+ }
+ cmsys::RegularExpression qGadgetRegExp("[\n][ \t]*Q_GADGET[^a-zA-Z0-9_]");
+ if (qGadgetRegExp.find(text))
+ {
+ macroName = "Q_GADGET";
+ return true;
+ }
+ return false;
}
@@ -837,7 +849,8 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename,
cmsys::SystemTools::GetRealPath(absFilename.c_str())) + '/';
const std::string scannedFileBasename = cmsys::SystemTools::
GetFilenameWithoutLastExtension(absFilename);
- const bool cppContainsQ_OBJECT = containsQ_OBJECT(contentsString);
+ std::string macroName;
+ const bool requiresMoc = requiresMocing(contentsString, macroName);
bool dotMocIncluded = false;
bool mocUnderscoreIncluded = false;
std::string ownMocUnderscoreFile;
@@ -908,7 +921,7 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename,
else
{
std::string fileToMoc = absFilename;
- if ((basename != scannedFileBasename) || (cppContainsQ_OBJECT==false))
+ if ((basename != scannedFileBasename) || (requiresMoc==false))
{
std::string mocSubDir = extractSubDir(absPath, currentMoc);
std::string headerToMoc = findMatchingHeader(
@@ -917,12 +930,12 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename,
{
// this is for KDE4 compatibility:
fileToMoc = headerToMoc;
- if ((cppContainsQ_OBJECT==false) &&(basename==scannedFileBasename))
+ if ((requiresMoc==false) &&(basename==scannedFileBasename))
{
std::cerr << "AUTOMOC: warning: " << absFilename << ": The file "
"includes the moc file \"" << currentMoc <<
- "\", but does not contain a Q_OBJECT macro. "
- "Running moc on "
+ "\", but does not contain a " << macroName
+ << " macro. Running moc on "
<< "\"" << headerToMoc << "\" ! Include \"moc_"
<< basename << ".cpp\" for a compatiblity with "
"strict mode (see CMAKE_AUTOMOC_RELAXED_MODE).\n"
@@ -965,13 +978,14 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename,
// If this is the case, the moc_foo.cpp should probably be generated from
// foo.cpp instead of foo.h, because otherwise it won't build.
// But warn, since this is not how it is supposed to be used.
- if ((dotMocIncluded == false) && (cppContainsQ_OBJECT == true))
+ if ((dotMocIncluded == false) && (requiresMoc == true))
{
if (mocUnderscoreIncluded == true)
{
// this is for KDE4 compatibility:
std::cerr << "AUTOMOC: warning: " << absFilename << ": The file "
- << "contains a Q_OBJECT macro, but does not include "
+ << "contains a " << macroName << " macro, but does not "
+ "include "
<< "\"" << scannedFileBasename << ".moc\", but instead "
"includes "
<< "\"" << ownMocUnderscoreFile << "\". Running moc on "
@@ -986,7 +1000,8 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename,
{
// otherwise always error out since it will not compile:
std::cerr << "AUTOMOC: error: " << absFilename << ": The file "
- << "contains a Q_OBJECT macro, but does not include "
+ << "contains a " << macroName << " macro, but does not "
+ "include "
<< "\"" << scannedFileBasename << ".moc\" !\n"
<< std::endl;
::exit(EXIT_FAILURE);
@@ -1094,11 +1109,13 @@ void cmQtAutomoc::StrictParseCppFile(const std::string& absFilename,
// If this is the case, the moc_foo.cpp should probably be generated from
// foo.cpp instead of foo.h, because otherwise it won't build.
// But warn, since this is not how it is supposed to be used.
- if ((dotMocIncluded == false) && (containsQ_OBJECT(contentsString)))
+ std::string macroName;
+ if ((dotMocIncluded == false) && (requiresMocing(contentsString,
+ macroName)))
{
// otherwise always error out since it will not compile:
std::cerr << "AUTOMOC: error: " << absFilename << ": The file "
- << "contains a Q_OBJECT macro, but does not include "
+ << "contains a " << macroName << " macro, but does not include "
<< "\"" << scannedFileBasename << ".moc\" !\n"
<< std::endl;
::exit(EXIT_FAILURE);
@@ -1165,7 +1182,8 @@ void cmQtAutomoc::ParseHeaders(const std::set<std::string>& absHeaders,
const std::string currentMoc = "moc_" + basename + ".cpp";
const std::string contents = this->ReadAll(headerName);
- if (containsQ_OBJECT(contents))
+ std::string macroName;
+ if (requiresMocing(contents, macroName))
{
//std::cout << "header contains Q_OBJECT macro";
notIncludedMocs[headerName] = currentMoc;
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index d18d2b8..b491762 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -924,7 +924,10 @@ void cmTarget::DefineProperties(cmake *cm)
"The first configuration in the list found to be provided by the "
"imported target is selected. If this property is set and no matching "
"configurations are available, then the imported target is considered "
- "to be not found. This property is ignored for non-imported targets.",
+ "to be not found. This property is ignored for non-imported targets.\n"
+ "This property is initialized by the value of the variable "
+ "CMAKE_MAP_IMPORTED_CONFIG_<CONFIG> if it is set when a target is "
+ "created.",
false /* TODO: make this chained */ );
cm->DefineProperty
@@ -1649,6 +1652,7 @@ void cmTarget::SetMakefile(cmMakefile* mf)
"LIBRARY_OUTPUT_DIRECTORY_",
"RUNTIME_OUTPUT_DIRECTORY_",
"PDB_OUTPUT_DIRECTORY_",
+ "MAP_IMPORTED_CONFIG_",
0};
for(std::vector<std::string>::iterator ci = configNames.begin();
ci != configNames.end(); ++ci)
@@ -6471,7 +6475,13 @@ bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface,
->GetPolicyWarning(cmPolicies::CMP0022)) << "\n"
<< "Target \"" << this->GetName() << "\" has a "
"INTERFACE_LINK_LIBRARIES property which differs from its "
- << linkIfaceProp << " properties.";
+ << linkIfaceProp << " properties."
+ "\n"
+ "INTERFACE_LINK_LIBRARIES:\n "
+ << newExplicitLibraries
+ << "\n"
+ << linkIfaceProp << ":\n "
+ << (explicitLibraries ? explicitLibraries : "(empty)") << "\n";
this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
}
// Fall through
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 290aff0..8b8cb01 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -2437,11 +2437,6 @@ int cmake::ActualConfigure()
{
this->CacheManager->SaveCache(this->GetHomeOutputDirectory());
}
- if ( !this->GraphVizFile.empty() )
- {
- std::cout << "Generate graphviz: " << this->GraphVizFile << std::endl;
- this->GenerateGraphViz(this->GraphVizFile.c_str());
- }
if(cmSystemTools::GetErrorOccuredFlag())
{
return -1;
@@ -2604,6 +2599,11 @@ int cmake::Generate()
return -1;
}
this->GlobalGenerator->Generate();
+ if ( !this->GraphVizFile.empty() )
+ {
+ std::cout << "Generate graphviz: " << this->GraphVizFile << std::endl;
+ this->GenerateGraphViz(this->GraphVizFile.c_str());
+ }
if(this->WarnUnusedCli)
{
this->RunCheckForUnusedVariables();