From 4a24015afccfa71bed9ea741af38ef4463740074 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 16 Sep 2014 09:35:56 -0400 Subject: [PATCH 1/3] Tests: Always detect VS and SDK availability on Windows Move the detection block out of the Windows >= 8 conditional so it can be used on other versions. --- Tests/CMakeLists.txt | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 5b336ce7e..2b70f567a 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1780,6 +1780,23 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release endif() endif() + if(WIN32) + set(reg_vs11 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;InstallDir]") + set(reg_vs12 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\12.0;InstallDir]") + set(reg_ws80 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]") + set(reg_ws81 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.1;InstallationFolder]") + set(reg_wp80 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\WindowsPhone\\v8.0;InstallationFolder]") + set(reg_wp81 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\WindowsPhone\\v8.1;InstallationFolder]") + foreach(reg vs11 vs12 ws80 ws81 wp80 wp81) + get_filename_component(r "${reg_${reg}}" ABSOLUTE) + if(IS_DIRECTORY "${r}") + set(${reg} 1) + else() + set(${reg} 0) + endif() + endforeach() + endif() + get_filename_component(ntver "[HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion;CurrentVersion]" NAME) if(WIN32 AND ntver VERSION_GREATER 6.1) # Windows >= 8.0 macro(add_test_VSWinStorePhone name generator systemName systemVersion) @@ -1796,20 +1813,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSWinStorePhone/${name}") endmacro() - set(reg_vs11 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;InstallDir]") - set(reg_vs12 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\12.0;InstallDir]") - set(reg_ws80 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]") - set(reg_ws81 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.1;InstallationFolder]") - set(reg_wp80 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\WindowsPhone\\v8.0;InstallationFolder]") - set(reg_wp81 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\WindowsPhone\\v8.1;InstallationFolder]") - foreach(reg vs11 vs12 ws80 ws81 wp80 wp81) - get_filename_component(r "${reg_${reg}}" ABSOLUTE) - if(IS_DIRECTORY "${r}") - set(${reg} 1) - else() - set(${reg} 0) - endif() - endforeach() if(vs11 AND ws80) add_test_VSWinStorePhone(vs11-store80-X86 "Visual Studio 11 2012" WindowsStore 8.0) add_test_VSWinStorePhone(vs11-store80-ARM "Visual Studio 11 2012 ARM" WindowsStore 8.0) From 227a336714274992f90ad171bd6588d8dd17b76c Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 24 Sep 2014 14:25:35 -0400 Subject: [PATCH 2/3] VS: Use case-insensitive check for hlsl,jpg,png,xml file extensions These "extra" sources should map to the proper tool even when they are not in lower case. --- Source/cmVisualStudio10TargetGenerator.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 4b5c83f68..3cb0c6131 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -1130,7 +1130,7 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf) bool toolHasSettings = false; std::string tool = "None"; std::string shaderType; - std::string const& ext = sf->GetExtension(); + std::string ext = cmSystemTools::LowerCase(sf->GetExtension()); if(ext == "hlsl") { tool = "FXCompile"; From c655f0c417f66096a62bb837e163ec636665dd69 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 26 Sep 2014 10:12:31 -0400 Subject: [PATCH 3/3] VS: Drop GenerateManifest from .vcxproj files for non-MS tools The .vcxproj file content generated by OutputLinkIncremental is specific to MS tools, so drop it when using other tools. --- Source/cmVisualStudio10TargetGenerator.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 3cb0c6131..a13cbd29b 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -1593,6 +1593,10 @@ void cmVisualStudio10TargetGenerator:: OutputLinkIncremental(std::string const& configName) { + if(!this->MSTools) + { + return; + } // static libraries and things greater than modules do not need // to set this option if(this->Target->GetType() == cmTarget::STATIC_LIBRARY