2013-01-08 03:34:41 +04:00
|
|
|
|
|
|
|
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_executable(consumer
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/consumer.cpp"
|
|
|
|
)
|
|
|
|
|
2013-01-31 02:38:04 +04:00
|
|
|
add_library(linked UNKNOWN IMPORTED)
|
|
|
|
set_property(TARGET linked PROPERTY
|
|
|
|
INTERFACE_COMPILE_DEFINITIONS "MY_LINKED_DEFINE")
|
|
|
|
|
|
|
|
|
2013-01-08 03:34:41 +04:00
|
|
|
target_compile_definitions(consumer
|
2013-01-29 20:43:28 +04:00
|
|
|
PRIVATE $<TARGET_PROPERTY:target_compile_definitions,INTERFACE_COMPILE_DEFINITIONS>
|
2012-11-20 02:56:12 +04:00
|
|
|
$<$<TARGET_DEFINED:notdefined>:SHOULD_NOT_BE_DEFINED>
|
2013-01-21 15:28:27 +04:00
|
|
|
$<$<TARGET_DEFINED:target_compile_definitions>:SHOULD_BE_DEFINED>
|
2013-01-31 02:38:04 +04:00
|
|
|
$<LINKED:linked>
|
2013-01-29 20:23:31 +04:00
|
|
|
-DDASH_D_DEFINE
|
2013-01-08 03:34:41 +04:00
|
|
|
)
|