summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt
blob: 84a23efc3adade30ae7e68c0cc9c82facb0c186e (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

cmake_minimum_required(VERSION 2.8)

project(target_compile_definitions)

add_executable(target_compile_definitions
  "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp"
)
target_compile_definitions(target_compile_definitions
  PRIVATE MY_PRIVATE_DEFINE
  PUBLIC MY_PUBLIC_DEFINE
  INTERFACE MY_INTERFACE_DEFINE
)

add_library(importedlib UNKNOWN IMPORTED)
target_compile_definitions(importedlib
  INTERFACE MY_IMPORTEDINTERFACE_DEFINE
)

add_executable(consumer
  "${CMAKE_CURRENT_SOURCE_DIR}/consumer.cpp"
)

target_compile_definitions(consumer
  PRIVATE target_compile_definitions importedlib
)