diff options
author | Brad King <brad.king@kitware.com> | 2019-09-04 12:53:49 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-09-04 12:53:59 (GMT) |
commit | 09032f09f8d2b4f7af658060ef434083f9d6a0d4 (patch) | |
tree | 463997af42ef8c61ae91f02ff0757f349bf8501a /Tests | |
parent | 7b50b05aa9f162388fc9f57899baffdafad7d4af (diff) | |
parent | 383bf3b5e7609621719a8923b65d003087789e98 (diff) | |
download | CMake-09032f09f8d2b4f7af658060ef434083f9d6a0d4.zip CMake-09032f09f8d2b4f7af658060ef434083f9d6a0d4.tar.gz CMake-09032f09f8d2b4f7af658060ef434083f9d6a0d4.tar.bz2 |
Merge topic 'pch-fix-vs-test'
383bf3b5e7 Precompile Headers: Fix Visual Studio 10 unit test
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3770
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/VS10Project/VsPrecompileHeaders-check.cmake | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/Tests/RunCMake/VS10Project/VsPrecompileHeaders-check.cmake b/Tests/RunCMake/VS10Project/VsPrecompileHeaders-check.cmake index 82ca421..27842f9 100644 --- a/Tests/RunCMake/VS10Project/VsPrecompileHeaders-check.cmake +++ b/Tests/RunCMake/VS10Project/VsPrecompileHeaders-check.cmake @@ -1,13 +1,11 @@ -set(pch_header "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/cmake_pch.hxx") -set(pch_source "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/cmake_pch.cxx") +set(pch_header "CMakeFiles/tgt.dir/cmake_pch.hxx") +set(pch_source [=[CMakeFiles\\tgt.dir\\cmake_pch.cxx]=]) -file(TO_NATIVE_PATH "${pch_source}" pch_source_win) - -if(NOT EXISTS "${pch_header}") +if(NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/${pch_header}") set(RunCMake_TEST_FAILED "Generated PCH header ${pch_header} does not exist.") return() endif() -if(NOT EXISTS "${pch_source}") +if(NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/${pch_source}") set(RunCMake_TEST_FAILED "Generated PCH header ${pch_source} does not exist.") return() endif() @@ -29,16 +27,15 @@ foreach(line IN LISTS tgt_projects_strings) set(have_pch_create ON) endif() - if (line MATCHES "<PrecompiledHeaderFile.*>${pch_header}</PrecompiledHeaderFile>") + if (line MATCHES "<PrecompiledHeaderFile.*>.*${pch_header}</PrecompiledHeaderFile>") set(have_pch_header ON) endif() - if (line MATCHES "<ForcedIncludeFiles.*>${pch_header}</ForcedIncludeFiles>") + if (line MATCHES "<ForcedIncludeFiles.*>.*${pch_header}</ForcedIncludeFiles>") set(have_force_pch_header ON) endif() - string(FIND "${line}" "<ClCompile Include=\"${pch_source_win}\">" find_pos) - if (NOT find_pos EQUAL "-1") + if (line MATCHES "<ClCompile Include=.*${pch_source}\">") set(have_pch_source_compile ON) endif() endforeach() @@ -64,6 +61,6 @@ if (NOT have_force_pch_header) endif() if (NOT have_pch_source_compile) - set(RunCMake_TEST_FAILED "Generated project should have the <ClCompile Include=\"${pch_source_win}\"> block.") + set(RunCMake_TEST_FAILED "Generated project should have the <ClCompile Include=\"${pch_source}\"> block.") return() endif() |