CMake: Move interrogatedb interrogation to p3interrogatedb

This commit is contained in:
Sam Edwards 2018-05-14 17:55:47 -06:00
parent 538c615abe
commit aeeabdbd3b
2 changed files with 41 additions and 51 deletions

View File

@ -1,42 +1,3 @@
# First, dtoolconfig:
set(DTOOLCONFIG_LINK_TARGETS p3prc p3dconfig p3interrogatedb)
add_metalib(p3dtoolconfig dtoolconfig.cxx COMPONENTS ${DTOOLCONFIG_LINK_TARGETS})
install(TARGETS p3dtoolconfig DESTINATION lib)
# Next, panda3d.interrogatedb:
if(HAVE_PYTHON AND INTERROGATE_PYTHON_INTERFACE)
set(INTERROGATEDB_IGATE
../../src/interrogatedb/interrogate_interface.h
../../src/interrogatedb/interrogate_request.h
)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/interrogatedb_module.cxx"
COMMAND interrogate
-D EXPCL_INTERROGATEDB=
-nodb -python -promiscuous
-module panda3d.interrogatedb
-library interrogatedb
-string -true-names -do-module
-srcdir "${CMAKE_CURRENT_SOURCE_DIR}"
-oc "${CMAKE_CURRENT_BINARY_DIR}/interrogatedb_module.cxx"
${INTERROGATEDB_IGATE}
DEPENDS interrogate ${INTERROGATEDB_IGATE}
COMMENT "Interrogating interrogatedb"
)
add_library(interrogatedb ${MODULE_TYPE}
"${CMAKE_CURRENT_BINARY_DIR}/interrogatedb_module.cxx")
target_use_packages(interrogatedb PYTHON)
target_link_libraries(interrogatedb p3dtoolconfig)
set_target_properties(interrogatedb PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/panda3d"
PREFIX ""
OUTPUT_NAME "interrogatedb"
)
install(TARGETS interrogatedb DESTINATION "${PYTHON_ARCH_INSTALL_DIR}/panda3d")
endif()

View File

@ -27,24 +27,53 @@ set(P3INTERROGATEDB_SOURCES
py_panda.cxx
py_wrappers.cxx)
composite_sources(p3interrogatedb P3INTERROGATEDB_SOURCES)
set(P3INTERROGATEDB_IGATE
interrogate_interface.h
interrogate_request.h
)
set(P3INTERROGATEDB_IGATE_SOURCES
config_interrogatedb.cxx
indexRemapper.cxx
interrogateComponent.cxx interrogateDatabase.cxx
interrogateElement.cxx interrogateFunction.cxx
interrogateFunctionWrapper.cxx
interrogateMakeSeq.cxx
interrogateManifest.cxx
interrogateType.cxx interrogate_datafile.cxx
interrogate_interface.cxx interrogate_request.cxx)
composite_sources(p3interrogatedb P3INTERROGATEDB_SOURCES)
add_component_library(p3interrogatedb SYMBOL SYMBOL BUILDING_INTERROGATEDB
${P3INTERROGATEDB_HEADERS} ${P3INTERROGATEDB_SOURCES})
target_link_libraries(p3interrogatedb p3dconfig)
target_use_packages(p3interrogatedb PYTHON)
target_interrogate(p3interrogatedb ${P3INTERROGATEDB_IGATE_SOURCES})
install(TARGETS p3interrogatedb DESTINATION lib)
install(FILES ${P3INTERROGATEDB_HEADERS} DESTINATION include/panda3d)
# ALSO: This has an Interrogate binding! Take care of that if we want it.
# Note we don't use the regular Interrogate macros; this has some custom flags
# that would make it not worthwhile.
if(NOT HAVE_PYTHON OR NOT INTERROGATE_PYTHON_INTERFACE)
return()
endif()
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/interrogatedb_module.cxx"
COMMAND interrogate
-D EXPCL_INTERROGATEDB=
-nodb -python -promiscuous
-module panda3d.interrogatedb
-library interrogatedb
-string -true-names -do-module
-srcdir "${CMAKE_CURRENT_SOURCE_DIR}"
-oc "${CMAKE_CURRENT_BINARY_DIR}/interrogatedb_module.cxx"
${P3INTERROGATEDB_IGATE}
DEPENDS interrogate ${P3INTERROGATEDB_IGATE}
COMMENT "Interrogating interrogatedb"
)
add_library(interrogatedb ${MODULE_TYPE}
"${CMAKE_CURRENT_BINARY_DIR}/interrogatedb_module.cxx")
target_use_packages(interrogatedb PYTHON)
target_link_libraries(interrogatedb p3dtoolconfig)
set_target_properties(interrogatedb PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/panda3d"
PREFIX ""
OUTPUT_NAME "interrogatedb"
)
install(TARGETS interrogatedb DESTINATION "${PYTHON_ARCH_INSTALL_DIR}/panda3d")