diff options
author | Patrick Gansterer <paroga@paroga.com> | 2012-11-20 10:33:34 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-11-26 14:33:24 (GMT) |
commit | d41d4d3d61275414958831bc3d5a45f74b1f2339 (patch) | |
tree | 4d2f8afd47add243479e370f1f1bb6ffe6437cea | |
parent | 14861f88d2e33edc53ab00f92dfaaf860f9d4084 (diff) | |
download | CMake-d41d4d3d61275414958831bc3d5a45f74b1f2339.zip CMake-d41d4d3d61275414958831bc3d5a45f74b1f2339.tar.gz CMake-d41d4d3d61275414958831bc3d5a45f74b1f2339.tar.bz2 |
VS: Add CMAKE_VS_PLATFORM_NAME definition to cmMakefile
When adding more platforms to the Visual Studio generators a simple
regular expressing can not handle all cases anymore. This new
define holds the name of the Visual Studio target platform.
-rw-r--r-- | Modules/CMakeDetermineCompilerId.cmake | 13 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio8Generator.cxx | 7 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio8Generator.h | 2 |
3 files changed, 16 insertions, 6 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index dd2bcd2..05430a6 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -107,11 +107,14 @@ Id flags: ${testflags} ") # Compile the compiler identification source. - if("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([0-9]+)( .NET)?( 200[358])? *((Win64|IA64|ARM))?") + if("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([0-9]+)") set(vs_version ${CMAKE_MATCH_1}) - set(vs_arch ${CMAKE_MATCH_4}) + set(id_arch ${CMAKE_VS_PLATFORM_NAME}) set(id_lang "${lang}") set(id_cl cl.exe) + if(NOT id_arch) + set(id_arch Win32) + endif() if(NOT "${vs_version}" VERSION_LESS 10) set(v 10) set(ext vcxproj) @@ -123,16 +126,14 @@ Id flags: ${testflags} set(v 6) set(ext dsp) endif() - if("${vs_arch}" STREQUAL "Win64") + if("${id_arch}" STREQUAL "x64") set(id_machine_10 MachineX64) - set(id_arch x64) - elseif("${vs_arch}" STREQUAL "IA64") + elseif("${id_arch}" STREQUAL "Itanium") set(id_machine_10 MachineIA64) set(id_arch ia64) else() set(id_machine_6 x86) set(id_machine_10 MachineX86) - set(id_arch Win32) endif() if(CMAKE_VS_PLATFORM_TOOLSET) set(id_toolset "<PlatformToolset>${CMAKE_VS_PLATFORM_TOOLSET}</PlatformToolset>") diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 855727b..8ab97b5 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -99,6 +99,13 @@ cmLocalGenerator *cmGlobalVisualStudio8Generator::CreateLocalGenerator() } //---------------------------------------------------------------------------- +void cmGlobalVisualStudio8Generator::AddPlatformDefinitions(cmMakefile* mf) +{ + cmGlobalVisualStudio71Generator::AddPlatformDefinitions(mf); + mf->AddDefinition("CMAKE_VS_PLATFORM_NAME", this->GetPlatformName()); +} + +//---------------------------------------------------------------------------- // ouput standard header for dsw file void cmGlobalVisualStudio8Generator::WriteSLNHeader(std::ostream& fout) { diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h index f68bb9e..a39c26d 100644 --- a/Source/cmGlobalVisualStudio8Generator.h +++ b/Source/cmGlobalVisualStudio8Generator.h @@ -38,6 +38,8 @@ public: ///! Create a local generator appropriate to this Global Generator virtual cmLocalGenerator *CreateLocalGenerator(); + virtual void AddPlatformDefinitions(cmMakefile* mf); + /** * Override Configure and Generate to add the build-system check * target. |