From 9ecaa0056b590d6489829e1cd8b94ffd403f8273 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 15 Oct 2019 23:27:03 -0600 Subject: [PATCH] CMake: Break out p3interrogatedb as a first-class library --- dtool/metalibs/dtoolconfig/CMakeLists.txt | 2 +- dtool/src/interrogate/CMakeLists.txt | 4 ++-- dtool/src/interrogatedb/CMakeLists.txt | 21 ++++++++++----------- panda/src/express/CMakeLists.txt | 2 +- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/dtool/metalibs/dtoolconfig/CMakeLists.txt b/dtool/metalibs/dtoolconfig/CMakeLists.txt index 3d36dcf39e..d77b5fd105 100644 --- a/dtool/metalibs/dtoolconfig/CMakeLists.txt +++ b/dtool/metalibs/dtoolconfig/CMakeLists.txt @@ -1,4 +1,4 @@ -set(DTOOLCONFIG_LINK_TARGETS p3prc p3interrogatedb) +set(DTOOLCONFIG_LINK_TARGETS p3prc) set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "CoreDevel") add_metalib(p3dtoolconfig INIT init_libdtoolconfig dtoolconfig.h COMPONENTS ${DTOOLCONFIG_LINK_TARGETS}) unset(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME) diff --git a/dtool/src/interrogate/CMakeLists.txt b/dtool/src/interrogate/CMakeLists.txt index a4a70774d7..7959a81cc9 100644 --- a/dtool/src/interrogate/CMakeLists.txt +++ b/dtool/src/interrogate/CMakeLists.txt @@ -60,7 +60,7 @@ set(INTERROGATE_PREAMBLE_PYTHON_NATIVE composite_sources(interrogate INTERROGATE_SOURCES) add_executable(interrogate ${INTERROGATE_HEADERS} ${INTERROGATE_SOURCES}) -target_link_libraries(interrogate p3cppParser p3dtoolconfig +target_link_libraries(interrogate p3cppParser p3interrogatedb PKG::OPENSSL) # Python preamble for interrogate_module @@ -76,7 +76,7 @@ add_custom_command( add_executable(interrogate_module interrogate_module.cxx ${CMAKE_CURRENT_BINARY_DIR}/interrogate_preamble_python_native.cxx) -target_link_libraries(interrogate_module p3cppParser p3dtoolconfig +target_link_libraries(interrogate_module p3cppParser p3interrogatedb PKG::OPENSSL) if(NOT CMAKE_CROSSCOMPILING) diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index 947bb93cc9..acd55c72c3 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -34,18 +34,17 @@ set(P3IGATERUNTIME_HEADERS ) composite_sources(p3interrogatedb P3INTERROGATEDB_SOURCES) -add_component_library(p3interrogatedb NOINIT SYMBOL BUILDING_INTERROGATEDB +add_library(p3interrogatedb ${P3INTERROGATEDB_HEADERS} ${P3INTERROGATEDB_SOURCES}) -target_link_libraries(p3interrogatedb p3prc p3dconfig p3dtool) +set_target_properties(p3interrogatedb PROPERTIES DEFINE_SYMBOL BUILDING_INTERROGATEDB) +target_link_libraries(p3interrogatedb p3dconfig p3dtoolconfig) -if(NOT BUILD_METALIBS) - install(TARGETS p3interrogatedb - EXPORT Core COMPONENT Core - DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d - ARCHIVE COMPONENT CoreDevel) -endif() +install(TARGETS p3interrogatedb + EXPORT Core COMPONENT Core + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d + ARCHIVE COMPONENT CoreDevel) install(FILES ${P3INTERROGATEDB_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) install(FILES ${P3IGATERUNTIME_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) @@ -74,4 +73,4 @@ add_custom_command( add_python_target(panda3d.interrogatedb "${CMAKE_CURRENT_BINARY_DIR}/interrogatedb_module.cxx") -target_link_libraries(panda3d.interrogatedb p3dtoolconfig) +target_link_libraries(panda3d.interrogatedb p3interrogatedb) diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index 08ae8be0d0..9324088175 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -142,7 +142,7 @@ set(P3EXPRESS_IGATEEXT composite_sources(p3express P3EXPRESS_SOURCES) add_component_library(p3express SYMBOL BUILDING_PANDA_EXPRESS ${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS}) -target_link_libraries(p3express p3pandabase p3dtoolconfig p3dtool +target_link_libraries(p3express p3pandabase p3interrogatedb p3dtoolconfig p3dtool PKG::ZLIB PKG::OPENSSL) target_interrogate(p3express ALL EXTENSIONS ${P3EXPRESS_IGATEEXT})