summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/include_directories/DebugIncludes.cmake
blob: 10a4c50206165e43785b37a4a09cac3b1c25907b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

enable_language(CXX)

set(CMAKE_DEBUG_TARGET_PROPERTIES INCLUDE_DIRECTORIES)

file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/DebugIncludes.cpp" "enum { dummy };\n")

include_directories(
  "${CMAKE_CURRENT_SOURCE_DIR}/one"
  "${CMAKE_CURRENT_SOURCE_DIR}/two"
)

set_property(DIRECTORY APPEND PROPERTY INCLUDE_DIRECTORIES
                          "${CMAKE_CURRENT_SOURCE_DIR}/three")

add_library(lll "${CMAKE_CURRENT_BINARY_DIR}/DebugIncludes.cpp")

include_directories(
  "${CMAKE_CURRENT_SOURCE_DIR}/two"
  "${CMAKE_CURRENT_SOURCE_DIR}/three"
  "${CMAKE_CURRENT_SOURCE_DIR}/four"
)

add_library(foo "${CMAKE_CURRENT_BINARY_DIR}/DebugIncludes.cpp")
target_include_directories(foo
  INTERFACE
    "${CMAKE_CURRENT_SOURCE_DIR}/seven"
    "${CMAKE_CURRENT_SOURCE_DIR}/eight"
)
target_link_libraries(lll foo)

macro(some_macro)
  set_property(TARGET lll APPEND PROPERTY
      INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/one"
                          "${CMAKE_CURRENT_SOURCE_DIR}/three"
                          "${CMAKE_CURRENT_SOURCE_DIR}/four"
                          "${CMAKE_CURRENT_SOURCE_DIR}/five"
                          "${CMAKE_CURRENT_SOURCE_DIR}/six"
                          "${CMAKE_CURRENT_SOURCE_DIR}/seven"
  )
endmacro()

function(some_function)
  some_macro()
endfunction()

some_function()

add_library(bar "${CMAKE_CURRENT_BINARY_DIR}/DebugIncludes.cpp")
target_include_directories(bar
  INTERFACE
    "${CMAKE_CURRENT_SOURCE_DIR}/nine"
    "${CMAKE_CURRENT_SOURCE_DIR}/ten"
)
set_property(TARGET lll APPEND PROPERTY LINK_LIBRARIES bar)