From 7590c37f0c23c05737e5a7da18567c3f29c5969b Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 18 Apr 2018 12:23:18 -0600 Subject: [PATCH] CMake: Have Interrogate respect INTERFACE_COMPILE_DEFINITIONS This commit isn't technically quite right, since Interrogate should use the definitions from COMPILE_DEFINITIONS but the module should be built with INTERFACE_COMPILE_DEFINITIONS, but whatever. That can be changed if it becomes a nuisance later on. The rationale here is it's consistent with how CMake treats these two properties. --- cmake/macros/Interrogate.cmake | 2 +- direct/src/dcparse/CMakeLists.txt | 2 +- direct/src/dcparser/CMakeLists.txt | 2 +- direct/src/distributed/CMakeLists.txt | 2 +- panda/src/ode/CMakeLists.txt | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 39b5cbe3dc..2b69aa3ce4 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -192,7 +192,7 @@ function(interrogate_sources target output database language_flags) # in the same way that they are passed to the compiler so that Interrogate # will preprocess each file in the same way. set(define_flags) - get_target_property(target_defines "${target}" COMPILE_DEFINITIONS) + get_target_property(target_defines "${target}" INTERFACE_COMPILE_DEFINITIONS) if(target_defines) foreach(target_define ${target_defines}) list(APPEND define_flags "-D${target_define}") diff --git a/direct/src/dcparse/CMakeLists.txt b/direct/src/dcparse/CMakeLists.txt index 947c67dfec..ded4815f8f 100644 --- a/direct/src/dcparse/CMakeLists.txt +++ b/direct/src/dcparse/CMakeLists.txt @@ -1,4 +1,4 @@ add_executable(dcparse dcparse.cxx) -set_target_properties(dcparse PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) +target_compile_definitions(dcparse PUBLIC WITHIN_PANDA) target_link_libraries(dcparse p3dcparser) install(TARGETS dcparse DESTINATION bin) diff --git a/direct/src/dcparser/CMakeLists.txt b/direct/src/dcparser/CMakeLists.txt index d36fd7fd9f..318be281d4 100644 --- a/direct/src/dcparser/CMakeLists.txt +++ b/direct/src/dcparser/CMakeLists.txt @@ -48,7 +48,7 @@ set(P3DCPARSER_PARSER_SOURCES composite_sources(p3dcparser P3DCPARSER_SOURCES) add_library(p3dcparser ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES} ${P3DCPARSER_PARSER_SOURCES}) -set_target_properties(p3dcparser PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) +target_compile_definitions(p3dcparser PUBLIC WITHIN_PANDA) target_link_libraries(p3dcparser p3directbase panda) target_use_packages(p3dcparser PYTHON) target_interrogate(p3dcparser ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES}) diff --git a/direct/src/distributed/CMakeLists.txt b/direct/src/distributed/CMakeLists.txt index 0216e766ce..9e4168eb53 100644 --- a/direct/src/distributed/CMakeLists.txt +++ b/direct/src/distributed/CMakeLists.txt @@ -13,7 +13,7 @@ if(HAVE_PYTHON) add_library(p3distributed ${P3DISTRIBUTED_HEADERS} ${P3DISTRIBUTED_SOURCES}) set_target_properties(p3distributed PROPERTIES DEFINE_SYMBOL BUILDING_DIRECT_DISTRIBUTED) - set_target_properties(p3distributed PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) + target_compile_definitions(p3distributed PUBLIC WITHIN_PANDA) target_link_libraries(p3distributed p3directbase p3dcparser panda) target_use_packages(p3distributed PYTHON) target_interrogate(p3distributed ALL) diff --git a/panda/src/ode/CMakeLists.txt b/panda/src/ode/CMakeLists.txt index a018d8305b..7ac467ef7b 100644 --- a/panda/src/ode/CMakeLists.txt +++ b/panda/src/ode/CMakeLists.txt @@ -83,7 +83,7 @@ if(HAVE_ODE) composite_sources(p3ode P3ODE_SOURCES) add_library(p3ode ${P3ODE_SOURCES} ${P3ODE_HEADERS}) set_target_properties(p3ode PROPERTIES DEFINE_SYMBOL BUILDING_PANDAODE) - set_target_properties(p3ode PROPERTIES COMPILE_DEFINITIONS dSINGLE) + target_compile_definitions(p3ode PUBLIC dSINGLE) target_link_libraries(p3ode panda) target_use_packages(p3ode ODE) target_interrogate(p3ode ${P3ODE_IGATE_SOURCES} EXTENSIONS ${P3ODE_IGATEEXT})