From 6a077b5d63895489c2962af2f7302f52444045cc Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 1 Jul 2016 09:40:09 +0200 Subject: [PATCH 1/4] Make CMake version suffix available to code Make the string (e.g. "rc1" or "gSHA-dirty") available to the code. --- Source/CMakeVersionCompute.cmake | 12 ++++++++---- Source/cmVersionConfig.h.in | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Source/CMakeVersionCompute.cmake b/Source/CMakeVersionCompute.cmake index 496d6cf1a..806e9870b 100644 --- a/Source/CMakeVersionCompute.cmake +++ b/Source/CMakeVersionCompute.cmake @@ -12,9 +12,13 @@ endif() # Compute the full version string. set(CMake_VERSION ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}) -if(CMake_VERSION_RC) - set(CMake_VERSION ${CMake_VERSION}-rc${CMake_VERSION_RC}) -endif() if(CMake_VERSION_SOURCE) - set(CMake_VERSION ${CMake_VERSION}-${CMake_VERSION_SOURCE}) + set(CMake_VERSION_SUFFIX "${CMake_VERSION_SOURCE}") +elseif(CMake_VERSION_RC) + set(CMake_VERSION_SUFFIX "rc${CMake_VERSION_RC}") +else() + set(CMake_VERSION_SUFFIX "") +endif() +if(CMake_VERSION_SUFFIX) + set(CMake_VERSION ${CMake_VERSION}-${CMake_VERSION_SUFFIX}) endif() diff --git a/Source/cmVersionConfig.h.in b/Source/cmVersionConfig.h.in index 16aeabe9e..af5c57b2c 100644 --- a/Source/cmVersionConfig.h.in +++ b/Source/cmVersionConfig.h.in @@ -12,4 +12,5 @@ #define CMake_VERSION_MAJOR @CMake_VERSION_MAJOR@ #define CMake_VERSION_MINOR @CMake_VERSION_MINOR@ #define CMake_VERSION_PATCH @CMake_VERSION_PATCH@ +#define CMake_VERSION_SUFFIX "@CMake_VERSION_SUFFIX@" #define CMake_VERSION "@CMake_VERSION@" From af0e1cd4cbb7029de0877de9db72ba37085abff2 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 8 Jul 2016 11:40:16 +0200 Subject: [PATCH 2/4] Make CMake version dirty state available to code Set `CMake_VERSION_IS_DIRTY` to 1 or 0 depending on whether the CMake source tree is considered dirty or not. --- Source/CMakeVersionCompute.cmake | 4 ++++ Source/CMakeVersionSource.cmake | 4 +++- Source/cmVersionConfig.h.in | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/CMakeVersionCompute.cmake b/Source/CMakeVersionCompute.cmake index 806e9870b..3bdcfd6f9 100644 --- a/Source/CMakeVersionCompute.cmake +++ b/Source/CMakeVersionCompute.cmake @@ -3,6 +3,7 @@ include(${CMake_SOURCE_DIR}/Source/CMakeVersion.cmake) # Releases define a small patch level. if("${CMake_VERSION_PATCH}" VERSION_LESS 20000000) + set(CMake_VERSION_IS_DIRTY 0) set(CMake_VERSION_IS_RELEASE 1) set(CMake_VERSION_SOURCE "") else() @@ -22,3 +23,6 @@ endif() if(CMake_VERSION_SUFFIX) set(CMake_VERSION ${CMake_VERSION}-${CMake_VERSION_SUFFIX}) endif() +if(CMake_VERSION_IS_DIRTY) + set(CMake_VERSION ${CMake_VERSION}-dirty) +endif() diff --git a/Source/CMakeVersionSource.cmake b/Source/CMakeVersionSource.cmake index 888f557fb..bc5975e57 100644 --- a/Source/CMakeVersionSource.cmake +++ b/Source/CMakeVersionSource.cmake @@ -23,7 +23,9 @@ if(EXISTS ${CMake_SOURCE_DIR}/.git/HEAD) WORKING_DIRECTORY ${CMake_SOURCE_DIR} ) if(dirty) - set(CMake_VERSION_SOURCE "${CMake_VERSION_SOURCE}-dirty") + set(CMake_VERSION_IS_DIRTY 1) + else() + set(CMake_VERSION_IS_DIRTY 0) endif() endif() endif() diff --git a/Source/cmVersionConfig.h.in b/Source/cmVersionConfig.h.in index af5c57b2c..92abfbece 100644 --- a/Source/cmVersionConfig.h.in +++ b/Source/cmVersionConfig.h.in @@ -13,4 +13,5 @@ #define CMake_VERSION_MINOR @CMake_VERSION_MINOR@ #define CMake_VERSION_PATCH @CMake_VERSION_PATCH@ #define CMake_VERSION_SUFFIX "@CMake_VERSION_SUFFIX@" +#define CMake_VERSION_IS_DIRTY @CMake_VERSION_IS_DIRTY@ #define CMake_VERSION "@CMake_VERSION@" From 43a68a6dcaa7a98d94a71b4f2ecc2e2c63c84688 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 1 Jul 2016 10:11:17 +0200 Subject: [PATCH 3/4] cmGlobalGeneratorFactory: Use CM_OVERRIDE for all derived classes --- Source/cmGlobalVisualStudio10Generator.cxx | 10 +++++----- Source/cmGlobalVisualStudio11Generator.cxx | 10 +++++----- Source/cmGlobalVisualStudio12Generator.cxx | 10 +++++----- Source/cmGlobalVisualStudio14Generator.cxx | 10 +++++----- Source/cmGlobalVisualStudio8Generator.cxx | 10 +++++----- Source/cmGlobalVisualStudio9Generator.cxx | 10 +++++----- Source/cmGlobalXCodeGenerator.cxx | 10 +++++----- 7 files changed, 35 insertions(+), 35 deletions(-) diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 90ff98bee..237926627 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -42,8 +42,8 @@ class cmGlobalVisualStudio10Generator::Factory : public cmGlobalGeneratorFactory { public: - virtual cmGlobalGenerator* CreateGlobalGenerator(const std::string& name, - cmake* cm) const + cmGlobalGenerator* CreateGlobalGenerator(const std::string& name, + cmake* cm) const CM_OVERRIDE { std::string genName; const char* p = cmVS10GenName(name, genName); @@ -65,21 +65,21 @@ public: return 0; } - virtual void GetDocumentation(cmDocumentationEntry& entry) const + void GetDocumentation(cmDocumentationEntry& entry) const CM_OVERRIDE { entry.Name = std::string(vs10generatorName) + " [arch]"; entry.Brief = "Generates Visual Studio 2010 project files. " "Optional [arch] can be \"Win64\" or \"IA64\"."; } - virtual void GetGenerators(std::vector& names) const + void GetGenerators(std::vector& names) const CM_OVERRIDE { names.push_back(vs10generatorName); names.push_back(vs10generatorName + std::string(" IA64")); names.push_back(vs10generatorName + std::string(" Win64")); } - virtual bool SupportsToolset() const { return true; } + bool SupportsToolset() const CM_OVERRIDE { return true; } }; cmGlobalGeneratorFactory* cmGlobalVisualStudio10Generator::NewFactory() diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx index 295b6ebb5..106f1dd44 100644 --- a/Source/cmGlobalVisualStudio11Generator.cxx +++ b/Source/cmGlobalVisualStudio11Generator.cxx @@ -36,8 +36,8 @@ class cmGlobalVisualStudio11Generator::Factory : public cmGlobalGeneratorFactory { public: - virtual cmGlobalGenerator* CreateGlobalGenerator(const std::string& name, - cmake* cm) const + cmGlobalGenerator* CreateGlobalGenerator(const std::string& name, + cmake* cm) const CM_OVERRIDE { std::string genName; const char* p = cmVS11GenName(name, genName); @@ -70,14 +70,14 @@ public: return ret; } - virtual void GetDocumentation(cmDocumentationEntry& entry) const + void GetDocumentation(cmDocumentationEntry& entry) const CM_OVERRIDE { entry.Name = std::string(vs11generatorName) + " [arch]"; entry.Brief = "Generates Visual Studio 2012 project files. " "Optional [arch] can be \"Win64\" or \"ARM\"."; } - virtual void GetGenerators(std::vector& names) const + void GetGenerators(std::vector& names) const CM_OVERRIDE { names.push_back(vs11generatorName); names.push_back(vs11generatorName + std::string(" ARM")); @@ -91,7 +91,7 @@ public: } } - virtual bool SupportsToolset() const { return true; } + bool SupportsToolset() const CM_OVERRIDE { return true; } }; cmGlobalGeneratorFactory* cmGlobalVisualStudio11Generator::NewFactory() diff --git a/Source/cmGlobalVisualStudio12Generator.cxx b/Source/cmGlobalVisualStudio12Generator.cxx index 318cb3918..2b32153b5 100644 --- a/Source/cmGlobalVisualStudio12Generator.cxx +++ b/Source/cmGlobalVisualStudio12Generator.cxx @@ -36,8 +36,8 @@ class cmGlobalVisualStudio12Generator::Factory : public cmGlobalGeneratorFactory { public: - virtual cmGlobalGenerator* CreateGlobalGenerator(const std::string& name, - cmake* cm) const + cmGlobalGenerator* CreateGlobalGenerator(const std::string& name, + cmake* cm) const CM_OVERRIDE { std::string genName; const char* p = cmVS12GenName(name, genName); @@ -59,21 +59,21 @@ public: return 0; } - virtual void GetDocumentation(cmDocumentationEntry& entry) const + void GetDocumentation(cmDocumentationEntry& entry) const CM_OVERRIDE { entry.Name = std::string(vs12generatorName) + " [arch]"; entry.Brief = "Generates Visual Studio 2013 project files. " "Optional [arch] can be \"Win64\" or \"ARM\"."; } - virtual void GetGenerators(std::vector& names) const + void GetGenerators(std::vector& names) const CM_OVERRIDE { names.push_back(vs12generatorName); names.push_back(vs12generatorName + std::string(" ARM")); names.push_back(vs12generatorName + std::string(" Win64")); } - virtual bool SupportsToolset() const { return true; } + bool SupportsToolset() const CM_OVERRIDE { return true; } }; cmGlobalGeneratorFactory* cmGlobalVisualStudio12Generator::NewFactory() diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx index e190e8462..920d99587 100644 --- a/Source/cmGlobalVisualStudio14Generator.cxx +++ b/Source/cmGlobalVisualStudio14Generator.cxx @@ -36,8 +36,8 @@ class cmGlobalVisualStudio14Generator::Factory : public cmGlobalGeneratorFactory { public: - virtual cmGlobalGenerator* CreateGlobalGenerator(const std::string& name, - cmake* cm) const + cmGlobalGenerator* CreateGlobalGenerator(const std::string& name, + cmake* cm) const CM_OVERRIDE { std::string genName; const char* p = cmVS14GenName(name, genName); @@ -59,21 +59,21 @@ public: return 0; } - virtual void GetDocumentation(cmDocumentationEntry& entry) const + void GetDocumentation(cmDocumentationEntry& entry) const CM_OVERRIDE { entry.Name = std::string(vs14generatorName) + " [arch]"; entry.Brief = "Generates Visual Studio 2015 project files. " "Optional [arch] can be \"Win64\" or \"ARM\"."; } - virtual void GetGenerators(std::vector& names) const + void GetGenerators(std::vector& names) const CM_OVERRIDE { names.push_back(vs14generatorName); names.push_back(vs14generatorName + std::string(" ARM")); names.push_back(vs14generatorName + std::string(" Win64")); } - virtual bool SupportsToolset() const { return true; } + bool SupportsToolset() const CM_OVERRIDE { return true; } }; cmGlobalGeneratorFactory* cmGlobalVisualStudio14Generator::NewFactory() diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index dfe196a41..3cade9628 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -25,8 +25,8 @@ static const char vs8generatorName[] = "Visual Studio 8 2005"; class cmGlobalVisualStudio8Generator::Factory : public cmGlobalGeneratorFactory { public: - virtual cmGlobalGenerator* CreateGlobalGenerator(const std::string& name, - cmake* cm) const + cmGlobalGenerator* CreateGlobalGenerator(const std::string& name, + cmake* cm) const CM_OVERRIDE { if (strncmp(name.c_str(), vs8generatorName, sizeof(vs8generatorName) - 1) != 0) { @@ -60,14 +60,14 @@ public: return ret; } - virtual void GetDocumentation(cmDocumentationEntry& entry) const + void GetDocumentation(cmDocumentationEntry& entry) const CM_OVERRIDE { entry.Name = std::string(vs8generatorName) + " [arch]"; entry.Brief = "Generates Visual Studio 2005 project files. " "Optional [arch] can be \"Win64\"."; } - virtual void GetGenerators(std::vector& names) const + void GetGenerators(std::vector& names) const CM_OVERRIDE { names.push_back(vs8generatorName); names.push_back(vs8generatorName + std::string(" Win64")); @@ -82,7 +82,7 @@ public: } } - virtual bool SupportsToolset() const { return false; } + bool SupportsToolset() const CM_OVERRIDE { return false; } }; cmGlobalGeneratorFactory* cmGlobalVisualStudio8Generator::NewFactory() diff --git a/Source/cmGlobalVisualStudio9Generator.cxx b/Source/cmGlobalVisualStudio9Generator.cxx index a47f4fcaa..b65a5a93b 100644 --- a/Source/cmGlobalVisualStudio9Generator.cxx +++ b/Source/cmGlobalVisualStudio9Generator.cxx @@ -23,8 +23,8 @@ static const char vs9generatorName[] = "Visual Studio 9 2008"; class cmGlobalVisualStudio9Generator::Factory : public cmGlobalGeneratorFactory { public: - virtual cmGlobalGenerator* CreateGlobalGenerator(const std::string& name, - cmake* cm) const + cmGlobalGenerator* CreateGlobalGenerator(const std::string& name, + cmake* cm) const CM_OVERRIDE { if (strncmp(name.c_str(), vs9generatorName, sizeof(vs9generatorName) - 1) != 0) { @@ -62,14 +62,14 @@ public: return ret; } - virtual void GetDocumentation(cmDocumentationEntry& entry) const + void GetDocumentation(cmDocumentationEntry& entry) const CM_OVERRIDE { entry.Name = std::string(vs9generatorName) + " [arch]"; entry.Brief = "Generates Visual Studio 2008 project files. " "Optional [arch] can be \"Win64\" or \"IA64\"."; } - virtual void GetGenerators(std::vector& names) const + void GetGenerators(std::vector& names) const CM_OVERRIDE { names.push_back(vs9generatorName); names.push_back(vs9generatorName + std::string(" Win64")); @@ -85,7 +85,7 @@ public: } } - virtual bool SupportsToolset() const { return false; } + bool SupportsToolset() const CM_OVERRIDE { return false; } }; cmGlobalGeneratorFactory* cmGlobalVisualStudio9Generator::NewFactory() diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index e65ca0961..7b085d03d 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -108,20 +108,20 @@ public: class cmGlobalXCodeGenerator::Factory : public cmGlobalGeneratorFactory { public: - virtual cmGlobalGenerator* CreateGlobalGenerator(const std::string& name, - cmake* cm) const; + cmGlobalGenerator* CreateGlobalGenerator(const std::string& name, + cmake* cm) const CM_OVERRIDE; - virtual void GetDocumentation(cmDocumentationEntry& entry) const + void GetDocumentation(cmDocumentationEntry& entry) const CM_OVERRIDE { cmGlobalXCodeGenerator::GetDocumentation(entry); } - virtual void GetGenerators(std::vector& names) const + void GetGenerators(std::vector& names) const CM_OVERRIDE { names.push_back(cmGlobalXCodeGenerator::GetActualName()); } - virtual bool SupportsToolset() const { return true; } + bool SupportsToolset() const CM_OVERRIDE { return true; } }; cmGlobalXCodeGenerator::cmGlobalXCodeGenerator(cmake* cm, From 4db08807db2fc0db6ab0c4d438ddb3f20969d2fb Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 11 Jul 2016 15:44:37 +0200 Subject: [PATCH 4/4] CMake: Report whether generators support platforms --- Source/cmGlobalGeneratorFactory.h | 6 ++++++ Source/cmGlobalGhsMultiGenerator.h | 6 ++++++ Source/cmGlobalNinjaGenerator.h | 6 ++++++ Source/cmGlobalUnixMakefileGenerator3.h | 6 ++++++ Source/cmGlobalVisualStudio10Generator.cxx | 1 + Source/cmGlobalVisualStudio11Generator.cxx | 1 + Source/cmGlobalVisualStudio12Generator.cxx | 1 + Source/cmGlobalVisualStudio14Generator.cxx | 1 + Source/cmGlobalVisualStudio7Generator.h | 6 ++++++ Source/cmGlobalVisualStudio8Generator.cxx | 1 + Source/cmGlobalVisualStudio9Generator.cxx | 1 + Source/cmGlobalXCodeGenerator.cxx | 1 + Source/cmake.cxx | 2 ++ Source/cmake.h | 1 + 14 files changed, 40 insertions(+) diff --git a/Source/cmGlobalGeneratorFactory.h b/Source/cmGlobalGeneratorFactory.h index 67875197d..74d314538 100644 --- a/Source/cmGlobalGeneratorFactory.h +++ b/Source/cmGlobalGeneratorFactory.h @@ -41,6 +41,9 @@ public: /** Determine whether or not this generator supports toolsets */ virtual bool SupportsToolset() const = 0; + + /** Determine whether or not this generator supports platforms */ + virtual bool SupportsPlatform() const = 0; }; template @@ -71,6 +74,9 @@ public: /** Determine whether or not this generator supports toolsets */ bool SupportsToolset() const CM_OVERRIDE { return T::SupportsToolset(); } + + /** Determine whether or not this generator supports platforms */ + bool SupportsPlatform() const CM_OVERRIDE { return T::SupportsPlatform(); } }; #endif diff --git a/Source/cmGlobalGhsMultiGenerator.h b/Source/cmGlobalGhsMultiGenerator.h index 473d153b9..b2aac45a9 100644 --- a/Source/cmGlobalGhsMultiGenerator.h +++ b/Source/cmGlobalGhsMultiGenerator.h @@ -51,6 +51,12 @@ public: */ static bool SupportsToolset() { return false; } + /** + * Utilized by the generator factory to determine if this generator + * supports platforms. + */ + static bool SupportsPlatform() { return false; } + /** * Try to determine system information such as shared library * extension, pthreads, byte order etc. diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index 69ec6cab8..c74973e17 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -80,6 +80,12 @@ public: */ static bool SupportsToolset() { return false; } + /** + * Utilized by the generator factory to determine if this generator + * supports platforms. + */ + static bool SupportsPlatform() { return false; } + /** * Write a build statement to @a os with the @a comment using * the @a rule the list of @a outputs files and inputs. diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index 98969ff96..ceb4140bf 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h @@ -75,6 +75,12 @@ public: */ static bool SupportsToolset() { return false; } + /** + * Utilized by the generator factory to determine if this generator + * supports platforms. + */ + static bool SupportsPlatform() { return false; } + /** Get the documentation entry for this generator. */ static void GetDocumentation(cmDocumentationEntry& entry); diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 237926627..c13c622f5 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -80,6 +80,7 @@ public: } bool SupportsToolset() const CM_OVERRIDE { return true; } + bool SupportsPlatform() const CM_OVERRIDE { return true; } }; cmGlobalGeneratorFactory* cmGlobalVisualStudio10Generator::NewFactory() diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx index 106f1dd44..1478a1775 100644 --- a/Source/cmGlobalVisualStudio11Generator.cxx +++ b/Source/cmGlobalVisualStudio11Generator.cxx @@ -92,6 +92,7 @@ public: } bool SupportsToolset() const CM_OVERRIDE { return true; } + bool SupportsPlatform() const CM_OVERRIDE { return true; } }; cmGlobalGeneratorFactory* cmGlobalVisualStudio11Generator::NewFactory() diff --git a/Source/cmGlobalVisualStudio12Generator.cxx b/Source/cmGlobalVisualStudio12Generator.cxx index 2b32153b5..304717105 100644 --- a/Source/cmGlobalVisualStudio12Generator.cxx +++ b/Source/cmGlobalVisualStudio12Generator.cxx @@ -74,6 +74,7 @@ public: } bool SupportsToolset() const CM_OVERRIDE { return true; } + bool SupportsPlatform() const CM_OVERRIDE { return true; } }; cmGlobalGeneratorFactory* cmGlobalVisualStudio12Generator::NewFactory() diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx index 920d99587..254682c89 100644 --- a/Source/cmGlobalVisualStudio14Generator.cxx +++ b/Source/cmGlobalVisualStudio14Generator.cxx @@ -74,6 +74,7 @@ public: } bool SupportsToolset() const CM_OVERRIDE { return true; } + bool SupportsPlatform() const CM_OVERRIDE { return true; } }; cmGlobalGeneratorFactory* cmGlobalVisualStudio14Generator::NewFactory() diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h index 2092343c0..8a33ee0f7 100644 --- a/Source/cmGlobalVisualStudio7Generator.h +++ b/Source/cmGlobalVisualStudio7Generator.h @@ -47,6 +47,12 @@ public: */ static bool SupportsToolset() { return false; } + /** + * Utilized by the generator factory to determine if this generator + * supports platforms. + */ + static bool SupportsPlatform() { return false; } + /** * Try to determine system information such as shared library * extension, pthreads, byte order etc. diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 3cade9628..2c0168e1b 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -83,6 +83,7 @@ public: } bool SupportsToolset() const CM_OVERRIDE { return false; } + bool SupportsPlatform() const CM_OVERRIDE { return true; } }; cmGlobalGeneratorFactory* cmGlobalVisualStudio8Generator::NewFactory() diff --git a/Source/cmGlobalVisualStudio9Generator.cxx b/Source/cmGlobalVisualStudio9Generator.cxx index b65a5a93b..acc7baa6a 100644 --- a/Source/cmGlobalVisualStudio9Generator.cxx +++ b/Source/cmGlobalVisualStudio9Generator.cxx @@ -86,6 +86,7 @@ public: } bool SupportsToolset() const CM_OVERRIDE { return false; } + bool SupportsPlatform() const CM_OVERRIDE { return true; } }; cmGlobalGeneratorFactory* cmGlobalVisualStudio9Generator::NewFactory() diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 7b085d03d..23fad512a 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -122,6 +122,7 @@ public: } bool SupportsToolset() const CM_OVERRIDE { return true; } + bool SupportsPlatform() const CM_OVERRIDE { return false; } }; cmGlobalXCodeGenerator::cmGlobalXCodeGenerator(cmake* cm, diff --git a/Source/cmake.cxx b/Source/cmake.cxx index c5976053e..fceec1692 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -853,6 +853,7 @@ void cmake::GetRegisteredGenerators(std::vector& generators) for (size_t j = 0; j < names.size(); ++j) { GeneratorInfo info; info.supportsToolset = (*i)->SupportsToolset(); + info.supportsPlatform = (*i)->SupportsPlatform(); info.name = names[j]; generators.push_back(info); } @@ -865,6 +866,7 @@ void cmake::GetRegisteredGenerators(std::vector& generators) GeneratorInfo info; info.name = i->first; info.supportsToolset = false; + info.supportsPlatform = false; generators.push_back(info); } } diff --git a/Source/cmake.h b/Source/cmake.h index 4a5376d99..4ca2a80ba 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -104,6 +104,7 @@ public: { std::string name; bool supportsToolset; + bool supportsPlatform; }; typedef std::map InstalledFilesMap;