diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmConditionEvaluator.cxx | 5 | ||||
-rw-r--r-- | Source/cmExportBuildFileGenerator.cxx | 10 | ||||
-rw-r--r-- | Source/cmExportInstallFileGenerator.cxx | 11 | ||||
-rw-r--r-- | Source/cmGeneratorExpressionEvaluator.cxx | 74 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 3 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.cxx | 18 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.h | 5 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio11Generator.cxx | 119 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio11Generator.h | 11 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio12Generator.cxx | 111 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio12Generator.h | 10 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio14Generator.cxx | 40 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 47 | ||||
-rw-r--r-- | Source/cmMakefile.h | 5 | ||||
-rw-r--r-- | Source/cmSourceFileLocation.cxx | 3 | ||||
-rw-r--r-- | Source/cmStringCommand.cxx | 44 | ||||
-rw-r--r-- | Source/cmStringCommand.h | 2 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 26 | ||||
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 7 | ||||
-rw-r--r-- | Source/cmake.cxx | 2 | ||||
-rw-r--r-- | Source/kwsys/SharedForward.h.in | 2 |
21 files changed, 407 insertions, 148 deletions
diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx index aba26de..6065b8a 100644 --- a/Source/cmConditionEvaluator.cxx +++ b/Source/cmConditionEvaluator.cxx @@ -11,6 +11,7 @@ ============================================================================*/ #include "cmConditionEvaluator.h" +#include "cmStringCommand.h" cmConditionEvaluator::cmConditionEvaluator(cmMakefile& makefile): Makefile(makefile), @@ -555,7 +556,7 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList &newArgs, { def = this->GetVariableOrString(*arg); const char* rex = argP2->c_str(); - this->Makefile.ClearMatches(); + cmStringCommand::ClearMatches(&this->Makefile); cmsys::RegularExpression regEntry; if ( !regEntry.compile(rex) ) { @@ -567,7 +568,7 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList &newArgs, } if (regEntry.find(def)) { - this->Makefile.StoreMatches(regEntry); + cmStringCommand::StoreMatches(&this->Makefile, regEntry); *arg = cmExpandedCommandArgument("1", true); } else diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx index 30a52d4..134ee98 100644 --- a/Source/cmExportBuildFileGenerator.cxx +++ b/Source/cmExportBuildFileGenerator.cxx @@ -68,6 +68,16 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os) tei != this->Exports.end(); ++tei) { cmTarget* te = *tei; + if (te->GetProperty("INTERFACE_SOURCES")) + { + cmOStringStream e; + e << "Target \"" + << te->GetName() + << "\" has a populated INTERFACE_SOURCES property. This is not " + "currently supported."; + cmSystemTools::Error(e.str().c_str()); + return false; + } this->GenerateImportTargetCode(os, te); te->AppendBuildInterfaceIncludes(); diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index 89071c0..23180f1 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -123,6 +123,17 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os) { cmTarget* te = (*tei)->Target; + if (te->GetProperty("INTERFACE_SOURCES")) + { + cmOStringStream e; + e << "Target \"" + << te->GetName() + << "\" has a populated INTERFACE_SOURCES property. This is not " + "currently supported."; + cmSystemTools::Error(e.str().c_str()); + return false; + } + requiresConfigFiles = requiresConfigFiles || te->GetType() != cmTarget::INTERFACE_LIBRARY; diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 67a1a6d..84a4daa 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -69,9 +69,42 @@ struct cmGeneratorExpressionNode const GeneratorExpressionContent *content, cmGeneratorExpressionDAGChecker *dagChecker ) const = 0; + + static std::string EvaluateDependentExpression( + std::string const& prop, cmMakefile *makefile, + cmGeneratorExpressionContext *context, + cmTarget const* headTarget, cmTarget const* currentTarget, + cmGeneratorExpressionDAGChecker *dagChecker); }; //---------------------------------------------------------------------------- +std::string cmGeneratorExpressionNode::EvaluateDependentExpression( + std::string const& prop, cmMakefile *makefile, + cmGeneratorExpressionContext *context, + cmTarget const* headTarget, cmTarget const* currentTarget, + cmGeneratorExpressionDAGChecker *dagChecker) +{ + cmGeneratorExpression ge(&context->Backtrace); + cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop); + cge->SetEvaluateForBuildsystem(context->EvaluateForBuildsystem); + std::string result = cge->Evaluate(makefile, + context->Config, + context->Quiet, + headTarget, + currentTarget, + dagChecker); + if (cge->GetHadContextSensitiveCondition()) + { + context->HadContextSensitiveCondition = true; + } + if (cge->GetHadHeadSensitiveCondition()) + { + context->HadHeadSensitiveCondition = true; + } + return result; +} + +//---------------------------------------------------------------------------- static const struct ZeroNode : public cmGeneratorExpressionNode { ZeroNode() {} @@ -825,22 +858,10 @@ getLinkedTargetsContent( } if(!depString.empty()) { - cmGeneratorExpression ge(&context->Backtrace); - cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(depString); - linkedTargetsContent = cge->Evaluate(target->GetMakefile(), - context->Config, - context->Quiet, - headTarget, - target, - dagChecker); - if (cge->GetHadContextSensitiveCondition()) - { - context->HadContextSensitiveCondition = true; - } - if (cge->GetHadHeadSensitiveCondition()) - { - context->HadHeadSensitiveCondition = true; - } + linkedTargetsContent = + cmGeneratorExpressionNode::EvaluateDependentExpression(depString, + target->GetMakefile(), context, + headTarget, target, dagChecker); } linkedTargetsContent = cmGeneratorExpression::StripEmptyListElements(linkedTargetsContent); @@ -1181,24 +1202,9 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode } if(!interfacePropertyName.empty()) { - cmGeneratorExpression ge(&context->Backtrace); - cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop); - cge->SetEvaluateForBuildsystem(context->EvaluateForBuildsystem); - std::string result = cge->Evaluate(context->Makefile, - context->Config, - context->Quiet, - headTarget, - target, - &dagChecker); - - if (cge->GetHadContextSensitiveCondition()) - { - context->HadContextSensitiveCondition = true; - } - if (cge->GetHadHeadSensitiveCondition()) - { - context->HadHeadSensitiveCondition = true; - } + std::string result = this->EvaluateDependentExpression(prop, + context->Makefile, context, + headTarget, target, &dagChecker); if (!linkedTargetsContent.empty()) { result += (result.empty() ? "" : ";") + linkedTargetsContent; diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index ae0e807..2f4d9bb 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -2362,7 +2362,8 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) depends.push_back(this->GetAllTargetName()); } } - if(mf->GetDefinition("CMake_BINARY_DIR")) + if(mf->GetDefinition("CMake_BINARY_DIR") && + !mf->IsOn("CMAKE_CROSSCOMPILING")) { // We are building CMake itself. We cannot use the original // executable to install over itself. The generator will diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index d70d2af..499ac56 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -262,6 +262,24 @@ bool cmGlobalVisualStudio10Generator::InitializeWindowsStore(cmMakefile* mf) } //---------------------------------------------------------------------------- +bool +cmGlobalVisualStudio10Generator::SelectWindowsPhoneToolset( + std::string& toolset) const +{ + toolset = ""; + return false; +} + +//---------------------------------------------------------------------------- +bool +cmGlobalVisualStudio10Generator::SelectWindowsStoreToolset( + std::string& toolset) const +{ + toolset = ""; + return false; +} + +//---------------------------------------------------------------------------- std::string cmGlobalVisualStudio10Generator::SelectWindowsCEToolset() const { if (this->SystemVersion == "8.0") diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index 686dcdf..3b0a5cf 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -118,9 +118,10 @@ protected: virtual bool InitializeWindowsCE(cmMakefile* mf); virtual bool InitializeWindowsPhone(cmMakefile* mf); virtual bool InitializeWindowsStore(cmMakefile* mf); + virtual std::string SelectWindowsCEToolset() const; - virtual std::string SelectWindowsPhoneToolset() const { return ""; } - virtual std::string SelectWindowsStoreToolset() const { return ""; } + virtual bool SelectWindowsPhoneToolset(std::string& toolset) const; + virtual bool SelectWindowsStoreToolset(std::string& toolset) const; virtual const char* GetIDEVersion() { return "10.0"; } diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx index 39bbdc0..2b69222 100644 --- a/Source/cmGlobalVisualStudio11Generator.cxx +++ b/Source/cmGlobalVisualStudio11Generator.cxx @@ -131,12 +131,20 @@ cmGlobalVisualStudio11Generator::MatchesGeneratorName( //---------------------------------------------------------------------------- bool cmGlobalVisualStudio11Generator::InitializeWindowsPhone(cmMakefile* mf) { - this->DefaultPlatformToolset = this->SelectWindowsPhoneToolset(); - if(this->DefaultPlatformToolset.empty()) + if(!this->SelectWindowsPhoneToolset(this->DefaultPlatformToolset)) { cmOStringStream e; - e << this->GetName() << " supports Windows Phone '8.0', but not '" - << this->SystemVersion << "'. Check CMAKE_SYSTEM_VERSION."; + if(this->DefaultPlatformToolset.empty()) + { + e << this->GetName() << " supports Windows Phone '8.0', but not '" + << this->SystemVersion << "'. Check CMAKE_SYSTEM_VERSION."; + } + else + { + e << "A Windows Phone component with CMake requires both the Windows " + << "Desktop SDK as well as the Windows Phone '" << this->SystemVersion + << "' SDK. Please make sure that you have both installed"; + } mf->IssueMessage(cmake::FATAL_ERROR, e.str()); return false; } @@ -146,12 +154,20 @@ bool cmGlobalVisualStudio11Generator::InitializeWindowsPhone(cmMakefile* mf) //---------------------------------------------------------------------------- bool cmGlobalVisualStudio11Generator::InitializeWindowsStore(cmMakefile* mf) { - this->DefaultPlatformToolset = this->SelectWindowsStoreToolset(); - if(this->DefaultPlatformToolset.empty()) + if(!this->SelectWindowsStoreToolset(this->DefaultPlatformToolset)) { cmOStringStream e; - e << this->GetName() << " supports Windows Store '8.0', but not '" - << this->SystemVersion << "'. Check CMAKE_SYSTEM_VERSION."; + if(this->DefaultPlatformToolset.empty()) + { + e << this->GetName() << " supports Windows Store '8.0', but not '" + << this->SystemVersion << "'. Check CMAKE_SYSTEM_VERSION."; + } + else + { + e << "A Windows Store component with CMake requires both the Windows " + << "Desktop SDK as well as the Windows Store '" << this->SystemVersion + << "' SDK. Please make sure that you have both installed"; + } mf->IssueMessage(cmake::FATAL_ERROR, e.str()); return false; } @@ -159,23 +175,47 @@ bool cmGlobalVisualStudio11Generator::InitializeWindowsStore(cmMakefile* mf) } //---------------------------------------------------------------------------- -std::string cmGlobalVisualStudio11Generator::SelectWindowsPhoneToolset() const +bool +cmGlobalVisualStudio11Generator::SelectWindowsPhoneToolset( + std::string& toolset) const { if(this->SystemVersion == "8.0") { - return "v110_wp80"; + if (this->IsWindowsPhoneToolsetInstalled() && + this->IsWindowsDesktopToolsetInstalled()) + { + toolset = "v110_wp80"; + return true; + } + else + { + return false; + } } - return this->cmGlobalVisualStudio10Generator::SelectWindowsPhoneToolset(); + return + this->cmGlobalVisualStudio10Generator::SelectWindowsPhoneToolset(toolset); } //---------------------------------------------------------------------------- -std::string cmGlobalVisualStudio11Generator::SelectWindowsStoreToolset() const +bool +cmGlobalVisualStudio11Generator::SelectWindowsStoreToolset( + std::string& toolset) const { if(this->SystemVersion == "8.0") { - return "v110"; + if(this->IsWindowsStoreToolsetInstalled() && + this->IsWindowsDesktopToolsetInstalled()) + { + toolset = "v110"; + return true; + } + else + { + return false; + } } - return this->cmGlobalVisualStudio10Generator::SelectWindowsStoreToolset(); + return + this->cmGlobalVisualStudio10Generator::SelectWindowsStoreToolset(toolset); } //---------------------------------------------------------------------------- @@ -256,3 +296,54 @@ cmGlobalVisualStudio11Generator::NeedsDeploy(cmTarget::TargetType type) const } return cmGlobalVisualStudio10Generator::NeedsDeploy(type); } + +//---------------------------------------------------------------------------- +bool +cmGlobalVisualStudio11Generator::IsWindowsDesktopToolsetInstalled() const +{ + const char desktop80Key[] = + "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" + "VisualStudio\\11.0\\VC\\Libraries\\Extended"; + const char VS2012DesktopExpressKey[] = + "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" + "WDExpress\\11.0;InstallDir"; + + std::vector<std::string> subkeys; + std::string path; + return cmSystemTools::ReadRegistryValue(VS2012DesktopExpressKey, + path, + cmSystemTools::KeyWOW64_32) || + cmSystemTools::GetRegistrySubKeys(desktop80Key, + subkeys, + cmSystemTools::KeyWOW64_32); +} + +//---------------------------------------------------------------------------- +bool +cmGlobalVisualStudio11Generator::IsWindowsPhoneToolsetInstalled() const +{ + const char wp80Key[] = + "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" + "Microsoft SDKs\\WindowsPhone\\v8.0\\" + "Install Path;Install Path"; + + std::string path; + cmSystemTools::ReadRegistryValue(wp80Key, + path, + cmSystemTools::KeyWOW64_32); + return !path.empty(); +} + +//---------------------------------------------------------------------------- +bool +cmGlobalVisualStudio11Generator::IsWindowsStoreToolsetInstalled() const +{ + const char win80Key[] = + "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" + "VisualStudio\\11.0\\VC\\Libraries\\Core\\Arm"; + + std::vector<std::string> subkeys; + return cmSystemTools::GetRegistrySubKeys(win80Key, + subkeys, + cmSystemTools::KeyWOW64_32); +} diff --git a/Source/cmGlobalVisualStudio11Generator.h b/Source/cmGlobalVisualStudio11Generator.h index bbd935c..c79dc97 100644 --- a/Source/cmGlobalVisualStudio11Generator.h +++ b/Source/cmGlobalVisualStudio11Generator.h @@ -36,8 +36,15 @@ public: protected: virtual bool InitializeWindowsPhone(cmMakefile* mf); virtual bool InitializeWindowsStore(cmMakefile* mf); - virtual std::string SelectWindowsPhoneToolset() const; - virtual std::string SelectWindowsStoreToolset() const; + virtual bool SelectWindowsPhoneToolset(std::string& toolset) const; + virtual bool SelectWindowsStoreToolset(std::string& toolset) const; + + // These aren't virtual because we need to check if the selected version + // of the toolset is installed + bool IsWindowsDesktopToolsetInstalled() const; + bool IsWindowsPhoneToolsetInstalled() const; + bool IsWindowsStoreToolsetInstalled() const; + virtual const char* GetIDEVersion() { return "11.0"; } bool UseFolderProperty(); static std::set<std::string> GetInstalledWindowsCESDKs(); diff --git a/Source/cmGlobalVisualStudio12Generator.cxx b/Source/cmGlobalVisualStudio12Generator.cxx index 29ecfe0..047f2ad 100644 --- a/Source/cmGlobalVisualStudio12Generator.cxx +++ b/Source/cmGlobalVisualStudio12Generator.cxx @@ -111,12 +111,20 @@ cmGlobalVisualStudio12Generator::MatchesGeneratorName( //---------------------------------------------------------------------------- bool cmGlobalVisualStudio12Generator::InitializeWindowsPhone(cmMakefile* mf) { - this->DefaultPlatformToolset = this->SelectWindowsPhoneToolset(); - if(this->DefaultPlatformToolset.empty()) + if(!this->SelectWindowsPhoneToolset(this->DefaultPlatformToolset)) { cmOStringStream e; - e << this->GetName() << " supports Windows Phone '8.0' and '8.1', " - "but not '" << this->SystemVersion << "'. Check CMAKE_SYSTEM_VERSION."; + if(this->DefaultPlatformToolset.empty()) + { + e << this->GetName() << " supports Windows Phone '8.0' and '8.1', but " + "not '" << this->SystemVersion << "'. Check CMAKE_SYSTEM_VERSION."; + } + else + { + e << "A Windows Phone component with CMake requires both the Windows " + << "Desktop SDK as well as the Windows Phone '" << this->SystemVersion + << "' SDK. Please make sure that you have both installed"; + } mf->IssueMessage(cmake::FATAL_ERROR, e.str()); return false; } @@ -126,12 +134,20 @@ bool cmGlobalVisualStudio12Generator::InitializeWindowsPhone(cmMakefile* mf) //---------------------------------------------------------------------------- bool cmGlobalVisualStudio12Generator::InitializeWindowsStore(cmMakefile* mf) { - this->DefaultPlatformToolset = this->SelectWindowsStoreToolset(); - if(this->DefaultPlatformToolset.empty()) + if(!this->SelectWindowsStoreToolset(this->DefaultPlatformToolset)) { cmOStringStream e; - e << this->GetName() << " supports Windows Store '8.0' and '8.1', " - "but not '" << this->SystemVersion << "'. Check CMAKE_SYSTEM_VERSION."; + if(this->DefaultPlatformToolset.empty()) + { + e << this->GetName() << " supports Windows Store '8.0' and '8.1', but " + "not '" << this->SystemVersion << "'. Check CMAKE_SYSTEM_VERSION."; + } + else + { + e << "A Windows Store component with CMake requires both the Windows " + << "Desktop SDK as well as the Windows Store '" << this->SystemVersion + << "' SDK. Please make sure that you have both installed"; + } mf->IssueMessage(cmake::FATAL_ERROR, e.str()); return false; } @@ -139,23 +155,47 @@ bool cmGlobalVisualStudio12Generator::InitializeWindowsStore(cmMakefile* mf) } //---------------------------------------------------------------------------- -std::string cmGlobalVisualStudio12Generator::SelectWindowsPhoneToolset() const +bool +cmGlobalVisualStudio12Generator::SelectWindowsPhoneToolset( + std::string& toolset) const { if(this->SystemVersion == "8.1") { - return "v120_wp81"; + if (this->IsWindowsPhoneToolsetInstalled() && + this->IsWindowsDesktopToolsetInstalled()) + { + toolset = "v120_wp81"; + return true; + } + else + { + return false; + } } - return this->cmGlobalVisualStudio11Generator::SelectWindowsPhoneToolset(); + return + this->cmGlobalVisualStudio11Generator::SelectWindowsPhoneToolset(toolset); } //---------------------------------------------------------------------------- -std::string cmGlobalVisualStudio12Generator::SelectWindowsStoreToolset() const +bool +cmGlobalVisualStudio12Generator::SelectWindowsStoreToolset( + std::string& toolset) const { if(this->SystemVersion == "8.1") { - return "v120"; + if(this->IsWindowsStoreToolsetInstalled() && + this->IsWindowsDesktopToolsetInstalled()) + { + toolset = "v120"; + return true; + } + else + { + return false; + } } - return this->cmGlobalVisualStudio11Generator::SelectWindowsStoreToolset(); + return + this->cmGlobalVisualStudio11Generator::SelectWindowsStoreToolset(toolset); } //---------------------------------------------------------------------------- @@ -180,3 +220,46 @@ cmLocalGenerator *cmGlobalVisualStudio12Generator::CreateLocalGenerator() lg->SetGlobalGenerator(this); return lg; } + +//---------------------------------------------------------------------------- +bool +cmGlobalVisualStudio12Generator::IsWindowsDesktopToolsetInstalled() const +{ + const char desktop81Key[] = + "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" + "VisualStudio\\12.0\\VC\\LibraryDesktop"; + + std::vector<std::string> subkeys; + return cmSystemTools::GetRegistrySubKeys(desktop81Key, + subkeys, + cmSystemTools::KeyWOW64_32); +} + +//---------------------------------------------------------------------------- +bool +cmGlobalVisualStudio12Generator::IsWindowsPhoneToolsetInstalled() const +{ + const char wp81Key[] = + "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" + "Microsoft SDKs\\WindowsPhone\\v8.1\\Install Path;Install Path"; + + std::string path; + cmSystemTools::ReadRegistryValue(wp81Key, + path, + cmSystemTools::KeyWOW64_32); + return !path.empty(); +} + +//---------------------------------------------------------------------------- +bool +cmGlobalVisualStudio12Generator::IsWindowsStoreToolsetInstalled() const +{ + const char win81Key[] = + "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" + "VisualStudio\\12.0\\VC\\Libraries\\Core\\Arm"; + + std::vector<std::string> subkeys; + return cmSystemTools::GetRegistrySubKeys(win81Key, + subkeys, + cmSystemTools::KeyWOW64_32); +} diff --git a/Source/cmGlobalVisualStudio12Generator.h b/Source/cmGlobalVisualStudio12Generator.h index ec85f10..a81516f 100644 --- a/Source/cmGlobalVisualStudio12Generator.h +++ b/Source/cmGlobalVisualStudio12Generator.h @@ -41,8 +41,14 @@ public: protected: virtual bool InitializeWindowsPhone(cmMakefile* mf); virtual bool InitializeWindowsStore(cmMakefile* mf); - virtual std::string SelectWindowsPhoneToolset() const; - virtual std::string SelectWindowsStoreToolset() const; + virtual bool SelectWindowsPhoneToolset(std::string& toolset) const; + virtual bool SelectWindowsStoreToolset(std::string& toolset) const; + + // These aren't virtual because we need to check if the selected version + // of the toolset is installed + bool IsWindowsDesktopToolsetInstalled() const; + bool IsWindowsPhoneToolsetInstalled() const; + bool IsWindowsStoreToolsetInstalled() const; virtual const char* GetIDEVersion() { return "12.0"; } private: class Factory; diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx index d001f93..fe702c0 100644 --- a/Source/cmGlobalVisualStudio14Generator.cxx +++ b/Source/cmGlobalVisualStudio14Generator.cxx @@ -13,21 +13,36 @@ #include "cmLocalVisualStudio10Generator.h" #include "cmMakefile.h" -static const char vs14generatorName[] = "Visual Studio 14"; +static const char vs14generatorName[] = "Visual Studio 14 2015"; + +// Map generator name without year to name with year. +static const char* cmVS14GenName(const std::string& name, std::string& genName) +{ + if(strncmp(name.c_str(), vs14generatorName, + sizeof(vs14generatorName)-6) != 0) + { + return 0; + } + const char* p = name.c_str() + sizeof(vs14generatorName) - 6; + if(cmHasLiteralPrefix(p, " 2015")) + { + p += 5; + } + genName = std::string(vs14generatorName) + p; + return p; +} class cmGlobalVisualStudio14Generator::Factory : public cmGlobalGeneratorFactory { public: virtual cmGlobalGenerator* CreateGlobalGenerator( - const std::string& genName) const + const std::string& name) const { - if(strncmp(genName.c_str(), vs14generatorName, - sizeof(vs14generatorName) - 1) != 0) - { - return 0; - } - const char* p = genName.c_str() + sizeof(vs14generatorName) - 1; + std::string genName; + const char* p = cmVS14GenName(name, genName); + if(!p) + { return 0; } if(!*p) { return new cmGlobalVisualStudio14Generator( @@ -51,7 +66,7 @@ public: virtual void GetDocumentation(cmDocumentationEntry& entry) const { entry.Name = vs14generatorName; - entry.Brief = "Generates Visual Studio 14 project files."; + entry.Brief = "Generates Visual Studio 14 (VS 2015) project files."; } virtual void GetGenerators(std::vector<std::string>& names) const @@ -85,7 +100,12 @@ bool cmGlobalVisualStudio14Generator::MatchesGeneratorName( const std::string& name) const { - return name == this->GetName(); + std::string genName; + if(cmVS14GenName(name, genName)) + { + return genName == this->GetName(); + } + return false; } //---------------------------------------------------------------------------- diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 0bd1624..b7e89b8 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -102,7 +102,6 @@ cmMakefile::cmMakefile(): Internal(new Internals) this->PreOrder = false; this->GeneratingBuildSystem = false; - this->NumLastMatches = 0; this->SuppressWatches = false; } @@ -153,7 +152,6 @@ cmMakefile::cmMakefile(const cmMakefile& mf): Internal(new Internals) this->ListFileStack = mf.ListFileStack; this->OutputToSource = mf.OutputToSource; - this->NumLastMatches = mf.NumLastMatches; this->SuppressWatches = mf.SuppressWatches; } @@ -4743,51 +4741,6 @@ std::vector<cmSourceFile*> cmMakefile::GetQtUiFilesWithOptions() const return this->QtUiFilesWithOptions; } -static std::string matchVariables[] = { - "CMAKE_MATCH_0", - "CMAKE_MATCH_1", - "CMAKE_MATCH_2", - "CMAKE_MATCH_3", - "CMAKE_MATCH_4", - "CMAKE_MATCH_5", - "CMAKE_MATCH_6", - "CMAKE_MATCH_7", - "CMAKE_MATCH_8", - "CMAKE_MATCH_9" -}; - -//---------------------------------------------------------------------------- -void cmMakefile::ClearMatches() -{ - for (unsigned int i=0; i<this->NumLastMatches; i++) - { - std::string const& var = matchVariables[i]; - std::string const& s = this->GetSafeDefinition(var); - if(!s.empty()) - { - this->AddDefinition(var, ""); - this->MarkVariableAsUsed(var); - } - } - this->NumLastMatches = 0; -} - -//---------------------------------------------------------------------------- -void cmMakefile::StoreMatches(cmsys::RegularExpression& re) -{ - for (unsigned int i=0; i<10; i++) - { - std::string const& m = re.match(i); - if(!m.empty()) - { - std::string const& var = matchVariables[i]; - this->AddDefinition(var, m.c_str()); - this->MarkVariableAsUsed(var); - this->NumLastMatches = i + 1; - } - } -} - //---------------------------------------------------------------------------- cmPolicies::PolicyStatus cmMakefile::GetPolicyStatus(cmPolicies::PolicyID id) const diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 164290a..28f8686 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -942,9 +942,6 @@ public: std::string const& lhs, std::string const& rhs); - void ClearMatches(); - void StoreMatches(cmsys::RegularExpression& re); - protected: // add link libraries and directories to the target void AddGlobalLinkInformation(const std::string& name, cmTarget& target); @@ -1150,8 +1147,6 @@ private: std::vector<cmSourceFile*> QtUiFilesWithOptions; - unsigned int NumLastMatches; - bool AddRequiredTargetCFeature(cmTarget *target, const std::string& feature) const; diff --git a/Source/cmSourceFileLocation.cxx b/Source/cmSourceFileLocation.cxx index 1c2454e..004fd1f 100644 --- a/Source/cmSourceFileLocation.cxx +++ b/Source/cmSourceFileLocation.cxx @@ -216,7 +216,8 @@ bool cmSourceFileLocation::Matches(cmSourceFileLocation const& loc) // Both extensions are similarly ambiguous. Since only the old fixed set // of extensions will be tried, the names must match at this point to be // the same file. - if(this->Name.size() != loc.Name.size() || this->Name != loc.Name) + if(this->Name.size() != loc.Name.size() || + !cmSystemTools::ComparePath(this->Name, loc.Name)) { return false; } diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index 90a8f85..93aa083 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -310,7 +310,7 @@ bool cmStringCommand::RegexMatch(std::vector<std::string> const& args) input += args[i]; } - this->Makefile->ClearMatches(); + this->ClearMatches(this->Makefile); // Compile the regular expression. cmsys::RegularExpression re; if(!re.compile(regex.c_str())) @@ -325,7 +325,7 @@ bool cmStringCommand::RegexMatch(std::vector<std::string> const& args) std::string output; if(re.find(input.c_str())) { - this->Makefile->StoreMatches(re); + this->StoreMatches(this->Makefile, re); std::string::size_type l = re.start(); std::string::size_type r = re.end(); if(r-l == 0) @@ -359,7 +359,7 @@ bool cmStringCommand::RegexMatchAll(std::vector<std::string> const& args) input += args[i]; } - this->Makefile->ClearMatches(); + this->ClearMatches(this->Makefile); // Compile the regular expression. cmsys::RegularExpression re; if(!re.compile(regex.c_str())) @@ -376,7 +376,7 @@ bool cmStringCommand::RegexMatchAll(std::vector<std::string> const& args) const char* p = input.c_str(); while(re.find(p)) { - this->Makefile->StoreMatches(re); + this->StoreMatches(this->Makefile, re); std::string::size_type l = re.start(); std::string::size_type r = re.end(); if(r-l == 0) @@ -463,7 +463,7 @@ bool cmStringCommand::RegexReplace(std::vector<std::string> const& args) input += args[i]; } - this->Makefile->ClearMatches(); + this->ClearMatches(this->Makefile); // Compile the regular expression. cmsys::RegularExpression re; if(!re.compile(regex.c_str())) @@ -480,7 +480,7 @@ bool cmStringCommand::RegexReplace(std::vector<std::string> const& args) std::string::size_type base = 0; while(re.find(input.c_str()+base)) { - this->Makefile->StoreMatches(re); + this->StoreMatches(this->Makefile, re); std::string::size_type l2 = re.start(); std::string::size_type r = re.end(); @@ -541,6 +541,38 @@ bool cmStringCommand::RegexReplace(std::vector<std::string> const& args) } //---------------------------------------------------------------------------- +void cmStringCommand::ClearMatches(cmMakefile* mf) +{ + for (unsigned int i=0; i<10; i++) + { + char name[128]; + sprintf(name, "CMAKE_MATCH_%d", i); + const char* s = mf->GetDefinition(name); + if(s && *s != 0) + { + mf->AddDefinition(name, ""); + mf->MarkVariableAsUsed(name); + } + } +} + +//---------------------------------------------------------------------------- +void cmStringCommand::StoreMatches(cmMakefile* mf,cmsys::RegularExpression& re) +{ + for (unsigned int i=0; i<10; i++) + { + std::string m = re.match(i); + if(m.size() > 0) + { + char name[128]; + sprintf(name, "CMAKE_MATCH_%d", i); + mf->AddDefinition(name, re.match(i).c_str()); + mf->MarkVariableAsUsed(name); + } + } +} + +//---------------------------------------------------------------------------- bool cmStringCommand::HandleFindCommand(std::vector<std::string> const& args) { diff --git a/Source/cmStringCommand.h b/Source/cmStringCommand.h index 9c75095..a5fe893 100644 --- a/Source/cmStringCommand.h +++ b/Source/cmStringCommand.h @@ -53,6 +53,8 @@ public: virtual std::string GetName() const { return "string";} cmTypeMacro(cmStringCommand, cmCommand); + static void ClearMatches(cmMakefile* mf); + static void StoreMatches(cmMakefile* mf, cmsys::RegularExpression& re); protected: bool HandleConfigureCommand(std::vector<std::string> const& args); bool HandleAsciiCommand(std::vector<std::string> const& args); diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index b476a27..ad1c83e 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -649,6 +649,8 @@ static bool processSources(cmTarget const* tgt, for (std::vector<cmTargetInternals::TargetPropertyEntry*>::const_iterator it = entries.begin(), end = entries.end(); it != end; ++it) { + cmLinkImplItem const& item = (*it)->LinkImplItem; + std::string const& targetName = item; std::vector<std::string> entrySources; cmSystemTools::ExpandListArgument((*it)->ge->Evaluate(mf, config, @@ -667,11 +669,10 @@ static bool processSources(cmTarget const* tgt, i != entrySources.end(); ++i) { std::string& src = *i; - cmSourceFile* sf = mf->GetOrCreateSource(src); std::string e; - src = sf->GetFullPath(&e); - if(src.empty()) + std::string fullPath = sf->GetFullPath(&e); + if(fullPath.empty()) { if(!e.empty()) { @@ -681,6 +682,25 @@ static bool processSources(cmTarget const* tgt, } return contextDependent; } + + if (!targetName.empty() && !cmSystemTools::FileIsFullPath(src.c_str())) + { + cmOStringStream err; + if (!targetName.empty()) + { + err << "Target \"" << targetName << "\" contains relative " + "path in its INTERFACE_SOURCES:\n" + " \"" << src << "\""; + } + else + { + err << "Found relative path while evaluating sources of " + "\"" << tgt->GetName() << "\":\n \"" << src << "\"\n"; + } + tgt->GetMakefile()->IssueMessage(cmake::FATAL_ERROR, err.str()); + return contextDependent; + } + src = fullPath; } std::string usedSources; for(std::vector<std::string>::iterator diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 26fc317..1ac13cf 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -326,9 +326,9 @@ void cmVisualStudio10TargetGenerator::Generate() this->WriteString("<PropertyGroup Label=\"NsightTegraProject\">\n", 1); if(this->NsightTegraVersion[0] >= 2) { - // Nsight Tegra 2.0 uses project revision 8. + // Nsight Tegra 2.0 uses project revision 9. this->WriteString("<NsightTegraProjectRevisionNumber>" - "8" + "9" "</NsightTegraProjectRevisionNumber>\n", 2); // Tell newer versions to upgrade silently when loading. this->WriteString("<NsightTegraUpgradeOnceWithoutPrompt>" @@ -2036,7 +2036,8 @@ WriteMasmOptions(std::string const& configName, void cmVisualStudio10TargetGenerator::WriteLibOptions(std::string const& config) { - if(this->Target->GetType() != cmTarget::STATIC_LIBRARY) + if(this->Target->GetType() != cmTarget::STATIC_LIBRARY && + this->Target->GetType() != cmTarget::OBJECT_LIBRARY) { return; } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 09d270d..36a0645 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1403,7 +1403,7 @@ int cmake::ActualConfigure() {"10.0", "Visual Studio 10 2010"}, {"11.0", "Visual Studio 11 2012"}, {"12.0", "Visual Studio 12 2013"}, - {"14.0", "Visual Studio 14"}, + {"14.0", "Visual Studio 14 2015"}, {0, 0}}; for(int i=0; version[i].MSVersion != 0; i++) { diff --git a/Source/kwsys/SharedForward.h.in b/Source/kwsys/SharedForward.h.in index 7ff29b4..c6f345f 100644 --- a/Source/kwsys/SharedForward.h.in +++ b/Source/kwsys/SharedForward.h.in @@ -813,7 +813,7 @@ static void kwsys_shared_forward_print_failure(char const* const* argv) } /* Static storage space to store the updated environment variable. */ -static char kwsys_shared_forward_ldpath[KWSYS_SHARED_FORWARD_MAXPATH*16] = KWSYS_SHARED_FORWARD_LDPATH "="; +static char kwsys_shared_forward_ldpath[65535] = KWSYS_SHARED_FORWARD_LDPATH "="; /*--------------------------------------------------------------------------*/ /* Main driver function to be called from main. */ |