CMake: Take care of panda3d.interrogatedb module

This commit is contained in:
Sam Edwards 2018-02-06 10:36:41 -07:00
parent d66f5fa8e2
commit 556c03c0c1
6 changed files with 55 additions and 3 deletions

View File

@ -2,11 +2,20 @@ add_definitions(-DBUILDING_DTOOLCONFIG)
if(HAVE_PYTHON)
add_library(p3dtoolconfig dtoolconfig.cxx pydtool.cxx)
target_link_libraries(p3dtoolconfig ${_PYTHON_LIBRARIES})
else()
add_library(p3dtoolconfig dtoolconfig.cxx)
endif()
target_use_packages(p3dtoolconfig PYTHON)
target_link_libraries(p3dtoolconfig p3prc p3dconfig p3interrogatedb)
set_target_properties(p3dtoolconfig PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/panda3d"
PREFIX ""
OUTPUT_NAME "interrogatedb"
)
install(TARGETS p3dtoolconfig DESTINATION lib)
if(HAVE_PYTHON)
install(TARGETS p3dtoolconfig DESTINATION "${PYTHON_ARCH_INSTALL_DIR}/panda3d")
else()
install(TARGETS p3dtoolconfig DESTINATION lib)
endif()

View File

@ -62,10 +62,19 @@ set(P3DTOOLBASE_SOURCES
typedObject.cxx
)
set(P3DTOOLBASE_IGATEEXT
typeHandle_ext.cxx
typeHandle_ext.h
)
composite_sources(p3dtoolbase P3DTOOLBASE_SOURCES)
add_library(p3dtoolbase ${P3DTOOLBASE_HEADERS} ${P3DTOOLBASE_SOURCES})
# The extensions need py_panda.h and extension.h from interrogatedb
target_include_directories(p3dtoolbase PUBLIC
$<TARGET_PROPERTY:p3interrogatedb,INTERFACE_INCLUDE_DIRECTORIES>)
target_use_packages(p3dtoolbase THREADS)
target_interrogate(p3dtoolbase ${P3DTOOLBASE_SOURCES} EXTENSIONS ${P3DTOOLBASE_IGATEEXT})
install(TARGETS p3dtoolbase DESTINATION lib)
install(FILES ${P3DTOOLBASE_HEADERS} DESTINATION include/panda3d)

View File

@ -62,10 +62,21 @@ set(P3DTOOLUTIL_SOURCES
win32ArgParser.cxx
)
set(P3DTOOLUTIL_IGATEEXT
filename_ext.cxx
filename_ext.h
globPattern_ext.cxx
globPattern_ext.h
)
composite_sources(p3dtoolutil P3DTOOLUTIL_SOURCES)
add_library(p3dtoolutil ${P3DTOOLUTIL_HEADERS} ${P3DTOOLUTIL_SOURCES})
# The extensions need py_panda.h and extension.h from interrogatedb
target_include_directories(p3dtoolutil PUBLIC
$<TARGET_PROPERTY:p3interrogatedb,INTERFACE_INCLUDE_DIRECTORIES>)
target_link_libraries(p3dtoolutil p3dtoolbase ${CMAKE_DL_LIBS})
target_interrogate(p3dtoolutil ALL EXTENSIONS ${P3DTOOLUTIL_IGATEEXT})
if(APPLE)
find_library(FOUNDATION_LIBRARY Foundation)

View File

@ -29,9 +29,21 @@ set(P3INTERROGATEDB_SOURCES
composite_sources(p3interrogatedb P3INTERROGATEDB_SOURCES)
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)
add_library(p3interrogatedb ${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)

View File

@ -62,10 +62,20 @@ set(P3PRC_SOURCES
reversedNumericData.cxx
streamReader.cxx streamWrapper.cxx streamWriter.cxx)
set(P3PRC_IGATEEXT
streamReader_ext.cxx
streamReader_ext.h
streamWriter_ext.cxx
streamWriter_ext.h)
composite_sources(p3prc P3PRC_SOURCES)
add_library(p3prc ${P3PRC_HEADERS} ${P3PRC_SOURCES})
# The extensions need py_panda.h and extension.h from interrogatedb
target_include_directories(p3prc PUBLIC
$<TARGET_PROPERTY:p3interrogatedb,INTERFACE_INCLUDE_DIRECTORIES>)
target_link_libraries(p3prc p3dtoolutil p3dtoolbase ${_OPENSSL_LIBRARIES})
target_interrogate(p3prc ALL EXTENSIONS ${P3PRC_IGATEEXT})
install(TARGETS p3prc DESTINATION lib)
install(FILES ${P3PRC_HEADERS} DESTINATION include/panda3d)

View File

@ -88,7 +88,8 @@ set(CORE_MODULE_COMPONENTS
p3chan p3char p3collide p3cull p3device p3dgraph p3display p3downloader p3dxml
p3event p3express p3gobj p3grutil p3gsgbase p3linmath p3mathutil p3nativenet
p3net p3movies p3parametrics p3pgraph p3pgraphnodes p3pgui p3pipeline
p3pnmimage p3pstatclient p3putil p3recorder p3text p3tform)
p3pnmimage p3pstatclient p3putil p3recorder p3text p3tform
p3prc p3dtoolutil p3dtoolbase)
if(HAVE_AUDIO)
list(APPEND CORE_MODULE_COMPONENTS p3audio)