Browse Source

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.
Sam Edwards 7 years ago
parent
commit
7590c37f0c

+ 1 - 1
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
   # in the same way that they are passed to the compiler so that Interrogate
   # will preprocess each file in the same way.
   # will preprocess each file in the same way.
   set(define_flags)
   set(define_flags)
-  get_target_property(target_defines "${target}" COMPILE_DEFINITIONS)
+  get_target_property(target_defines "${target}" INTERFACE_COMPILE_DEFINITIONS)
   if(target_defines)
   if(target_defines)
     foreach(target_define ${target_defines})
     foreach(target_define ${target_defines})
       list(APPEND define_flags "-D${target_define}")
       list(APPEND define_flags "-D${target_define}")

+ 1 - 1
direct/src/dcparse/CMakeLists.txt

@@ -1,4 +1,4 @@
 add_executable(dcparse dcparse.cxx)
 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)
 target_link_libraries(dcparse p3dcparser)
 install(TARGETS dcparse DESTINATION bin)
 install(TARGETS dcparse DESTINATION bin)

+ 1 - 1
direct/src/dcparser/CMakeLists.txt

@@ -48,7 +48,7 @@ set(P3DCPARSER_PARSER_SOURCES
 composite_sources(p3dcparser P3DCPARSER_SOURCES)
 composite_sources(p3dcparser P3DCPARSER_SOURCES)
 add_library(p3dcparser ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES}
 add_library(p3dcparser ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES}
   ${P3DCPARSER_PARSER_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_link_libraries(p3dcparser p3directbase panda)
 target_use_packages(p3dcparser PYTHON)
 target_use_packages(p3dcparser PYTHON)
 target_interrogate(p3dcparser ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES})
 target_interrogate(p3dcparser ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES})

+ 1 - 1
direct/src/distributed/CMakeLists.txt

@@ -13,7 +13,7 @@ if(HAVE_PYTHON)
 
 
   add_library(p3distributed ${P3DISTRIBUTED_HEADERS} ${P3DISTRIBUTED_SOURCES})
   add_library(p3distributed ${P3DISTRIBUTED_HEADERS} ${P3DISTRIBUTED_SOURCES})
   set_target_properties(p3distributed PROPERTIES DEFINE_SYMBOL BUILDING_DIRECT_DISTRIBUTED)
   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_link_libraries(p3distributed p3directbase p3dcparser panda)
   target_use_packages(p3distributed PYTHON)
   target_use_packages(p3distributed PYTHON)
   target_interrogate(p3distributed ALL)
   target_interrogate(p3distributed ALL)

+ 1 - 1
panda/src/ode/CMakeLists.txt

@@ -83,7 +83,7 @@ if(HAVE_ODE)
   composite_sources(p3ode P3ODE_SOURCES)
   composite_sources(p3ode P3ODE_SOURCES)
   add_library(p3ode ${P3ODE_SOURCES} ${P3ODE_HEADERS})
   add_library(p3ode ${P3ODE_SOURCES} ${P3ODE_HEADERS})
   set_target_properties(p3ode PROPERTIES DEFINE_SYMBOL BUILDING_PANDAODE)
   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_link_libraries(p3ode panda)
   target_use_packages(p3ode ODE)
   target_use_packages(p3ode ODE)
   target_interrogate(p3ode ${P3ODE_IGATE_SOURCES} EXTENSIONS ${P3ODE_IGATEEXT})
   target_interrogate(p3ode ${P3ODE_IGATE_SOURCES} EXTENSIONS ${P3ODE_IGATEEXT})