summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-10-13 12:21:04 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-10-13 12:21:04 (GMT)
commitcea13d5536ef77fb93ef8ae5abfa9c81920140e7 (patch)
tree543640745dc1c8921f6b3033e4b250ebe6447e1a /Tests
parentc11a342e652be170e232d100474836a239037623 (diff)
parentf4c5eade787f4f0a6e33fe029c2816580db06041 (diff)
downloadCMake-cea13d5536ef77fb93ef8ae5abfa9c81920140e7.zip
CMake-cea13d5536ef77fb93ef8ae5abfa9c81920140e7.tar.gz
CMake-cea13d5536ef77fb93ef8ae5abfa9c81920140e7.tar.bz2
Merge topic 'fix-ninja-rc-include-flags'
f4c5eade Ninja: Fix RC include directories regression
Diffstat (limited to 'Tests')
-rw-r--r--Tests/VSResource/CMakeLists.txt14
-rw-r--r--Tests/VSResource/include.rc.in1
-rw-r--r--Tests/VSResource/test.rc3
3 files changed, 17 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
diff --git a/Tests/VSResource/include.rc.in b/Tests/VSResource/include.rc.in
new file mode 100644
index 0000000..f0f6859
--- /dev/null
+++ b/Tests/VSResource/include.rc.in
@@ -0,0 +1 @@
+// This file should be included.
diff --git a/Tests/VSResource/test.rc b/Tests/VSResource/test.rc
index 4ce4b53..0de4683 100644
--- a/Tests/VSResource/test.rc
+++ b/Tests/VSResource/test.rc
@@ -1,4 +1,7 @@
#ifdef CMAKE_RCDEFINE
+# ifndef CMAKE_RC_NO_INCLUDE
+# include <include.rc>
+# endif
// This line can compile with either an unquoted or a quoted string
1025 TEXTFILE CMAKE_RCDEFINE