summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2012-08-24 18:25:40 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2012-08-24 18:25:40 (GMT)
commit34a0284603e3f4c746140d4c94eab98f9e513a8d (patch)
tree0b639aceb49d130bf3077a2e69820273bb9928f8 /Source
parentdb78df744f71cada436c21499cc22a86554a6de4 (diff)
parent403ead65947751697dc17021b639caa12c6ac74a (diff)
downloadCMake-34a0284603e3f4c746140d4c94eab98f9e513a8d.zip
CMake-34a0284603e3f4c746140d4c94eab98f9e513a8d.tar.gz
CMake-34a0284603e3f4c746140d4c94eab98f9e513a8d.tar.bz2
Merge topic 'ide-compiler-id'
403ead6 Document CMAKE_<LANG>_COMPILER_(ID|VERSION) values 8be51f6 Test variables CMAKE_(C|CXX|Fortran)_COMPILER(|_ID|_VERSION) ec22a9b Cleanly enable a language in multiple subdirectories 66cb335 VS: Detect the compiler id and tool location 89595d6 VS10: Define CMAKE_VS_PLATFORM_TOOLSET variable 965a69d Xcode: Detect the compiler id and tool location 9a9e1ee CMakeDetermineCompilerId: Prepare to detect IDE compiler id b8b5c83 Re-order C/C++/Fortran compiler determination logic
Diffstat (limited to 'Source')
-rw-r--r--Source/cmDocumentVariables.cxx42
-rw-r--r--Source/cmGlobalGenerator.cxx24
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx11
-rw-r--r--Source/cmGlobalVisualStudio10Generator.h1
4 files changed, 62 insertions, 16 deletions
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index badc3e4..3e398ec 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -283,6 +283,16 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"see CMAKE_BUILD_TOOL.",false,
"Variables that Provide Information");
cm->DefineProperty
+ ("CMAKE_VS_PLATFORM_TOOLSET", cmProperty::VARIABLE,
+ "Visual Studio Platform Toolset name.",
+ "VS 10 and above use MSBuild under the hood and support multiple "
+ "compiler toolchains. "
+ "CMake may specify a toolset explicitly, such as \"v110\" for "
+ "VS 11 or \"Windows7.1SDK\" for 64-bit support in VS 10 Express. "
+ "CMake provides the name of the chosen toolset in this variable."
+ ,false,
+ "Variables that Provide Information");
+ cm->DefineProperty
("CMAKE_MINOR_VERSION", cmProperty::VARIABLE,
"The Minor version of cmake (i.e. the 4 in X.4.X).",
"This specifies the minor version of the CMake"
@@ -1395,8 +1405,30 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
cm->DefineProperty
("CMAKE_<LANG>_COMPILER_ID", cmProperty::VARIABLE,
- "An internal variable subject to change.",
- "This is used in determining the compiler and is subject to change.",
+ "Compiler identification string.",
+ "A short string unique to the compiler vendor. "
+ "Possible values include:\n"
+ " Absoft = Absoft Fortran (absoft.com)\n"
+ " ADSP = Analog VisualDSP++ (analog.com)\n"
+ " Clang = LLVM Clang (clang.llvm.org)\n"
+ " Cray = Cray Compiler (cray.com)\n"
+ " Embarcadero, Borland = Embarcadero (embarcadero.com)\n"
+ " G95 = G95 Fortran (g95.org)\n"
+ " GNU = GNU Compiler Collection (gcc.gnu.org)\n"
+ " HP = Hewlett-Packard Compiler (hp.com)\n"
+ " Intel = Intel Compiler (intel.com)\n"
+ " MIPSpro = SGI MIPSpro (sgi.com)\n"
+ " MSVC = Microsoft Visual Studio (microsoft.com)\n"
+ " PGI = The Portland Group (pgroup.com)\n"
+ " PathScale = PathScale (pathscale.com)\n"
+ " SDCC = Small Device C Compiler (sdcc.sourceforge.net)\n"
+ " SunPro = Oracle Solaris Studio (oracle.com)\n"
+ " TI_DSP = Texas Instruments (ti.com)\n"
+ " TinyCC = Tiny C Compiler (tinycc.org)\n"
+ " Watcom = Open Watcom (openwatcom.org)\n"
+ " XL, VisualAge, zOS = IBM XL (ibm.com)\n"
+ "This variable is not guaranteed to be defined for all "
+ "compilers or languages.",
false,
"Variables for Languages");
@@ -1416,10 +1448,10 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
cm->DefineProperty
("CMAKE_<LANG>_COMPILER_VERSION", cmProperty::VARIABLE,
- "An internal variable subject to change.",
+ "Compiler version string.",
"Compiler version in major[.minor[.patch[.tweak]]] format. "
- "This variable is reserved for internal use by CMake and is not "
- "guaranteed to be set.",
+ "This variable is not guaranteed to be defined for all "
+ "compilers or languages.",
false,
"Variables for Languages");
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index a47ca36..52b451c 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -376,22 +376,24 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
std::string loadedLang = "CMAKE_";
loadedLang += lang;
loadedLang += "_COMPILER_LOADED";
- // If the existing build tree was already configured with this
- // version of CMake then try to load the configured file first
- // to avoid duplicate compiler tests.
- unsigned int cacheMajor = mf->GetCacheMajorVersion();
- unsigned int cacheMinor = mf->GetCacheMinorVersion();
- unsigned int selfMajor = cmVersion::GetMajorVersion();
- unsigned int selfMinor = cmVersion::GetMinorVersion();
- if((this->CMakeInstance->GetIsInTryCompile() ||
- (selfMajor == cacheMajor && selfMinor == cacheMinor))
- && !mf->GetDefinition(loadedLang.c_str()))
+ if(!mf->GetDefinition(loadedLang.c_str()))
{
fpath = rootBin;
fpath += "/CMake";
fpath += lang;
fpath += "Compiler.cmake";
- if(cmSystemTools::FileExists(fpath.c_str()))
+
+ // If the existing build tree was already configured with this
+ // version of CMake then try to load the configured file first
+ // to avoid duplicate compiler tests.
+ unsigned int cacheMajor = mf->GetCacheMajorVersion();
+ unsigned int cacheMinor = mf->GetCacheMinorVersion();
+ unsigned int selfMajor = cmVersion::GetMajorVersion();
+ unsigned int selfMinor = cmVersion::GetMinorVersion();
+ if((this->CMakeInstance->GetIsInTryCompile() ||
+ (cacheMajor == 0 && cacheMinor == 0) ||
+ (selfMajor == cacheMajor && selfMinor == cacheMinor)) &&
+ cmSystemTools::FileExists(fpath.c_str()))
{
if(!mf->ReadListFile(0,fpath.c_str()))
{
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index b44b780..39c9ae1 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -28,6 +28,17 @@ cmGlobalVisualStudio10Generator::cmGlobalVisualStudio10Generator()
}
//----------------------------------------------------------------------------
+void cmGlobalVisualStudio10Generator::AddPlatformDefinitions(cmMakefile* mf)
+{
+ cmGlobalVisualStudio8Generator::AddPlatformDefinitions(mf);
+ if(!this->PlatformToolset.empty())
+ {
+ mf->AddDefinition("CMAKE_VS_PLATFORM_TOOLSET",
+ this->PlatformToolset.c_str());
+ }
+}
+
+//----------------------------------------------------------------------------
void cmGlobalVisualStudio10Generator::WriteSLNHeader(std::ostream& fout)
{
fout << "Microsoft Visual Studio Solution File, Format Version 11.00\n";
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index a4a9d40..47ce790 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -38,6 +38,7 @@ public:
virtual const char* GetName() const {
return cmGlobalVisualStudio10Generator::GetActualName();}
static const char* GetActualName() {return "Visual Studio 10";}
+ virtual void AddPlatformDefinitions(cmMakefile* mf);
/** Get the documentation entry for this generator. */
virtual void GetDocumentation(cmDocumentationEntry& entry) const;