CMake: Break out p3interrogatedb as a first-class library

This commit is contained in:
Sam Edwards 2019-10-15 23:27:03 -06:00
parent 73ed31b935
commit 9ecaa0056b
4 changed files with 14 additions and 15 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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})