diff options
author | Brad King <brad.king@kitware.com> | 2014-10-10 13:57:07 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-10-13 12:20:05 (GMT) |
commit | f4c5eade787f4f0a6e33fe029c2816580db06041 (patch) | |
tree | 549735d61c4a2e81c9a05a0e9613b0bc756c8ce4 /Tests/VSResource/CMakeLists.txt | |
parent | 5ab9aa62fe1e5e1e74bafc69bf0e8d16f118ac9d (diff) | |
download | CMake-f4c5eade787f4f0a6e33fe029c2816580db06041.zip CMake-f4c5eade787f4f0a6e33fe029c2816580db06041.tar.gz CMake-f4c5eade787f4f0a6e33fe029c2816580db06041.tar.bz2 |
Ninja: Fix RC include directories regression
Changes in commit b9aa5041 (cmLocalGenerator: Simplify GetIncludeFlags
output formatting, 2014-03-04) caused Windows Resource Compiler include
directories to be computed as relative paths in the Ninja generator.
This breaks the cmcldeps handling of include paths. The reason for the
regression is that several cmLocalGenerator::GetIncludeFlags callers
treated the fourth "bool forResponseFile" argument as if it controlled
whether include directories were a full path. It actually did control
that by accident until the above commit.
Add an explicit "bool forceFullPaths" argument to GetIncludeFlags
and thread the value through ConvertToIncludeReference as needed.
Update GetIncludeFlags call sites that really wanted to control the
forResponseFile setting to be aware of the new argument. Extend the
VSResource test to cover this case.
Diffstat (limited to 'Tests/VSResource/CMakeLists.txt')
-rw-r--r-- | Tests/VSResource/CMakeLists.txt | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Tests/VSResource/CMakeLists.txt b/Tests/VSResource/CMakeLists.txt index c5cb336..17eb041 100644 --- a/Tests/VSResource/CMakeLists.txt +++ b/Tests/VSResource/CMakeLists.txt @@ -18,6 +18,11 @@ if(CMAKE_RC_COMPILER MATCHES windres) message(STATUS "CMAKE_RC_COMPILER MATCHES windres") add_definitions(/DCMAKE_RCDEFINE=test.txt) add_definitions(/DCMAKE_RCDEFINE_NO_QUOTED_STRINGS) + if(MSYS AND CMAKE_CURRENT_BINARY_DIR MATCHES " ") + # windres cannot handle spaces in include dir, and + # for the MSys shell we do not convert to shortpath. + set(CMAKE_RC_NO_INCLUDE 1) + endif() elseif(MSVC60) # VS6 rc compiler does not deal well with spaces in a "/D" value, but it can # handle the quoting @@ -30,10 +35,17 @@ else() set(TEXTFILE_FROM_SOURCE_DIR "textfile, spaces in name, from binary dir") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test.txt "${CMAKE_CURRENT_BINARY_DIR}/test with spaces.txt" @ONLY) - include_directories(${CMAKE_CURRENT_BINARY_DIR}) add_definitions(/DCMAKE_RCDEFINE="test with spaces.txt") endif() +if(CMAKE_RC_NO_INCLUDE) + add_definitions(/DCMAKE_RC_NO_INCLUDE) +else() + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include.rc.in + "${CMAKE_CURRENT_BINARY_DIR}/include.rc" @ONLY) + include_directories(${CMAKE_CURRENT_BINARY_DIR}) +endif() + add_executable(VSResource main.cpp test.rc) set_property(TARGET VSResource |