Use bin tree for inclues to avoid -I with spaces in the path.
This commit is contained in:
parent
6d29b4bfe6
commit
2dfc121b89
|
@ -1,10 +1,23 @@
|
||||||
cmake_minimum_required (VERSION 2.6)
|
cmake_minimum_required (VERSION 2.6)
|
||||||
project(IncludeDirectories)
|
project(IncludeDirectories)
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \"-I${CMAKE_SOURCE_DIR}/Flags\"")
|
file(WRITE ${CMAKE_BINARY_DIR}/Flags/Flags.h
|
||||||
include_directories(${CMAKE_SOURCE_DIR}/IncDir)
|
"//Flags.h
|
||||||
|
")
|
||||||
|
file(WRITE ${CMAKE_BINARY_DIR}/IncDir/IncDir.h
|
||||||
|
"//IncDir.h
|
||||||
|
")
|
||||||
|
file(WRITE ${CMAKE_BINARY_DIR}/SrcProp/SrcProp.h
|
||||||
|
"//SrcProp.h
|
||||||
|
")
|
||||||
|
file(WRITE ${CMAKE_BINARY_DIR}/TarProp/TarProp.h
|
||||||
|
"//TarProp.h
|
||||||
|
")
|
||||||
|
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -IFlags")
|
||||||
|
include_directories(${CMAKE_BINARY_DIR}/IncDir)
|
||||||
set_source_files_properties(main.cpp PROPERTIES COMPILE_FLAGS
|
set_source_files_properties(main.cpp PROPERTIES COMPILE_FLAGS
|
||||||
"\"-I${CMAKE_SOURCE_DIR}/SrcProp\"")
|
"-ISrcProp")
|
||||||
add_executable(IncludeDirectories main.cpp)
|
add_executable(IncludeDirectories main.cpp)
|
||||||
set_target_properties(IncludeDirectories
|
set_target_properties(IncludeDirectories
|
||||||
PROPERTIES COMPILE_FLAGS "\"-I${CMAKE_SOURCE_DIR}/TarProp\"")
|
PROPERTIES COMPILE_FLAGS "-ITarProp")
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
// include Flags.h
|
|
|
@ -1 +0,0 @@
|
||||||
// include IncDir.h
|
|
|
@ -1 +0,0 @@
|
||||||
// include SrcProp.h
|
|
|
@ -1 +0,0 @@
|
||||||
// include TarProp.h
|
|
Loading…
Reference in New Issue