diff options
author | David Cole <david.cole@kitware.com> | 2011-01-25 23:54:36 (GMT) |
---|---|---|
committer | David Cole <david.cole@kitware.com> | 2011-01-26 00:01:13 (GMT) |
commit | 662756036e4f4983b00ab7740773a55bef808c64 (patch) | |
tree | 187ec92cf99e4c04efa440539b4aa316b7180153 /Tests | |
parent | 0cde56dda4b93a8a51196dbd8c26fdf530a70968 (diff) | |
download | CMake-662756036e4f4983b00ab7740773a55bef808c64.zip CMake-662756036e4f4983b00ab7740773a55bef808c64.tar.gz CMake-662756036e4f4983b00ab7740773a55bef808c64.tar.bz2 |
VS10: Escape double quote chars in defines for rc files (#11695)
To get rc defines to work in the VS10 IDE requires \" when
constructing PreprocessorDefinitions strings. This is different
than defines for cl.
Also, per-file rc defines were not being generated. Fix that, too.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/VSResource/CMakeLists.txt | 10 | ||||
-rw-r--r-- | Tests/VSResource/test.rc | 7 |
2 files changed, 14 insertions, 3 deletions
diff --git a/Tests/VSResource/CMakeLists.txt b/Tests/VSResource/CMakeLists.txt index e842955..8c14f8d 100644 --- a/Tests/VSResource/CMakeLists.txt +++ b/Tests/VSResource/CMakeLists.txt @@ -1,7 +1,13 @@ -cmake_minimum_required (VERSION 2.6) +cmake_minimum_required(VERSION 2.8.3.20110118) project (VSResource) -add_definitions(/DCMAKE_RCDEFINE="test.txt") + string(REPLACE "/INCREMENTAL:YES" "" CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG}") + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test.txt + "${CMAKE_CURRENT_BINARY_DIR}/test with spaces.txt" COPYONLY) +include_directories(${CMAKE_CURRENT_BINARY_DIR}) +add_definitions(/DCMAKE_RCDEFINE="test with spaces.txt") + add_executable(VSResource main.cpp test.rc) diff --git a/Tests/VSResource/test.rc b/Tests/VSResource/test.rc index 8aab8b7..2e87a68 100644 --- a/Tests/VSResource/test.rc +++ b/Tests/VSResource/test.rc @@ -1,5 +1,10 @@ #ifdef CMAKE_RCDEFINE hello TEXT DISCARDABLE CMAKE_RCDEFINE + +STRINGTABLE +BEGIN + 1 CMAKE_RCDEFINE +END #else #error "resource compiler did not get defines from command line!" -#endif
\ No newline at end of file +#endif |