2011-11-05 19:17:49 +04:00
|
|
|
|
|
|
|
cmake_minimum_required(VERSION 2.8)
|
|
|
|
|
|
|
|
project(TargetIncludeDirectories)
|
|
|
|
|
|
|
|
macro(create_header _name)
|
|
|
|
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${_name}")
|
2012-06-19 00:16:55 +04:00
|
|
|
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${_name}/${_name}.h" "//${_name}.h\n")
|
2011-11-05 19:17:49 +04:00
|
|
|
endmacro()
|
|
|
|
|
|
|
|
create_header(bar)
|
|
|
|
create_header(bat)
|
|
|
|
create_header(foo)
|
|
|
|
create_header(baz)
|
2012-09-18 15:57:07 +04:00
|
|
|
create_header(bang)
|
|
|
|
create_header(bing)
|
|
|
|
create_header(bung)
|
2012-10-12 19:17:30 +04:00
|
|
|
create_header(arguments)
|
|
|
|
create_header(list)
|
2012-10-19 15:11:59 +04:00
|
|
|
create_header(target)
|
2011-11-05 19:17:49 +04:00
|
|
|
|
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
|
|
|
|
|
|
include_directories("${CMAKE_CURRENT_BINARY_DIR}/bar")
|
2012-09-18 15:57:07 +04:00
|
|
|
include_directories("$<1:${CMAKE_CURRENT_BINARY_DIR}/bang>")
|
2011-11-05 19:17:49 +04:00
|
|
|
|
|
|
|
add_executable(TargetIncludeDirectories main.cpp)
|
2012-10-19 15:11:59 +04:00
|
|
|
|
2011-11-05 19:17:49 +04:00
|
|
|
set_property(TARGET TargetIncludeDirectories APPEND PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/bat")
|
|
|
|
set_property(TARGET TargetIncludeDirectories APPEND PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/foo")
|
2012-09-18 15:57:07 +04:00
|
|
|
set_property(TARGET TargetIncludeDirectories APPEND PROPERTY
|
|
|
|
INCLUDE_DIRECTORIES "$<1:${CMAKE_CURRENT_BINARY_DIR}/bing>")
|
2011-11-05 19:17:49 +04:00
|
|
|
|
|
|
|
include_directories("${CMAKE_CURRENT_BINARY_DIR}/baz")
|
2012-09-18 15:57:07 +04:00
|
|
|
include_directories("$<1:${CMAKE_CURRENT_BINARY_DIR}/bung>")
|
|
|
|
include_directories("sing$<1:/ting>")
|
2012-10-12 19:17:30 +04:00
|
|
|
|
|
|
|
include_directories("$<1:${CMAKE_CURRENT_BINARY_DIR}/arguments;${CMAKE_CURRENT_BINARY_DIR}/list>")
|
2012-10-19 15:11:59 +04:00
|
|
|
|
|
|
|
add_library(somelib::withcolons UNKNOWN IMPORTED)
|
|
|
|
set_property(TARGET somelib::withcolons PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/target")
|
|
|
|
set_property(TARGET somelib::withcolons PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/target")
|
|
|
|
|
|
|
|
set_property(TARGET TargetIncludeDirectories
|
|
|
|
APPEND PROPERTY INCLUDE_DIRECTORIES
|
|
|
|
"$<TARGET_PROPERTY:somelib::withcolons,INTERFACE_INCLUDE_DIRECTORIES>"
|
|
|
|
)
|