summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-07-15 13:04:24 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-07-15 13:04:24 (GMT)
commitc59ec2b7c8f24de9eceba141ae7b379806c37948 (patch)
tree2cbf2ecd508d794b08b3ee7e47e92aa6d7d80dd7 /Source
parent0c3fc5a2513ecf2daff2223dc26bcc4dcadf9b09 (diff)
parent4db08807db2fc0db6ab0c4d438ddb3f20969d2fb (diff)
downloadCMake-c59ec2b7c8f24de9eceba141ae7b379806c37948.zip
CMake-c59ec2b7c8f24de9eceba141ae7b379806c37948.tar.gz
CMake-c59ec2b7c8f24de9eceba141ae7b379806c37948.tar.bz2
Merge topic 'cmake-internal-info'
4db08807 CMake: Report whether generators support platforms 43a68a6d cmGlobalGeneratorFactory: Use CM_OVERRIDE for all derived classes af0e1cd4 Make CMake version dirty state available to code 6a077b5d Make CMake version suffix available to code
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeVersionCompute.cmake16
-rw-r--r--Source/CMakeVersionSource.cmake4
-rw-r--r--Source/cmGlobalGeneratorFactory.h6
-rw-r--r--Source/cmGlobalGhsMultiGenerator.h6
-rw-r--r--Source/cmGlobalNinjaGenerator.h6
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.h6
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx11
-rw-r--r--Source/cmGlobalVisualStudio11Generator.cxx11
-rw-r--r--Source/cmGlobalVisualStudio12Generator.cxx11
-rw-r--r--Source/cmGlobalVisualStudio14Generator.cxx11
-rw-r--r--Source/cmGlobalVisualStudio7Generator.h6
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx11
-rw-r--r--Source/cmGlobalVisualStudio9Generator.cxx11
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx11
-rw-r--r--Source/cmVersionConfig.h.in2
-rw-r--r--Source/cmake.cxx2
-rw-r--r--Source/cmake.h1
17 files changed, 92 insertions, 40 deletions
diff --git a/Source/CMakeVersionCompute.cmake b/Source/CMakeVersionCompute.cmake
index 496d6cf..3bdcfd6 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()
@@ -12,9 +13,16 @@ 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()
+if(CMake_VERSION_IS_DIRTY)
+ set(CMake_VERSION ${CMake_VERSION}-dirty)
endif()
diff --git a/Source/CMakeVersionSource.cmake b/Source/CMakeVersionSource.cmake
index 888f557..bc5975e 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/cmGlobalGeneratorFactory.h b/Source/cmGlobalGeneratorFactory.h
index 6787519..74d3145 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 <class T>
@@ -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 473d153..b2aac45 100644
--- a/Source/cmGlobalGhsMultiGenerator.h
+++ b/Source/cmGlobalGhsMultiGenerator.h
@@ -52,6 +52,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 69ec6ca..c74973e 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -81,6 +81,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.
* It also writes the variables bound to this build statement.
diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h
index 98969ff..ceb4140 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 90ff98b..c13c622 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,22 @@ 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<std::string>& names) const
+ void GetGenerators(std::vector<std::string>& 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; }
+ bool SupportsPlatform() const CM_OVERRIDE { return true; }
};
cmGlobalGeneratorFactory* cmGlobalVisualStudio10Generator::NewFactory()
diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx
index 295b6eb..1478a17 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<std::string>& names) const
+ void GetGenerators(std::vector<std::string>& names) const CM_OVERRIDE
{
names.push_back(vs11generatorName);
names.push_back(vs11generatorName + std::string(" ARM"));
@@ -91,7 +91,8 @@ public:
}
}
- virtual bool SupportsToolset() const { return true; }
+ 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 318cb39..3047171 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,22 @@ 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<std::string>& names) const
+ void GetGenerators(std::vector<std::string>& 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; }
+ bool SupportsPlatform() const CM_OVERRIDE { return true; }
};
cmGlobalGeneratorFactory* cmGlobalVisualStudio12Generator::NewFactory()
diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx
index e190e84..254682c 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,22 @@ 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<std::string>& names) const
+ void GetGenerators(std::vector<std::string>& 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; }
+ bool SupportsPlatform() const CM_OVERRIDE { return true; }
};
cmGlobalGeneratorFactory* cmGlobalVisualStudio14Generator::NewFactory()
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index 2092343..8a33ee0 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -48,6 +48,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 dfe196a..2c0168e 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<std::string>& names) const
+ void GetGenerators(std::vector<std::string>& names) const CM_OVERRIDE
{
names.push_back(vs8generatorName);
names.push_back(vs8generatorName + std::string(" Win64"));
@@ -82,7 +82,8 @@ public:
}
}
- virtual bool SupportsToolset() const { return false; }
+ 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 a47f4fc..acc7baa 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<std::string>& names) const
+ void GetGenerators(std::vector<std::string>& names) const CM_OVERRIDE
{
names.push_back(vs9generatorName);
names.push_back(vs9generatorName + std::string(" Win64"));
@@ -85,7 +85,8 @@ public:
}
}
- virtual bool SupportsToolset() const { return false; }
+ 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 e65ca09..23fad51 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -108,20 +108,21 @@ 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<std::string>& names) const
+ void GetGenerators(std::vector<std::string>& names) const CM_OVERRIDE
{
names.push_back(cmGlobalXCodeGenerator::GetActualName());
}
- virtual bool SupportsToolset() const { return true; }
+ bool SupportsToolset() const CM_OVERRIDE { return true; }
+ bool SupportsPlatform() const CM_OVERRIDE { return false; }
};
cmGlobalXCodeGenerator::cmGlobalXCodeGenerator(cmake* cm,
diff --git a/Source/cmVersionConfig.h.in b/Source/cmVersionConfig.h.in
index 16aeabe..92abfbe 100644
--- a/Source/cmVersionConfig.h.in
+++ b/Source/cmVersionConfig.h.in
@@ -12,4 +12,6 @@
#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_IS_DIRTY @CMake_VERSION_IS_DIRTY@
#define CMake_VERSION "@CMake_VERSION@"
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index c597605..fceec16 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -853,6 +853,7 @@ void cmake::GetRegisteredGenerators(std::vector<GeneratorInfo>& 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<GeneratorInfo>& 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 4a5376d..4ca2a80 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -104,6 +104,7 @@ public:
{
std::string name;
bool supportsToolset;
+ bool supportsPlatform;
};
typedef std::map<std::string, cmInstalledFile> InstalledFilesMap;