|
|
@@ -65,6 +65,24 @@ else()
|
|
|
PROPERTIES COMPILE_FLAGS "-ITarProp")
|
|
|
endif()
|
|
|
|
|
|
+# Test escaping of special characters in include directory paths.
|
|
|
+# FIXME: Implement full support in Makefile generators
|
|
|
+if(NOT CMAKE_GENERATOR MATCHES "Make")
|
|
|
+ set(special_chars "~@#$%^&=[]{}()!'")
|
|
|
+ if(NOT CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
|
|
|
+ string(APPEND special_chars ",")
|
|
|
+ endif()
|
|
|
+ if(NOT WIN32 AND NOT CYGWIN)
|
|
|
+ string(APPEND special_chars "*?<>")
|
|
|
+ endif()
|
|
|
+ set(special_dir "${CMAKE_CURRENT_BINARY_DIR}/special-${special_chars}-include")
|
|
|
+ file(WRITE "${special_dir}/SpecialDir.h" "#define SPECIAL_DIR_H\n")
|
|
|
+ set(special_space_dir "${CMAKE_CURRENT_BINARY_DIR}/special-space ${special_chars}-include")
|
|
|
+ file(WRITE "${special_space_dir}/SpecialSpaceDir.h" "#define SPECIAL_SPACE_DIR_H\n")
|
|
|
+ target_include_directories(IncludeDirectories PRIVATE "${special_dir}" "${special_space_dir}")
|
|
|
+ target_compile_definitions(IncludeDirectories PRIVATE INCLUDE_SPECIAL_DIR)
|
|
|
+endif()
|
|
|
+
|
|
|
add_library(ordertest ordertest.cpp)
|
|
|
target_include_directories(ordertest SYSTEM PUBLIC SystemIncludeDirectories/systemlib)
|
|
|
target_include_directories(ordertest PUBLIC SystemIncludeDirectories/userlib)
|