diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2011-06-03 16:16:50 -0400 |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2011-06-03 16:16:50 -0400 |
commit | 27aa446352b882c7bbda269a3770fec8fa24eb57 (patch) | |
tree | 8c436bbca58b184de1a24b8f2ea05e0aeafbbe3a /Tests/IncludeDirectories | |
parent | 2dfc121b898dcd04b3fe8ecb18d1ad8d9c4b945a (diff) | |
download | cmake-27aa446352b882c7bbda269a3770fec8fa24eb57.tar.gz |
One more try. Use full path by default, and relative on broken compilers.
Diffstat (limited to 'Tests/IncludeDirectories')
-rw-r--r-- | Tests/IncludeDirectories/CMakeLists.txt | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/Tests/IncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/CMakeLists.txt index 87b4a95a66..60b8c22b2f 100644 --- a/Tests/IncludeDirectories/CMakeLists.txt +++ b/Tests/IncludeDirectories/CMakeLists.txt @@ -14,10 +14,34 @@ file(WRITE ${CMAKE_BINARY_DIR}/TarProp/TarProp.h "//TarProp.h ") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -IFlags") +# default to testing with full path +# some compilers can not handle the escape for directories +# with spaces in them. +set(USE_FULLPATH TRUE) +if(WATCOM OR MSVC60) + set(USE_FULLPATH FALSE) +endif() +if(USE_FULLPATH) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \"-I${CMAKE_BINARY_DIR}/Flags\"") +else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -IFlags") +endif() + include_directories(${CMAKE_BINARY_DIR}/IncDir) -set_source_files_properties(main.cpp PROPERTIES COMPILE_FLAGS - "-ISrcProp") +if(USE_FULLPATH) + set_source_files_properties(main.cpp PROPERTIES COMPILE_FLAGS + "\"-I${CMAKE_BINARY_DIR}/SrcProp\"") +else() + set_source_files_properties(main.cpp PROPERTIES COMPILE_FLAGS + "-ISrcProp") +endif() + add_executable(IncludeDirectories main.cpp) -set_target_properties(IncludeDirectories - PROPERTIES COMPILE_FLAGS "-ITarProp") + +if(USE_FULLPATH) + set_target_properties(IncludeDirectories + PROPERTIES COMPILE_FLAGS "\"-I${CMAKE_BINARY_DIR}/TarProp\"") +else() + set_target_properties(IncludeDirectories + PROPERTIES COMPILE_FLAGS "-ITarProp") +endif() |