diff --git a/CMakeLists.txt b/CMakeLists.txt index 28a970ec64..6bcb35b6fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,6 +44,7 @@ include(dtool/Config.cmake) # Include global modules include(AddBisonTarget) # Defines add_bison_target function include(AddFlexTarget) # Defines add_flex_target function +include(BuildMetalib) # Defines add_component_library AND add_metalib include(CompositeSources) # Defines composite_sources function include(Interrogate) # Defines target_interrogate AND add_python_module include(RunPzip) # Defines run_pzip function diff --git a/cmake/macros/BuildMetalib.cmake b/cmake/macros/BuildMetalib.cmake new file mode 100644 index 0000000000..b42c35b7f2 --- /dev/null +++ b/cmake/macros/BuildMetalib.cmake @@ -0,0 +1,155 @@ +# Filename: BuildMetalib.cmake +# +# Description: This file contains macros to build Panda3D's "metalibs" - these +# are special libraries that contain no unique code themselves and are +# instead just an agglomeration of the various component libraries that get +# linked into them. A library of libraries - a "metalibrary." + +# +# Function: target_link_libraries(...) +# +# Overrides CMake's target_link_libraries() to support "linking" object +# libraries. This is a partial reimplementation of CMake commit dc38970f83, +# which as of this writing has not yet landed in any release. +# +function(target_link_libraries target) + get_target_property(target_type "${target}" TYPE) + if(NOT target_type STREQUAL "OBJECT_LIBRARY") + _target_link_libraries("${target}" ${ARGN}) + return() + endif() + + foreach(library ${ARGN}) + if(library MATCHES "^[A-Za-z0-9]+$") + # We need to add "library"'s include directories to "target" + # (and transitively to INTERFACE_INCLUDE_DIRECTORIES so further + # dependencies will work) + set(include_directories "$") + set_property(TARGET "${target}" APPEND PROPERTY INCLUDE_DIRECTORIES "${include_directories}") + set_property(TARGET "${target}" APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${include_directories}") + + # Also build with the same BUILDING_ macros, because these will all end + # up in the same library. + set(compile_definitions "$") + set_property(TARGET "${target}" APPEND PROPERTY COMPILE_DEFINITIONS "${compile_definitions}") + + # Libraries are only linked transitively if they aren't components. + # Unfortunately, it seems like INTERFACE_LINK_LIBRARIES can't have + # generator expressions on an object library(?) so we resort to taking + # care of this at configuration time. + if(TARGET "${library}") + get_target_property(is_component "${library}" IS_COMPONENT) + if(NOT is_component) + set_property(TARGET "${target}" APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${library}") + endif() + endif() + else() + # This is a file path to an out-of-tree library - this needs to be + # recorded so that the metalib can link them. (They aren't needed at + # all for the object libraries themselves, so they don't have to work + # transitively.) + set_property(TARGET "${target}" APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${library}") + endif() + endforeach() + +endfunction(target_link_libraries) + +# +# Function: add_component_library(target [SYMBOL building_symbol] [SOURCES]) +# +# Used very similarly to add_library. You can specify a symbol with SYMBOL, +# which works like CMake's own DEFINE_SYMBOL property: it's defined when +# building the library, but not when building something that links against the +# library. +# +# Note that this function gets to decide whether the component library is +# OBJECT or SHARED, and whether the library is installed or not. Also, as +# a rule, component libraries may only be linked by other component libraries +# in the same metalib - outside of the metalib, you must link the metalib +# itself. +# +function(add_component_library target_name) + set(sources) + unset(symbol) + + set(symbol_keyword OFF) + foreach(source ${ARGN}) + if(source STREQUAL "SYMBOL") + set(symbol_keyword ON) + elseif(symbol_keyword) + set(symbol_keyword OFF) + set(symbol "${source}") + else() + list(APPEND sources "${source}") + endif() + endforeach() + + + if(BUILD_METALIBS) + add_library("${target_name}" OBJECT ${sources}) + else() + add_library("${target_name}" ${sources}) + endif() + + set_target_properties("${target_name}" PROPERTIES IS_COMPONENT ON) + if(symbol) + # ... DEFINE_SYMBOL is apparently not respected for object libraries? + set_property(TARGET "${target_name}" APPEND PROPERTY COMPILE_DEFINITIONS "${symbol}") + endif() + if(BUILD_METALIBS) + # Apparently neither is CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE? + set_property(TARGET "${target_name}" PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}") + + # If we're building dynamic libraries, the object library needs to be -fPIC + if(BUILD_SHARED_LIBS) + set_property(TARGET "${target_name}" PROPERTY POSITION_INDEPENDENT_CODE ON) + endif() + endif() + +endfunction(add_component_library) + +# +# Function: add_metalib(target [source1 source2] [COMPONENTS component1 ...]) +# +# This is add_library, but for metalibs. +# +function(add_metalib target_name) + set(components_keyword OFF) + set(components) + set(sources) + foreach(arg ${ARGN}) + if(arg STREQUAL "COMPONENTS") + set(components_keyword ON) + elseif(components_keyword) + list(APPEND components "${arg}") + else() + list(APPEND sources "${arg}") + endif() + endforeach() + + set(defines) + set(includes) + set(libs) + foreach(component ${components}) + get_target_property(is_component "${component}" IS_COMPONENT) + if(NOT is_component) + message(FATAL_ERROR + "Attempted to metalink non-component ${component} into ${target_name}!") + endif() + + if(BUILD_METALIBS) + list(APPEND defines "$") + list(APPEND includes "$") + list(APPEND libs "$") + list(APPEND sources "$") + else() + list(APPEND libs "${component}") + endif() + endforeach() + + add_library("${target_name}" ${sources}) + target_compile_definitions("${target_name}" PRIVATE ${defines}) + target_link_libraries("${target_name}" ${libs}) + target_include_directories("${target_name}" PUBLIC ${includes}) + +endfunction(add_metalib) diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 9fe7a24c65..5d4f4ed088 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -16,8 +16,12 @@ add_subdirectory(src/interval) #add_subdirectory(src/motiontrail) add_subdirectory(src/showbase) +# TODO: p3direct needs a source file! +add_metalib(p3direct COMPONENTS p3dcparser p3deadrec p3distributed p3interval p3showbase) +set_property(TARGET p3direct PROPERTY LINKER_LANGUAGE "CXX") + if(HAVE_PYTHON) - add_python_module(direct p3dcparser p3deadrec p3distributed p3interval p3showbase IMPORT panda3d.core) + add_python_module(direct p3dcparser p3deadrec p3distributed p3interval p3showbase LINK p3direct IMPORT panda3d.core) # Make an __init__.py pointing at the source directory so users can run # Panda3D code straight from their build path: diff --git a/direct/src/dcparse/CMakeLists.txt b/direct/src/dcparse/CMakeLists.txt index ded4815f8f..f6182aeca1 100644 --- a/direct/src/dcparse/CMakeLists.txt +++ b/direct/src/dcparse/CMakeLists.txt @@ -1,4 +1,4 @@ add_executable(dcparse dcparse.cxx) target_compile_definitions(dcparse PUBLIC WITHIN_PANDA) -target_link_libraries(dcparse p3dcparser) +target_link_libraries(dcparse p3direct) install(TARGETS dcparse DESTINATION bin) diff --git a/direct/src/dcparser/CMakeLists.txt b/direct/src/dcparser/CMakeLists.txt index 318be281d4..a79992bdd5 100644 --- a/direct/src/dcparser/CMakeLists.txt +++ b/direct/src/dcparser/CMakeLists.txt @@ -46,7 +46,7 @@ set(P3DCPARSER_PARSER_SOURCES dcLexer.cxx) composite_sources(p3dcparser P3DCPARSER_SOURCES) -add_library(p3dcparser ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES} +add_component_library(p3dcparser ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES} ${P3DCPARSER_PARSER_SOURCES}) target_compile_definitions(p3dcparser PUBLIC WITHIN_PANDA) target_link_libraries(p3dcparser p3directbase panda) diff --git a/direct/src/deadrec/CMakeLists.txt b/direct/src/deadrec/CMakeLists.txt index 277f515e53..50813ca96e 100644 --- a/direct/src/deadrec/CMakeLists.txt +++ b/direct/src/deadrec/CMakeLists.txt @@ -6,8 +6,8 @@ set(P3DEADREC_SOURCES config_deadrec.cxx smoothMover.cxx) -add_library(p3deadrec ${P3DEADREC_HEADERS} ${P3DEADREC_SOURCES}) -set_target_properties(p3deadrec PROPERTIES DEFINE_SYMBOL BUILDING_DIRECT_DEADREC) +add_component_library(p3deadrec SYMBOL BUILDING_DIRECT_DEADREC + ${P3DEADREC_HEADERS} ${P3DEADREC_SOURCES}) target_link_libraries(p3deadrec p3directbase panda) target_interrogate(p3deadrec ALL) diff --git a/direct/src/directbase/CMakeLists.txt b/direct/src/directbase/CMakeLists.txt index 7db522fc65..4abea24c3e 100644 --- a/direct/src/directbase/CMakeLists.txt +++ b/direct/src/directbase/CMakeLists.txt @@ -8,7 +8,7 @@ set(P3DIRECTBASE_HEADERS # Not worth compositing sources, there's really only one. add_library(p3directbase ${P3DIRECTBASE_HEADERS} ${P3DIRECTBASE_SOURCES}) -target_link_libraries(p3directbase p3pandabase) +target_link_libraries(p3directbase panda) install(TARGETS p3directbase DESTINATION lib) install(FILES ${P3DIRECTBASE_HEADERS} DESTINATION include/panda3d) diff --git a/direct/src/distributed/CMakeLists.txt b/direct/src/distributed/CMakeLists.txt index 9e4168eb53..355548041a 100644 --- a/direct/src/distributed/CMakeLists.txt +++ b/direct/src/distributed/CMakeLists.txt @@ -11,8 +11,8 @@ if(HAVE_PYTHON) cConnectionRepository.cxx cDistributedSmoothNodeBase.cxx) - add_library(p3distributed ${P3DISTRIBUTED_HEADERS} ${P3DISTRIBUTED_SOURCES}) - set_target_properties(p3distributed PROPERTIES DEFINE_SYMBOL BUILDING_DIRECT_DISTRIBUTED) + add_component_library(p3distributed SYMBOL BUILDING_DIRECT_DISTRIBUTED + ${P3DISTRIBUTED_HEADERS} ${P3DISTRIBUTED_SOURCES}) target_compile_definitions(p3distributed PUBLIC WITHIN_PANDA) target_link_libraries(p3distributed p3directbase p3dcparser panda) target_use_packages(p3distributed PYTHON) diff --git a/direct/src/interval/CMakeLists.txt b/direct/src/interval/CMakeLists.txt index 5755508fe8..397617c1e8 100644 --- a/direct/src/interval/CMakeLists.txt +++ b/direct/src/interval/CMakeLists.txt @@ -36,8 +36,8 @@ set(P3INTERVAL_SOURCES waitInterval.cxx) composite_sources(p3interval P3INTERVAL_SOURCES) -add_library(p3interval ${P3INTERVAL_HEADERS} ${P3INTERVAL_SOURCES}) -set_target_properties(p3interval PROPERTIES DEFINE_SYMBOL BUILDING_DIRECT_INTERVAL) +add_component_library(p3interval SYMBOL BUILDING_DIRECT_INTERVAL + ${P3INTERVAL_HEADERS} ${P3INTERVAL_SOURCES}) target_link_libraries(p3interval p3directbase panda) target_interrogate(p3interval ALL) diff --git a/direct/src/showbase/CMakeLists.txt b/direct/src/showbase/CMakeLists.txt index c8ae524b96..9ca60be4ed 100644 --- a/direct/src/showbase/CMakeLists.txt +++ b/direct/src/showbase/CMakeLists.txt @@ -1,5 +1,5 @@ -add_library(p3showbase showBase.cxx showBase.h) -set_target_properties(p3showbase PROPERTIES DEFINE_SYMBOL BUILDING_DIRECT_SHOWBASE) +add_component_library(p3showbase SYMBOL BUILDING_DIRECT_SHOWBASE + showBase.cxx showBase.h) target_link_libraries(p3showbase p3directbase panda) target_interrogate(p3showbase ALL) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 3ce8d4347e..2551c0a55e 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -60,6 +60,11 @@ option(BUILD_SHARED_LIBS Utilities/tools/binaries/etc are then dynamically linked to the libraries instead of being statically linked." ON) +option(BUILD_METALIBS + "Should we build 'metalibs' -- fewer, larger libraries that contain the bulk +of the code instead of many smaller components. Note that turning this off +will still result in the 'metalibs' being built, but they will instead be many +smaller stub libraries and not 'meta' libraries." ON) # The character used to separate components of an OS-specific # directory name depends on the platform (it is '/' on Unix, '\' on diff --git a/panda/metalibs/panda/CMakeLists.txt b/panda/metalibs/panda/CMakeLists.txt index ad9651bca3..55383b0c24 100644 --- a/panda/metalibs/panda/CMakeLists.txt +++ b/panda/metalibs/panda/CMakeLists.txt @@ -19,8 +19,7 @@ if(LINK_IN_PHYSX) ) endif() -add_library(panda panda.cxx) +add_metalib(panda panda.cxx COMPONENTS ${PANDA_LINK_TARGETS}) set_target_properties(panda PROPERTIES DEFINE_SYMBOL BUILDING_LIBPANDA) -target_link_libraries(panda ${PANDA_LINK_TARGETS}) install(TARGETS panda DESTINATION lib) diff --git a/panda/metalibs/pandaegg/CMakeLists.txt b/panda/metalibs/pandaegg/CMakeLists.txt index 2aba69eb51..af185e5627 100644 --- a/panda/metalibs/pandaegg/CMakeLists.txt +++ b/panda/metalibs/pandaegg/CMakeLists.txt @@ -1,8 +1,7 @@ if(HAVE_EGG) set(PANDAEGG_LINK_TARGETS p3egg p3egg2pg) - add_library(pandaegg pandaegg.cxx) - target_link_libraries(pandaegg ${PANDAEGG_LINK_TARGETS}) + add_metalib(pandaegg pandaegg.cxx COMPONENTS ${PANDAEGG_LINK_TARGETS}) target_link_libraries(pandaegg panda) install(TARGETS pandaegg DESTINATION lib) diff --git a/panda/metalibs/pandagl/CMakeLists.txt b/panda/metalibs/pandagl/CMakeLists.txt index 3091551fc8..150b969856 100644 --- a/panda/metalibs/pandagl/CMakeLists.txt +++ b/panda/metalibs/pandagl/CMakeLists.txt @@ -24,8 +24,7 @@ if(HAVE_GL) set(PANDAGL_LINK_TARGETS ${PANDAGL_LINK_TARGETS} p3osxdisplay) endif() - add_library(pandagl pandagl.cxx) - target_link_libraries(pandagl ${PANDAGL_LINK_TARGETS}) + add_metalib(pandagl pandagl.cxx COMPONENTS ${PANDAGL_LINK_TARGETS}) set_target_properties(pandagl PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGL) install(TARGETS pandagl DESTINATION lib) diff --git a/panda/metalibs/pandaphysics/CMakeLists.txt b/panda/metalibs/pandaphysics/CMakeLists.txt index f48411820c..908b8ff48b 100644 --- a/panda/metalibs/pandaphysics/CMakeLists.txt +++ b/panda/metalibs/pandaphysics/CMakeLists.txt @@ -1,4 +1,3 @@ -add_library(pandaphysics pandaphysics.cxx) -target_link_libraries(pandaphysics p3physics p3particlesystem) +add_metalib(pandaphysics pandaphysics.cxx COMPONENTS p3physics p3particlesystem) install(TARGETS pandaphysics DESTINATION lib) diff --git a/panda/src/audio/CMakeLists.txt b/panda/src/audio/CMakeLists.txt index ca7f6d941b..c87dff6c76 100644 --- a/panda/src/audio/CMakeLists.txt +++ b/panda/src/audio/CMakeLists.txt @@ -18,8 +18,8 @@ if(HAVE_AUDIO) nullAudioSound.cxx) composite_sources(p3audio P3AUDIO_SOURCES) - add_library(p3audio ${P3AUDIO_HEADERS} ${P3AUDIO_SOURCES}) - set_target_properties(p3audio PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_AUDIO) + add_component_library(p3audio SYMBOL BUILDING_PANDA_AUDIO + ${P3AUDIO_HEADERS} ${P3AUDIO_SOURCES}) target_link_libraries(p3audio p3putil p3event p3movies p3linmath) target_interrogate(p3audio ALL) diff --git a/panda/src/chan/CMakeLists.txt b/panda/src/chan/CMakeLists.txt index add157fd3b..7d631a2f97 100644 --- a/panda/src/chan/CMakeLists.txt +++ b/panda/src/chan/CMakeLists.txt @@ -53,8 +53,8 @@ set(P3CHAN_SOURCES ) composite_sources(p3chan P3CHAN_SOURCES) -add_library(p3chan ${P3CHAN_HEADERS} ${P3CHAN_SOURCES}) -set_target_properties(p3chan PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_CHAN) +add_component_library(p3chan SYMBOL BUILDING_PANDA_CHAN + ${P3CHAN_HEADERS} ${P3CHAN_SOURCES}) target_link_libraries(p3chan p3pgraph) target_interrogate(p3chan ALL) diff --git a/panda/src/char/CMakeLists.txt b/panda/src/char/CMakeLists.txt index 752ddc2307..f6ca731bc2 100644 --- a/panda/src/char/CMakeLists.txt +++ b/panda/src/char/CMakeLists.txt @@ -19,8 +19,8 @@ set(P3CHAR_SOURCES ) composite_sources(p3char P3CHAR_SOURCES) -add_library(p3char ${P3CHAR_HEADERS} ${P3CHAR_SOURCES}) -set_target_properties(p3char PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_CHAR) +add_component_library(p3char SYMBOL BUILDING_PANDA_CHAR + ${P3CHAR_HEADERS} ${P3CHAR_SOURCES}) target_link_libraries(p3char p3chan) target_interrogate(p3char ALL) diff --git a/panda/src/collide/CMakeLists.txt b/panda/src/collide/CMakeLists.txt index 7308b23a8c..bd6f39c377 100644 --- a/panda/src/collide/CMakeLists.txt +++ b/panda/src/collide/CMakeLists.txt @@ -63,8 +63,8 @@ set(P3COLLIDE_SOURCES ) composite_sources(p3collide P3COLLIDE_SOURCES) -add_library(p3collide ${P3COLLIDE_HEADERS} ${P3COLLIDE_SOURCES}) -set_target_properties(p3collide PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_COLLIDE) +add_component_library(p3collide SYMBOL BUILDING_PANDA_COLLIDE + ${P3COLLIDE_HEADERS} ${P3COLLIDE_SOURCES}) target_link_libraries(p3collide p3tform) target_interrogate(p3collide ALL) diff --git a/panda/src/cull/CMakeLists.txt b/panda/src/cull/CMakeLists.txt index dc01cb1768..47b7a7ee47 100644 --- a/panda/src/cull/CMakeLists.txt +++ b/panda/src/cull/CMakeLists.txt @@ -21,8 +21,8 @@ set(P3CULL_SOURCES ) composite_sources(p3cull P3CULL_SOURCES) -add_library(p3cull ${P3CULL_HEADERS} ${P3CULL_SOURCES}) -set_target_properties(p3cull PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_CULL) +add_component_library(p3cull SYMBOL BUILDING_PANDA_CULL + ${P3CULL_HEADERS} ${P3CULL_SOURCES}) target_link_libraries(p3cull p3pgraph) target_interrogate(p3cull ALL) diff --git a/panda/src/device/CMakeLists.txt b/panda/src/device/CMakeLists.txt index 73cf7a5712..6de38bcc43 100644 --- a/panda/src/device/CMakeLists.txt +++ b/panda/src/device/CMakeLists.txt @@ -27,8 +27,8 @@ set(P3DEVICE_SOURCES ) composite_sources(p3device P3DEVICE_SOURCES) -add_library(p3device ${P3DEVICE_HEADERS} ${P3DEVICE_SOURCES}) -set_target_properties(p3device PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_DEVICE) +add_component_library(p3device SYMBOL BUILDING_PANDA_DEVICE + ${P3DEVICE_HEADERS} ${P3DEVICE_SOURCES}) target_link_libraries(p3device p3dgraph p3display) target_interrogate(p3device ALL) diff --git a/panda/src/dgraph/CMakeLists.txt b/panda/src/dgraph/CMakeLists.txt index a1eaeb484f..53ff1cf381 100644 --- a/panda/src/dgraph/CMakeLists.txt +++ b/panda/src/dgraph/CMakeLists.txt @@ -12,8 +12,8 @@ set(P3DGRAPH_SOURCES ) composite_sources(p3dgraph P3DGRAPH_SOURCES) -add_library(p3dgraph ${P3DGRAPH_HEADERS} ${P3DGRAPH_SOURCES}) -set_target_properties(p3dgraph PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_DGRAPH) +add_component_library(p3dgraph SYMBOL BUILDING_PANDA_DGRAPH + ${P3DGRAPH_HEADERS} ${P3DGRAPH_SOURCES}) target_link_libraries(p3dgraph p3pgraph) target_interrogate(p3dgraph ALL) diff --git a/panda/src/display/CMakeLists.txt b/panda/src/display/CMakeLists.txt index 3bb1c5d795..38e764b3d1 100644 --- a/panda/src/display/CMakeLists.txt +++ b/panda/src/display/CMakeLists.txt @@ -87,8 +87,8 @@ if(APPLE) endif() composite_sources(p3display P3DISPLAY_SOURCES) -add_library(p3display ${P3DISPLAY_HEADERS} ${P3DISPLAY_SOURCES}) -set_target_properties(p3display PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_DISPLAY) +add_component_library(p3display SYMBOL BUILDING_PANDA_DISPLAY + ${P3DISPLAY_HEADERS} ${P3DISPLAY_SOURCES}) target_link_libraries(p3display p3cull p3pgraphnodes) target_interrogate(p3display ALL EXTENSIONS ${P3DISPLAY_IGATEEXT}) diff --git a/panda/src/downloader/CMakeLists.txt b/panda/src/downloader/CMakeLists.txt index 63ac5da787..1460eec6fd 100644 --- a/panda/src/downloader/CMakeLists.txt +++ b/panda/src/downloader/CMakeLists.txt @@ -68,8 +68,8 @@ set(P3DOWNLOADER_IGATEEXT ) composite_sources(p3downloader P3DOWNLOADER_SOURCES) -add_library(p3downloader ${P3DOWNLOADER_HEADERS} ${P3DOWNLOADER_SOURCES}) -set_target_properties(p3downloader PROPERTIES DEFINE_SYMBOL BUILDING_PANDAEXPRESS) +add_component_library(p3downloader SYMBOL BUILDING_PANDAEXPRESS + ${P3DOWNLOADER_HEADERS} ${P3DOWNLOADER_SOURCES}) target_link_libraries(p3downloader p3express p3pipeline) target_interrogate(p3downloader ALL EXTENSIONS ${P3DOWNLOADER_IGATEEXT}) diff --git a/panda/src/dxml/CMakeLists.txt b/panda/src/dxml/CMakeLists.txt index 8da15454d7..9268eb0051 100644 --- a/panda/src/dxml/CMakeLists.txt +++ b/panda/src/dxml/CMakeLists.txt @@ -12,8 +12,8 @@ set(P3DXML_SOURCES composite_sources(p3dxml P3DXML_SOURCES) add_definitions(-DTIXML_USE_STL) -add_library(p3dxml ${P3DXML_HEADERS} ${P3DXML_SOURCES}) -set_target_properties(p3dxml PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_DXML) +add_component_library(p3dxml SYMBOL BUILDING_PANDA_DXML + ${P3DXML_HEADERS} ${P3DXML_SOURCES}) target_link_libraries(p3dxml p3express) target_interrogate(p3dxml ALL) diff --git a/panda/src/egg/CMakeLists.txt b/panda/src/egg/CMakeLists.txt index 15783ed7f0..829b5804b2 100644 --- a/panda/src/egg/CMakeLists.txt +++ b/panda/src/egg/CMakeLists.txt @@ -99,8 +99,8 @@ if(HAVE_EGG) lexer.cxx) composite_sources(p3egg P3EGG_SOURCES) - add_library(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES} ${P3EGG_PARSER_SOURCES}) - set_target_properties(p3egg PROPERTIES DEFINE_SYMBOL BUILDING_PANDAEGG) + add_component_library(p3egg SYMBOL BUILDING_PANDAEGG + ${P3EGG_HEADERS} ${P3EGG_SOURCES} ${P3EGG_PARSER_SOURCES}) target_link_libraries(p3egg panda) target_interrogate(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES} EXTENSIONS ${P3EGG_IGATEEXT}) diff --git a/panda/src/egg2pg/CMakeLists.txt b/panda/src/egg2pg/CMakeLists.txt index 1bed8e5a3d..5eb9e1dbaa 100644 --- a/panda/src/egg2pg/CMakeLists.txt +++ b/panda/src/egg2pg/CMakeLists.txt @@ -30,8 +30,8 @@ if(HAVE_EGG) ) composite_sources(p3egg2pg P3EGG2PG_SOURCES) - add_library(p3egg2pg ${P3EGG2PG_HEADERS} ${P3EGG2PG_SOURCES}) - set_target_properties(p3egg2pg PROPERTIES DEFINE_SYMBOL BUILDING_PANDAEGG) + add_component_library(p3egg2pg SYMBOL BUILDING_PANDAEGG + ${P3EGG2PG_HEADERS} ${P3EGG2PG_SOURCES}) target_link_libraries(p3egg2pg panda p3egg) target_interrogate(p3egg2pg ALL) diff --git a/panda/src/event/CMakeLists.txt b/panda/src/event/CMakeLists.txt index 3857ceb704..2aee7f4251 100644 --- a/panda/src/event/CMakeLists.txt +++ b/panda/src/event/CMakeLists.txt @@ -45,8 +45,8 @@ set(P3EVENT_IGATEEXT ) composite_sources(p3event P3EVENT_SOURCES) -add_library(p3event ${P3EVENT_HEADERS} ${P3EVENT_SOURCES}) -set_target_properties(p3event PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_EVENT) +add_component_library(p3event SYMBOL BUILDING_PANDA_EVENT + ${P3EVENT_HEADERS} ${P3EVENT_SOURCES}) target_link_libraries(p3event p3linmath p3pstatclient) target_interrogate(p3event ALL EXTENSIONS ${P3EVENT_IGATEEXT}) diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index 2319c79c81..bd009eb923 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -144,8 +144,8 @@ set(P3EXPRESS_IGATEEXT composite_sources(p3express P3EXPRESS_SOURCES) -add_library(p3express ${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS}) -set_target_properties(p3express PROPERTIES DEFINE_SYMBOL BUILDING_PANDAEXPRESS) +add_component_library(p3express SYMBOL BUILDING_PANDAEXPRESS + ${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS}) # p3express needs to include from p3interrogatedb for py_panda.h and extension.h target_include_directories(p3express PUBLIC diff --git a/panda/src/framework/CMakeLists.txt b/panda/src/framework/CMakeLists.txt index 5f6d48f1da..ecf24a531c 100644 --- a/panda/src/framework/CMakeLists.txt +++ b/panda/src/framework/CMakeLists.txt @@ -46,6 +46,7 @@ if(NOT BUILD_SHARED_LIBS) endif() composite_sources(p3framework P3FRAMEWORK_SOURCES) +# This one isn't a component library add_library(p3framework ${P3FRAMEWORK_HEADERS} ${P3FRAMEWORK_SOURCES}) set_target_properties(p3framework PROPERTIES DEFINE_SYMBOL BUILDING_FRAMEWORK) target_link_libraries(p3framework ${P3FRAMEWORK_LINK_TARGETS}) diff --git a/panda/src/glgsg/CMakeLists.txt b/panda/src/glgsg/CMakeLists.txt index f05d8d4de7..d7a9763b9c 100644 --- a/panda/src/glgsg/CMakeLists.txt +++ b/panda/src/glgsg/CMakeLists.txt @@ -9,8 +9,8 @@ if(HAVE_GL) ) composite_sources(p3glgsg P3GLGSG_SOURCES) - add_library(p3glgsg ${P3GLGSG_HEADERS} ${P3GLGSG_SOURCES}) - set_target_properties(p3glgsg PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGL) + add_component_library(p3glgsg SYMBOL BUILDING_PANDAGL + ${P3GLGSG_HEADERS} ${P3GLGSG_SOURCES}) target_link_libraries(p3glgsg p3glstuff panda ${OPENGL_LIBRARIES}) target_use_packages(p3glgsg CG) diff --git a/panda/src/glstuff/CMakeLists.txt b/panda/src/glstuff/CMakeLists.txt index 6326195a0e..3919f79fd3 100644 --- a/panda/src/glstuff/CMakeLists.txt +++ b/panda/src/glstuff/CMakeLists.txt @@ -31,8 +31,8 @@ if(HAVE_GL) ) composite_sources(p3glstuff P3GLSTUFF_SOURCES) - add_library(p3glstuff ${P3GLSTUFF_HEADERS} ${P3GLSTUFF_SOURCES}) - target_link_libraries(p3glstuff p3pandabase p3gobj) + add_component_library(p3glstuff ${P3GLSTUFF_HEADERS} ${P3GLSTUFF_SOURCES}) + target_link_libraries(p3glstuff panda) install(TARGETS p3glstuff DESTINATION lib) install(FILES ${P3GLSTUFF_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/glxdisplay/CMakeLists.txt b/panda/src/glxdisplay/CMakeLists.txt index 3525402f91..473d20b2e8 100644 --- a/panda/src/glxdisplay/CMakeLists.txt +++ b/panda/src/glxdisplay/CMakeLists.txt @@ -21,8 +21,8 @@ if(HAVE_GLX) ) composite_sources(p3glxdisplay P3GLXDISPLAY_SOURCES) - add_library(p3glxdisplay ${P3GLXDISPLAY_HEADERS} ${P3GLXDISPLAY_SOURCES}) - set_target_properties(p3glxdisplay PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGL) + add_component_library(p3glxdisplay SYMBOL BUILDING_PANDAGL + ${P3GLXDISPLAY_HEADERS} ${P3GLXDISPLAY_SOURCES}) target_link_libraries(p3glxdisplay p3glgsg p3x11display) install(TARGETS p3glxdisplay DESTINATION lib) diff --git a/panda/src/gobj/CMakeLists.txt b/panda/src/gobj/CMakeLists.txt index 5f6a6749c5..c53aa602c4 100644 --- a/panda/src/gobj/CMakeLists.txt +++ b/panda/src/gobj/CMakeLists.txt @@ -168,8 +168,8 @@ set(P3GOBJ_IGATEEXT ) composite_sources(p3gobj P3GOBJ_SOURCES) -add_library(p3gobj ${P3GOBJ_HEADERS} ${P3GOBJ_SOURCES}) -set_target_properties(p3gobj PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_GOBJ) +add_component_library(p3gobj SYMBOL BUILDING_PANDA_GOBJ + ${P3GOBJ_HEADERS} ${P3GOBJ_SOURCES}) target_link_libraries(p3gobj p3gsgbase p3pnmimage) target_use_packages(p3gobj ZLIB SQUISH CG) target_interrogate(p3gobj ALL EXTENSIONS ${P3GOBJ_IGATEEXT}) diff --git a/panda/src/grutil/CMakeLists.txt b/panda/src/grutil/CMakeLists.txt index 17cf54ca5c..7dc1c7fb00 100644 --- a/panda/src/grutil/CMakeLists.txt +++ b/panda/src/grutil/CMakeLists.txt @@ -38,8 +38,8 @@ set(P3GRUTIL_SOURCES ) composite_sources(p3grutil P3GRUTIL_SOURCES) -add_library(p3grutil ${P3GRUTIL_HEADERS} ${P3GRUTIL_SOURCES}) -set_target_properties(p3grutil PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_GRUTIL) +add_component_library(p3grutil SYMBOL BUILDING_PANDA_GRUTIL + ${P3GRUTIL_HEADERS} ${P3GRUTIL_SOURCES}) target_link_libraries(p3grutil p3display p3text p3movies) if(HAVE_AUDIO) target_link_libraries(p3grutil p3audio) diff --git a/panda/src/gsgbase/CMakeLists.txt b/panda/src/gsgbase/CMakeLists.txt index 97e492c4ca..cb891fef98 100644 --- a/panda/src/gsgbase/CMakeLists.txt +++ b/panda/src/gsgbase/CMakeLists.txt @@ -11,8 +11,8 @@ set(P3GSGBASE_SOURCES ) composite_sources(p3gsgbase P3GSGBASE_SOURCES) -add_library(p3gsgbase ${P3GSGBASE_HEADERS} ${P3GSGBASE_SOURCES}) -set_target_properties(p3gsgbase PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_GSGBASE) +add_component_library(p3gsgbase SYMBOL BUILDING_PANDA_GSGBASE + ${P3GSGBASE_HEADERS} ${P3GSGBASE_SOURCES}) target_link_libraries(p3gsgbase p3putil p3linmath) target_interrogate(p3gsgbase ALL) diff --git a/panda/src/linmath/CMakeLists.txt b/panda/src/linmath/CMakeLists.txt index b2211657ca..922c94537b 100644 --- a/panda/src/linmath/CMakeLists.txt +++ b/panda/src/linmath/CMakeLists.txt @@ -44,8 +44,8 @@ set(P3LINMATH_SOURCES ) composite_sources(p3linmath P3LINMATH_SOURCES) -add_library(p3linmath ${P3LINMATH_HEADERS} ${P3LINMATH_SOURCES}) -set_target_properties(p3linmath PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_LINMATH) +add_component_library(p3linmath SYMBOL BUILDING_PANDA_LINMATH + ${P3LINMATH_HEADERS} ${P3LINMATH_SOURCES}) target_link_libraries(p3linmath p3express p3pandabase) target_use_packages(p3linmath EIGEN) target_interrogate(p3linmath ALL) diff --git a/panda/src/mathutil/CMakeLists.txt b/panda/src/mathutil/CMakeLists.txt index 90fcd5fccd..2cf5568af3 100644 --- a/panda/src/mathutil/CMakeLists.txt +++ b/panda/src/mathutil/CMakeLists.txt @@ -61,8 +61,8 @@ set(P3MATHUTIL_SOURCES ) composite_sources(p3mathutil P3MATHUTIL_SOURCES) -add_library(p3mathutil ${P3MATHUTIL_HEADERS} ${P3MATHUTIL_SOURCES}) -set_target_properties(p3mathutil PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_MATHUTIL) +add_component_library(p3mathutil SYMBOL BUILDING_PANDA_MATHUTIL + ${P3MATHUTIL_HEADERS} ${P3MATHUTIL_SOURCES}) target_link_libraries(p3mathutil p3event) target_use_packages(p3mathutil FFTW) target_interrogate(p3mathutil ALL) diff --git a/panda/src/movies/CMakeLists.txt b/panda/src/movies/CMakeLists.txt index e5dabb63a8..d1030f40f5 100644 --- a/panda/src/movies/CMakeLists.txt +++ b/panda/src/movies/CMakeLists.txt @@ -42,8 +42,8 @@ set(P3MOVIES_SOURCES wavAudioCursor.cxx) composite_sources(p3movies P3MOVIES_SOURCES) -add_library(p3movies ${P3MOVIES_HEADERS} ${P3MOVIES_SOURCES}) -set_target_properties(p3movies PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_MOVIES) +add_component_library(p3movies SYMBOL BUILDING_PANDA_MOVIES + ${P3MOVIES_HEADERS} ${P3MOVIES_SOURCES}) target_link_libraries(p3movies p3pandabase p3express p3pstatclient p3gobj p3dconfig p3prc) target_interrogate(p3movies ALL) diff --git a/panda/src/nativenet/CMakeLists.txt b/panda/src/nativenet/CMakeLists.txt index 8c3a1b4b1f..4323082e87 100644 --- a/panda/src/nativenet/CMakeLists.txt +++ b/panda/src/nativenet/CMakeLists.txt @@ -25,8 +25,8 @@ if(WANT_NATIVE_NET) socket_udp_outgoing.cxx) composite_sources(p3nativenet P3NATIVENET_SOURCES) - add_library(p3nativenet ${P3NATIVENET_HEADERS} ${P3NATIVENET_SOURCES}) - set_target_properties(p3nativenet PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_NATIVENET) + add_component_library(p3nativenet SYMBOL BUILDING_PANDA_NATIVENET + ${P3NATIVENET_HEADERS} ${P3NATIVENET_SOURCES}) target_link_libraries(p3nativenet p3express p3pandabase p3downloader) target_interrogate(p3nativenet ALL) diff --git a/panda/src/net/CMakeLists.txt b/panda/src/net/CMakeLists.txt index 9a2eca80c9..3f4dba403c 100644 --- a/panda/src/net/CMakeLists.txt +++ b/panda/src/net/CMakeLists.txt @@ -26,8 +26,8 @@ if(HAVE_NET AND WANT_NATIVE_NET) recentConnectionReader.cxx) composite_sources(p3net P3NET_SOURCES) - add_library(p3net ${P3NET_HEADERS} ${P3NET_SOURCES}) - set_target_properties(p3net PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_NET) + add_component_library(p3net SYMBOL BUILDING_PANDA_NET + ${P3NET_HEADERS} ${P3NET_SOURCES}) target_link_libraries(p3net p3express p3downloader p3pandabase p3nativenet p3pipeline) target_interrogate(p3net ALL) diff --git a/panda/src/pandabase/CMakeLists.txt b/panda/src/pandabase/CMakeLists.txt index 89eb1483ec..97261c5f4f 100644 --- a/panda/src/pandabase/CMakeLists.txt +++ b/panda/src/pandabase/CMakeLists.txt @@ -6,7 +6,7 @@ set(P3PANDABASE_SOURCES pandabase.cxx ) -add_library(p3pandabase ${P3PANDABASE_HEADERS} ${P3PANDABASE_SOURCES}) +add_component_library(p3pandabase ${P3PANDABASE_HEADERS} ${P3PANDABASE_SOURCES}) target_link_libraries(p3pandabase p3dtoolbase) install(TARGETS p3pandabase DESTINATION lib) diff --git a/panda/src/parametrics/CMakeLists.txt b/panda/src/parametrics/CMakeLists.txt index 6b5e9a0337..b75334e34e 100644 --- a/panda/src/parametrics/CMakeLists.txt +++ b/panda/src/parametrics/CMakeLists.txt @@ -34,8 +34,8 @@ set(P3PARAMETRICS_SOURCES ) composite_sources(p3parametrics P3PARAMETRICS_SOURCES) -add_library(p3parametrics ${P3PARAMETRICS_HEADERS} ${P3PARAMETRICS_SOURCES}) -set_target_properties(p3parametrics PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_PARAMETRICS) +add_component_library(p3parametrics SYMBOL BUILDING_PANDA_PARAMETRICS + ${P3PARAMETRICS_HEADERS} ${P3PARAMETRICS_SOURCES}) target_link_libraries(p3parametrics p3pgraph) target_interrogate(p3parametrics ALL) diff --git a/panda/src/particlesystem/CMakeLists.txt b/panda/src/particlesystem/CMakeLists.txt index 0ff8e31a72..21334a8606 100644 --- a/panda/src/particlesystem/CMakeLists.txt +++ b/panda/src/particlesystem/CMakeLists.txt @@ -38,8 +38,8 @@ set(P3PARTICLESYSTEM_SOURCES composite_sources(p3particlesystem P3PARTICLESYSTEM_SOURCES) -add_library(p3particlesystem ${P3PARTICLESYSTEM_HEADERS} ${P3PARTICLESYSTEM_SOURCES}) -set_target_properties(p3particlesystem PROPERTIES DEFINE_SYMBOL BUILDING_PANDAPHYSICS) +add_component_library(p3particlesystem SYMBOL BUILDING_PANDAPHYSICS + ${P3PARTICLESYSTEM_HEADERS} ${P3PARTICLESYSTEM_SOURCES}) target_link_libraries(p3particlesystem p3physics panda) target_interrogate(p3particlesystem ALL) diff --git a/panda/src/pgraph/CMakeLists.txt b/panda/src/pgraph/CMakeLists.txt index a6830270ea..9052f6e299 100644 --- a/panda/src/pgraph/CMakeLists.txt +++ b/panda/src/pgraph/CMakeLists.txt @@ -217,8 +217,8 @@ set(P3PGRAPH_IGATEEXT ) composite_sources(p3pgraph P3PGRAPH_SOURCES) -add_library(p3pgraph ${P3PGRAPH_HEADERS} ${P3PGRAPH_SOURCES}) -set_target_properties(p3pgraph PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_PGRAPH) +add_component_library(p3pgraph SYMBOL BUILDING_PANDA_PGRAPH + ${P3PGRAPH_HEADERS} ${P3PGRAPH_SOURCES}) target_link_libraries(p3pgraph p3gobj p3event p3gsgbase p3putil p3linmath p3downloader) target_interrogate(p3pgraph ALL EXTENSIONS ${P3PGRAPH_IGATEEXT}) diff --git a/panda/src/pgraphnodes/CMakeLists.txt b/panda/src/pgraphnodes/CMakeLists.txt index f33280dffe..749a835051 100644 --- a/panda/src/pgraphnodes/CMakeLists.txt +++ b/panda/src/pgraphnodes/CMakeLists.txt @@ -45,8 +45,8 @@ set(P3PGRAPHNODES_SOURCES ) composite_sources(p3pgraphnodes P3PGRAPHNODES_SOURCES) -add_library(p3pgraphnodes ${P3PGRAPHNODES_HEADERS} ${P3PGRAPHNODES_SOURCES}) -set_target_properties(p3pgraphnodes PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_PGRAPHNODES) +add_component_library(p3pgraphnodes SYMBOL BUILDING_PANDA_PGRAPHNODES + ${P3PGRAPHNODES_HEADERS} ${P3PGRAPHNODES_SOURCES}) target_link_libraries(p3pgraphnodes p3pgraph) target_interrogate(p3pgraphnodes ALL) diff --git a/panda/src/pgui/CMakeLists.txt b/panda/src/pgui/CMakeLists.txt index 129536eaa9..16ced60a74 100644 --- a/panda/src/pgui/CMakeLists.txt +++ b/panda/src/pgui/CMakeLists.txt @@ -40,8 +40,8 @@ set(P3PGUI_SOURCES ) composite_sources(p3pgui P3PGUI_SOURCES) -add_library(p3pgui ${P3PGUI_HEADERS} ${P3PGUI_SOURCES}) -set_target_properties(p3pgui PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_PGUI) +add_component_library(p3pgui SYMBOL BUILDING_PANDA_PGUI + ${P3PGUI_HEADERS} ${P3PGUI_SOURCES}) target_link_libraries(p3pgui p3tform) target_interrogate(p3pgui ALL) diff --git a/panda/src/physics/CMakeLists.txt b/panda/src/physics/CMakeLists.txt index 9a9e3b5e66..cd9ced9c74 100644 --- a/panda/src/physics/CMakeLists.txt +++ b/panda/src/physics/CMakeLists.txt @@ -36,8 +36,8 @@ set(P3PHYSICS_SOURCES physicsObjectCollection.cxx) composite_sources(p3physics P3PHYSICS_SOURCES) -add_library(p3physics ${P3PHYSICS_HEADERS} ${P3PHYSICS_SOURCES}) -set_target_properties(p3physics PROPERTIES DEFINE_SYMBOL BUILDING_PANDAPHYSICS) +add_component_library(p3physics SYMBOL BUILDING_PANDAPHYSICS + ${P3PHYSICS_HEADERS} ${P3PHYSICS_SOURCES}) target_link_libraries(p3physics panda) target_interrogate(p3physics ALL) diff --git a/panda/src/pipeline/CMakeLists.txt b/panda/src/pipeline/CMakeLists.txt index a36f01dc1e..4040c58a19 100644 --- a/panda/src/pipeline/CMakeLists.txt +++ b/panda/src/pipeline/CMakeLists.txt @@ -128,8 +128,8 @@ set(P3PIPELINE_IGATEEXT ) composite_sources(p3pipeline P3PIPELINE_SOURCES) -add_library(p3pipeline ${P3PIPELINE_HEADERS} ${P3PIPELINE_SOURCES}) -set_target_properties(p3pipeline PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_PIPELINE) +add_component_library(p3pipeline SYMBOL BUILDING_PANDA_PIPELINE + ${P3PIPELINE_HEADERS} ${P3PIPELINE_SOURCES}) target_link_libraries(p3pipeline p3express) target_interrogate(p3pipeline ALL EXTENSIONS ${P3PIPELINE_IGATEEXT}) diff --git a/panda/src/pnmimage/CMakeLists.txt b/panda/src/pnmimage/CMakeLists.txt index 2865296c74..857ad79050 100644 --- a/panda/src/pnmimage/CMakeLists.txt +++ b/panda/src/pnmimage/CMakeLists.txt @@ -35,8 +35,8 @@ if(HAVE_SSE2) endif() composite_sources(p3pnmimage P3PNMIMAGE_SOURCES) -add_library(p3pnmimage ${P3PNMIMAGE_HEADERS} ${P3PNMIMAGE_SOURCES} convert_srgb_sse2.cxx) -set_target_properties(p3pnmimage PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_PNMIMAGE) +add_component_library(p3pnmimage SYMBOL BUILDING_PANDA_PNMIMAGE + ${P3PNMIMAGE_HEADERS} ${P3PNMIMAGE_SOURCES} convert_srgb_sse2.cxx) target_link_libraries(p3pnmimage p3mathutil) target_interrogate(p3pnmimage ALL EXTENSIONS ${P3PNMIMAGE_IGATEEXT}) diff --git a/panda/src/pnmimagetypes/CMakeLists.txt b/panda/src/pnmimagetypes/CMakeLists.txt index 21e4f98285..c9236befaa 100644 --- a/panda/src/pnmimagetypes/CMakeLists.txt +++ b/panda/src/pnmimagetypes/CMakeLists.txt @@ -31,8 +31,8 @@ set(P3PNMIMAGETYPES_SOURCES ) composite_sources(p3pnmimagetypes P3PNMIMAGETYPES_SOURCES) -add_library(p3pnmimagetypes ${P3PNMIMAGETYPES_HEADERS} ${P3PNMIMAGETYPES_SOURCES}) -set_target_properties(p3pnmimagetypes PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_PNMIMAGETYPES) +add_component_library(p3pnmimagetypes SYMBOL BUILDING_PANDA_PNMIMAGETYPES + ${P3PNMIMAGETYPES_HEADERS} ${P3PNMIMAGETYPES_SOURCES}) target_link_libraries(p3pnmimagetypes p3pnmimage) target_use_packages(p3pnmimagetypes JPEG TIFF PNG) diff --git a/panda/src/pnmtext/CMakeLists.txt b/panda/src/pnmtext/CMakeLists.txt index 3256654fd8..67713ae318 100644 --- a/panda/src/pnmtext/CMakeLists.txt +++ b/panda/src/pnmtext/CMakeLists.txt @@ -15,8 +15,8 @@ if(HAVE_FREETYPE) ) composite_sources(p3pnmtext P3PNMTEXT_SOURCES) - add_library(p3pnmtext ${P3PNMTEXT_HEADERS} ${P3PNMTEXT_SOURCES}) - set_target_properties(p3pnmtext PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_PNMTEXT) + add_component_library(p3pnmtext SYMBOL BUILDING_PANDA_PNMTEXT + ${P3PNMTEXT_HEADERS} ${P3PNMTEXT_SOURCES}) target_link_libraries(p3pnmtext p3parametrics p3pnmimage) target_use_packages(p3pnmtext FREETYPE) target_interrogate(p3pnmtext ALL) diff --git a/panda/src/pstatclient/CMakeLists.txt b/panda/src/pstatclient/CMakeLists.txt index 82572d3def..c14ad4e21d 100644 --- a/panda/src/pstatclient/CMakeLists.txt +++ b/panda/src/pstatclient/CMakeLists.txt @@ -21,8 +21,8 @@ set(P3PSTATCLIENT_SOURCES pStatThread.cxx) composite_sources(p3pstatclient P3PSTATCLIENT_SOURCES) -add_library(p3pstatclient ${P3PSTATCLIENT_HEADERS} ${P3PSTATCLIENT_SOURCES}) -set_target_properties(p3pstatclient PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_PSTATCLIENT) +add_component_library(p3pstatclient SYMBOL BUILDING_PANDA_PSTATCLIENT + ${P3PSTATCLIENT_HEADERS} ${P3PSTATCLIENT_SOURCES}) target_link_libraries(p3pstatclient p3net p3putil p3express) target_interrogate(p3pstatclient ALL) diff --git a/panda/src/putil/CMakeLists.txt b/panda/src/putil/CMakeLists.txt index f6071a41f7..38cf0b8530 100644 --- a/panda/src/putil/CMakeLists.txt +++ b/panda/src/putil/CMakeLists.txt @@ -124,8 +124,8 @@ set(P3PUTIL_IGATEEXT ) composite_sources(p3putil P3PUTIL_SOURCES) -add_library(p3putil ${P3PUTIL_HEADERS} ${P3PUTIL_SOURCES}) -set_target_properties(p3putil PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_PUTIL) +add_component_library(p3putil SYMBOL BUILDING_PANDA_PUTIL + ${P3PUTIL_HEADERS} ${P3PUTIL_SOURCES}) target_link_libraries(p3putil p3linmath p3pipeline) target_interrogate(p3putil ALL EXTENSIONS ${P3PUTIL_IGATEEXT}) diff --git a/panda/src/recorder/CMakeLists.txt b/panda/src/recorder/CMakeLists.txt index 1409685ab7..f7ef34ac70 100644 --- a/panda/src/recorder/CMakeLists.txt +++ b/panda/src/recorder/CMakeLists.txt @@ -17,8 +17,8 @@ set(P3RECORDER_SOURCES ) composite_sources(p3recorder P3RECORDER_SOURCES) -add_library(p3recorder ${P3RECORDER_HEADERS} ${P3RECORDER_SOURCES}) -set_target_properties(p3recorder PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_RECORDER) +add_component_library(p3recorder SYMBOL BUILDING_PANDA_RECORDER + ${P3RECORDER_HEADERS} ${P3RECORDER_SOURCES}) target_link_libraries(p3recorder p3dgraph p3downloader) target_interrogate(p3recorder ALL) diff --git a/panda/src/text/CMakeLists.txt b/panda/src/text/CMakeLists.txt index 0f3ded3729..37bceb02a4 100644 --- a/panda/src/text/CMakeLists.txt +++ b/panda/src/text/CMakeLists.txt @@ -33,8 +33,8 @@ set(P3TEXT_SOURCES ) composite_sources(p3text P3TEXT_SOURCES) -add_library(p3text ${P3TEXT_HEADERS} ${P3TEXT_SOURCES}) -set_target_properties(p3text PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_TEXT) +add_component_library(p3text SYMBOL BUILDING_PANDA_TEXT + ${P3TEXT_HEADERS} ${P3TEXT_SOURCES}) target_link_libraries(p3text p3parametrics) if(HAVE_FREETYPE) target_link_libraries(p3text p3pnmtext) diff --git a/panda/src/tform/CMakeLists.txt b/panda/src/tform/CMakeLists.txt index bb20b821ed..971848d0d2 100644 --- a/panda/src/tform/CMakeLists.txt +++ b/panda/src/tform/CMakeLists.txt @@ -27,8 +27,8 @@ set(P3TFORM_SOURCES ) composite_sources(p3tform P3TFORM_SOURCES) -add_library(p3tform ${P3TFORM_HEADERS} ${P3TFORM_SOURCES}) -set_target_properties(p3tform PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_TFORM) +add_component_library(p3tform SYMBOL BUILDING_PANDA_TFORM + ${P3TFORM_HEADERS} ${P3TFORM_SOURCES}) target_link_libraries(p3tform p3device p3grutil) target_interrogate(p3tform ALL)