From 2a85cd7a5b2f826d20e2ac86e7543e682eaf18c4 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 4 Feb 2014 11:28:06 -0700 Subject: [PATCH 01/12] CMake: dtoolbase/dtoolutil may need to link against Python. --- dtool/src/dtoolbase/CMakeLists.txt | 4 +++- dtool/src/dtoolutil/CMakeLists.txt | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index 92edf9886e..98c7ed19e9 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -62,4 +62,6 @@ set(P3DTOOLBASE_SOURCES composite_sources(p3dtoolbase P3DTOOLBASE_SOURCES) add_library(p3dtoolbase ${P3DTOOLBASE_HEADERS} ${P3DTOOLBASE_SOURCES}) - +if(HAVE_PYTHON) + target_link_libraries(p3dtoolbase ${PYTHON_LIBRARIES}) +endif() diff --git a/dtool/src/dtoolutil/CMakeLists.txt b/dtool/src/dtoolutil/CMakeLists.txt index c631b027ea..a7c94098ac 100644 --- a/dtool/src/dtoolutil/CMakeLists.txt +++ b/dtool/src/dtoolutil/CMakeLists.txt @@ -52,3 +52,6 @@ composite_sources(p3dtoolutil P3DTOOLUTIL_SOURCES) add_library(p3dtoolutil ${P3DTOOLUTIL_HEADERS} ${P3DTOOLUTIL_SOURCES}) target_link_libraries(p3dtoolutil p3dtoolbase ${CMAKE_DL_LIBS}) +if(HAVE_PYTHON) + target_link_libraries(p3dtoolutil ${PYTHON_LIBRARIES}) +endif() From 918e2eed664da8e7315deb31750f394e6beb74e2 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 4 Feb 2014 11:28:42 -0700 Subject: [PATCH 02/12] CMake: Begin work on direct, get autorestart to compile. --- CMakeLists.txt | 2 ++ direct/CMakeLists.txt | 14 ++++++++++++++ direct/src/autorestart/CMakeLists.txt | 3 +++ 3 files changed, 19 insertions(+) create mode 100644 direct/CMakeLists.txt create mode 100644 direct/src/autorestart/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index d7e0799c7c..8c242ea016 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,3 +37,5 @@ endif() if(BUILD_PANDA) add_subdirectory(panda) endif() + +add_subdirectory(direct) diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt new file mode 100644 index 0000000000..dc68056ab3 --- /dev/null +++ b/direct/CMakeLists.txt @@ -0,0 +1,14 @@ +# Include source directories which have C++ components: +add_subdirectory(src/autorestart) +#add_subdirectory(src/dcparser) +#add_subdirectory(src/dcparse) +#add_subdirectory(src/deadrec) +#add_subdirectory(src/directbase) +#add_subdirectory(src/directdServer) +#add_subdirectory(src/directd) +#add_subdirectory(src/distributed) +#add_subdirectory(src/heapq) +#add_subdirectory(src/http) +#add_subdirectory(src/interval) +#add_subdirectory(src/motiontrail) +#add_subdirectory(src/showbase) diff --git a/direct/src/autorestart/CMakeLists.txt b/direct/src/autorestart/CMakeLists.txt new file mode 100644 index 0000000000..8847a518cc --- /dev/null +++ b/direct/src/autorestart/CMakeLists.txt @@ -0,0 +1,3 @@ +add_definitions(-DWITHIN_PANDA) +add_executable(autorestart autorestart.c) +target_link_libraries(autorestart p3dtool) From 95e25af828be83f4bf234e2d7ae34f612586f743 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 4 Feb 2014 14:56:04 -0700 Subject: [PATCH 03/12] CMake: Update Interrogate.cmake macro's use of COMPILE_DEFINITIONS: - Slightly older versions of CMake default this to NOTFOUND, so test before iterating. - Add to local definitions for building the _igate sources. --- cmake/macros/Interrogate.cmake | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 3d9d7d3386..3a9c998226 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -174,9 +174,13 @@ function(interrogate_sources target output database module) # will preprocess each file in the same way. set(define_flags) get_target_property(target_defines "${target}" COMPILE_DEFINITIONS) - foreach(target_define ${target_defines}) - list(APPEND define_flags "-D${target_define}") - endforeach(target_define) + if(target_defines) + foreach(target_define ${target_defines}) + list(APPEND define_flags "-D${target_define}") + # And add the same definition when we compile the _igate.cxx file: + add_definitions("-D${target_define}") + endforeach(target_define) + endif() # If this is a release build that has NDEBUG defined, we need that too: string(TOUPPER "${CMAKE_BUILD_TYPE}" build_type) if("${CMAKE_CXX_FLAGS_${build_type}}" MATCHES ".*NDEBUG.*") From 470611a473bdc377fa54e30db09439dc7a63f0de Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 4 Feb 2014 14:57:03 -0700 Subject: [PATCH 04/12] CMake: Interrogate/build nativenet, net. --- panda/CMakeLists.txt | 6 ++++-- panda/src/nativenet/CMakeLists.txt | 30 ++++++++++++++++++++++++++++ panda/src/net/CMakeLists.txt | 32 ++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 panda/src/nativenet/CMakeLists.txt create mode 100644 panda/src/net/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index f648f44d2c..30ddcd6877 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -52,6 +52,8 @@ add_subdirectory(src/tform) add_subdirectory(src/pgui) add_subdirectory(src/recorder) add_subdirectory(src/collide) +add_subdirectory(src/nativenet) +add_subdirectory(src/net) add_subdirectory(src/egg) add_subdirectory(src/egg2pg) add_subdirectory(src/framework) @@ -64,6 +66,6 @@ add_subdirectory(metalibs/pandaegg) add_python_module(core p3chan p3char p3collide p3cull p3device p3dgraph p3display p3downloader p3event p3express p3gobj p3grutil p3gsgbase p3linmath - p3mathutil p3parametrics p3pgraph p3pgraphnodes p3pgui p3pipeline p3pnmimage - p3pnmtext p3pstatclient p3putil p3recorder p3text p3tform) + p3mathutil p3nativenet p3net p3parametrics p3pgraph p3pgraphnodes p3pgui + p3pipeline p3pnmimage p3pnmtext p3pstatclient p3putil p3recorder p3text p3tform) add_python_module(egg p3egg p3egg2pg) diff --git a/panda/src/nativenet/CMakeLists.txt b/panda/src/nativenet/CMakeLists.txt new file mode 100644 index 0000000000..3e13361410 --- /dev/null +++ b/panda/src/nativenet/CMakeLists.txt @@ -0,0 +1,30 @@ +if(WANT_NATIVE_NET) + set(P3NATIVENET_HEADERS + buffered_datagramconnection.h + buffered_datagramreader.h buffered_datagramreader.i + ringbuffer.h ringbuffer.i socket_ip.h + socket_tcp_listen.h time_accumulator.h time_out.h + socket_address.h + socket_portable.h time_base.h time_span.h buffered_datagramwriter.h + socket_base.h socket_selector.h + socket_udp.h + socket_udp_incoming.h time_clock.h + membuffer.h membuffer.i socket_fdset.h socket_tcp.h + socket_udp_outgoing.h time_general.h) + + set(P3NATIVENET_SOURCES + config_nativenet.cxx + buffered_datagramconnection.cxx + socket_ip.cxx + socket_tcp.cxx + socket_tcp_listen.cxx + socket_tcp_ssl.cxx + socket_udp.cxx + socket_udp_incoming.cxx + socket_udp_outgoing.cxx) + + composite_sources(p3nativenet P3NATIVENET_SOURCES) + add_library(p3nativenet ${P3NATIVENET_HEADERS} ${P3NATIVENET_SOURCES}) + target_link_libraries(p3nativenet p3express p3pandabase) + target_interrogate(p3nativenet ALL) +endif() diff --git a/panda/src/net/CMakeLists.txt b/panda/src/net/CMakeLists.txt new file mode 100644 index 0000000000..9fec4780fc --- /dev/null +++ b/panda/src/net/CMakeLists.txt @@ -0,0 +1,32 @@ +if(HAVE_NET AND WANT_NATIVE_NET) + set(P3NET_HEADERS + config_net.h connection.h connectionListener.h + connectionManager.N connectionManager.h + connectionReader.I connectionReader.h + connectionWriter.h datagramQueue.h + datagramTCPHeader.I datagramTCPHeader.h + datagramUDPHeader.I datagramUDPHeader.h + netAddress.h netDatagram.I netDatagram.h + datagramGeneratorNet.I datagramGeneratorNet.h + datagramSinkNet.I datagramSinkNet.h + queuedConnectionListener.I + queuedConnectionListener.h queuedConnectionManager.h + queuedConnectionReader.h recentConnectionReader.h + queuedReturn.h queuedReturn.I) + + set(P3NET_SOURCES + config_net.cxx connection.cxx connectionListener.cxx + connectionManager.cxx connectionReader.cxx + connectionWriter.cxx datagramQueue.cxx datagramTCPHeader.cxx + datagramUDPHeader.cxx netAddress.cxx netDatagram.cxx + datagramGeneratorNet.cxx + datagramSinkNet.cxx + queuedConnectionListener.cxx + queuedConnectionManager.cxx queuedConnectionReader.cxx + recentConnectionReader.cxx) + + composite_sources(p3net P3NET_SOURCES) + add_library(p3net ${P3NET_HEADERS} ${P3NET_SOURCES}) + target_link_libraries(p3net p3express p3downloader p3pandabase p3nativenet p3pipeline) + target_interrogate(p3net ALL) +endif() From 89797d78d6463280fa2c9c850caaa776a982557b Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 4 Feb 2014 14:58:52 -0700 Subject: [PATCH 05/12] CMake: Work on direct; get dcparse, dcparser, deadrec, directbase, distributed to build+Interrogate. --- direct/CMakeLists.txt | 12 +++--- direct/src/dcparse/CMakeLists.txt | 3 ++ direct/src/dcparser/CMakeLists.txt | 53 +++++++++++++++++++++++++++ direct/src/deadrec/CMakeLists.txt | 11 ++++++ direct/src/directbase/CMakeLists.txt | 11 ++++++ direct/src/distributed/CMakeLists.txt | 24 ++++++++++++ 6 files changed, 109 insertions(+), 5 deletions(-) create mode 100644 direct/src/dcparse/CMakeLists.txt create mode 100644 direct/src/dcparser/CMakeLists.txt create mode 100644 direct/src/deadrec/CMakeLists.txt create mode 100644 direct/src/directbase/CMakeLists.txt create mode 100644 direct/src/distributed/CMakeLists.txt diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index dc68056ab3..284ed72f7f 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -1,14 +1,16 @@ # Include source directories which have C++ components: +add_subdirectory(src/directbase) add_subdirectory(src/autorestart) -#add_subdirectory(src/dcparser) -#add_subdirectory(src/dcparse) -#add_subdirectory(src/deadrec) -#add_subdirectory(src/directbase) +add_subdirectory(src/dcparser) +add_subdirectory(src/dcparse) +add_subdirectory(src/deadrec) #add_subdirectory(src/directdServer) #add_subdirectory(src/directd) -#add_subdirectory(src/distributed) +add_subdirectory(src/distributed) #add_subdirectory(src/heapq) #add_subdirectory(src/http) #add_subdirectory(src/interval) #add_subdirectory(src/motiontrail) #add_subdirectory(src/showbase) + +add_python_module(direct p3dcparser p3deadrec p3distributed) diff --git a/direct/src/dcparse/CMakeLists.txt b/direct/src/dcparse/CMakeLists.txt new file mode 100644 index 0000000000..a50ebdb3b1 --- /dev/null +++ b/direct/src/dcparse/CMakeLists.txt @@ -0,0 +1,3 @@ +add_executable(dcparse dcparse.cxx) +set_target_properties(dcparse PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) +target_link_libraries(dcparse p3dcparser) diff --git a/direct/src/dcparser/CMakeLists.txt b/direct/src/dcparser/CMakeLists.txt new file mode 100644 index 0000000000..1838865b81 --- /dev/null +++ b/direct/src/dcparser/CMakeLists.txt @@ -0,0 +1,53 @@ +add_bison_target(dcParser.cxx dcParser.yxx DEFINES dcParser.h PREFIX dcyy) +add_flex_target(dcLexer.cxx dcLexer.lxx CASE_INSENSITIVE PREFIX dcyy) + +set(P3DCPARSER_HEADERS + dcAtomicField.h dcAtomicField.I dcClass.h dcClass.I + dcDeclaration.h + dcField.h dcField.I + dcFile.h dcFile.I + dcKeyword.h dcKeywordList.h + dcLexer.lxx + dcLexerDefs.h dcMolecularField.h dcParser.yxx dcParserDefs.h + dcSubatomicType.h + dcPackData.h dcPackData.I + dcPacker.h dcPacker.I + dcPackerCatalog.h dcPackerCatalog.I + dcPackerInterface.h dcPackerInterface.I + dcParameter.h dcClassParameter.h dcArrayParameter.h + dcSimpleParameter.h dcSwitchParameter.h + dcNumericRange.h dcNumericRange.I + dcSwitch.h + dcTypedef.h + dcPython.h + dcbase.h dcindent.h hashGenerator.h + primeNumberGenerator.h) + +set(P3DCPARSER_SOURCES + dcAtomicField.cxx dcClass.cxx + dcDeclaration.cxx + dcField.cxx dcFile.cxx + dcKeyword.cxx dcKeywordList.cxx + dcMolecularField.cxx dcSubatomicType.cxx + dcPackData.cxx + dcPacker.cxx + dcPackerCatalog.cxx + dcPackerInterface.cxx + dcParameter.cxx dcClassParameter.cxx dcArrayParameter.cxx + dcSimpleParameter.cxx dcSwitchParameter.cxx + dcSwitch.cxx + dcTypedef.cxx + dcindent.cxx + hashGenerator.cxx primeNumberGenerator.cxx) + +# These cannot be interrogated, and are excluded from the composites. +set(P3DCPARSER_PARSER_SOURCES + dcParser.cxx + dcLexer.cxx) + +composite_sources(p3dcparser P3DCPARSER_SOURCES) +add_library(p3dcparser ${P3DCPARSER_SOURCES} ${P3DCPARSER_HEADERS} + ${P3DCPARSER_PARSER_SOURCES}) +set_target_properties(p3dcparser PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) +target_link_libraries(p3dcparser p3directbase p3express p3pstatclient p3prc) +target_interrogate(p3dcparser ${P3DCPARSER_SOURCES} ${P3DCPARSER_HEADERS}) diff --git a/direct/src/deadrec/CMakeLists.txt b/direct/src/deadrec/CMakeLists.txt new file mode 100644 index 0000000000..043fc62cd6 --- /dev/null +++ b/direct/src/deadrec/CMakeLists.txt @@ -0,0 +1,11 @@ +set(P3DEADREC_HEADERS + config_deadrec.h + smoothMover.h smoothMover.I) + +set(P3DEADREC_SOURCES + config_deadrec.cxx + smoothMover.cxx) + +add_library(p3deadrec ${P3DEADREC_HEADERS} ${P3DEADREC_SOURCES}) +target_link_libraries(p3deadrec p3directbase p3linmath p3pgraph p3prc) +target_interrogate(p3deadrec ALL) diff --git a/direct/src/directbase/CMakeLists.txt b/direct/src/directbase/CMakeLists.txt new file mode 100644 index 0000000000..1be8a56434 --- /dev/null +++ b/direct/src/directbase/CMakeLists.txt @@ -0,0 +1,11 @@ +set(P3DIRECTBASE_SOURCES + directbase.cxx +) + +set(P3DIRECTBASE_HEADERS + directbase.h directsymbols.h +) + +# Not worth compositing sources, there's really only one. +add_library(p3directbase ${P3DIRECTBASE_SOURCES} ${P3DIRECTBASE_HEADERS}) +target_link_libraries(p3directbase p3pandabase) diff --git a/direct/src/distributed/CMakeLists.txt b/direct/src/distributed/CMakeLists.txt new file mode 100644 index 0000000000..681004e608 --- /dev/null +++ b/direct/src/distributed/CMakeLists.txt @@ -0,0 +1,24 @@ +if(HAVE_PYTHON) + set(P3DISTRIBUTED_HEADERS + config_distributed.h + cConnectionRepository.I + cConnectionRepository.h + cDistributedSmoothNodeBase.I + cDistributedSmoothNodeBase.h) + + set(P3DISTRIBUTED_SOURCES + config_distributed.cxx + cConnectionRepository.cxx + cDistributedSmoothNodeBase.cxx) + + add_library(p3distributed ${P3DISTRIBUTED_HEADERS} ${P3DISTRIBUTED_SOURCES}) + set_target_properties(p3distributed PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) + target_link_libraries(p3distributed p3directbase p3dcparser p3pgraph) + if(WANT_NATIVE_NET) + target_link_libraries(p3distributed p3nativenet) + endif() + if(HAVE_NET) + target_link_libraries(p3distributed p3net) + endif() + target_interrogate(p3distributed ALL) +endif() From 8a31b4b6a1157e506e7838947fbb1e5953a26140 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 4 Feb 2014 14:59:32 -0700 Subject: [PATCH 06/12] CMake: Update autorestart's CMakeLists to match the COMPILE_DEFINITIONS (rather than add_definitions) of the other components' CMakeLists files. --- direct/src/autorestart/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direct/src/autorestart/CMakeLists.txt b/direct/src/autorestart/CMakeLists.txt index 8847a518cc..31524487c5 100644 --- a/direct/src/autorestart/CMakeLists.txt +++ b/direct/src/autorestart/CMakeLists.txt @@ -1,3 +1,3 @@ -add_definitions(-DWITHIN_PANDA) add_executable(autorestart autorestart.c) +set_target_properties(autorestart PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) target_link_libraries(autorestart p3dtool) From 2898f4da33a44811de5a4b2ec9a3a6464ea3d410 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 4 Feb 2014 16:42:43 -0700 Subject: [PATCH 07/12] CMake: Get direct's 'interval' component library to build+Interrogate. --- direct/CMakeLists.txt | 4 +-- direct/src/interval/CMakeLists.txt | 41 ++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 direct/src/interval/CMakeLists.txt diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 284ed72f7f..4f32ebb6b0 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -9,8 +9,8 @@ add_subdirectory(src/deadrec) add_subdirectory(src/distributed) #add_subdirectory(src/heapq) #add_subdirectory(src/http) -#add_subdirectory(src/interval) +add_subdirectory(src/interval) #add_subdirectory(src/motiontrail) #add_subdirectory(src/showbase) -add_python_module(direct p3dcparser p3deadrec p3distributed) +add_python_module(direct p3dcparser p3deadrec p3distributed p3interval) diff --git a/direct/src/interval/CMakeLists.txt b/direct/src/interval/CMakeLists.txt new file mode 100644 index 0000000000..03b9feddf0 --- /dev/null +++ b/direct/src/interval/CMakeLists.txt @@ -0,0 +1,41 @@ +set(P3INTERVAL_HEADERS + config_interval.h + cInterval.I cInterval.h + cIntervalManager.I cIntervalManager.h + cConstraintInterval.I cConstraintInterval.h + cConstrainTransformInterval.I cConstrainTransformInterval.h + cConstrainPosInterval.I cConstrainPosInterval.h + cConstrainHprInterval.I cConstrainHprInterval.h + cConstrainPosHprInterval.I cConstrainPosHprInterval.h + cLerpInterval.I cLerpInterval.h + cLerpNodePathInterval.I cLerpNodePathInterval.h + cLerpAnimEffectInterval.I cLerpAnimEffectInterval.h + cMetaInterval.I cMetaInterval.h + hideInterval.I hideInterval.h + lerpblend.h + showInterval.I showInterval.h + waitInterval.I waitInterval.h + lerp_helpers.h) + +set(P3INTERVAL_SOURCES + config_interval.cxx + cInterval.cxx + cIntervalManager.cxx + cConstraintInterval.cxx + cConstrainTransformInterval.cxx + cConstrainPosInterval.cxx + cConstrainHprInterval.cxx + cConstrainPosHprInterval.cxx + cLerpInterval.cxx + cLerpNodePathInterval.cxx + cLerpAnimEffectInterval.cxx + cMetaInterval.cxx + hideInterval.cxx + lerpblend.cxx + showInterval.cxx + waitInterval.cxx) + +composite_sources(p3interval P3INTERVAL_SOURCES) +add_library(p3interval ${P3INTERVAL_HEADERS} ${P3INTERVAL_SOURCES}) +target_link_libraries(p3interval p3directbase p3pstatclient p3pgraph p3chan p3dconfig p3prc) +target_interrogate(p3interval ALL) From 9da0bb6912dd5c9e73717819721d4684cfd881ed Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 4 Feb 2014 18:23:45 -0700 Subject: [PATCH 08/12] CMake: Add audio/movies components. --- panda/CMakeLists.txt | 24 +++++++++++++++----- panda/src/audio/CMakeLists.txt | 24 ++++++++++++++++++++ panda/src/grutil/CMakeLists.txt | 5 ++++- panda/src/movies/CMakeLists.txt | 39 +++++++++++++++++++++++++++++++++ 4 files changed, 86 insertions(+), 6 deletions(-) create mode 100644 panda/src/audio/CMakeLists.txt create mode 100644 panda/src/movies/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 30ddcd6877..2f4ce7439d 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -40,6 +40,8 @@ add_subdirectory(src/pgraph) add_subdirectory(src/pgraphnodes) add_subdirectory(src/cull) add_subdirectory(src/display) +add_subdirectory(src/movies) +add_subdirectory(src/audio) add_subdirectory(src/chan) add_subdirectory(src/char) add_subdirectory(src/dgraph) @@ -64,8 +66,20 @@ add_subdirectory(metalibs/panda) add_subdirectory(metalibs/pandagl) add_subdirectory(metalibs/pandaegg) -add_python_module(core p3chan p3char p3collide p3cull p3device p3dgraph - p3display p3downloader p3event p3express p3gobj p3grutil p3gsgbase p3linmath - p3mathutil p3nativenet p3net p3parametrics p3pgraph p3pgraphnodes p3pgui - p3pipeline p3pnmimage p3pnmtext p3pstatclient p3putil p3recorder p3text p3tform) -add_python_module(egg p3egg p3egg2pg) + +# Now add the Python modules: +set(CORE_MODULE_COMPONENTS + p3chan p3char p3collide p3cull p3device p3dgraph p3display p3downloader + p3event p3express p3gobj p3grutil p3gsgbase p3linmath p3mathutil p3nativenet + p3net p3movies p3parametrics p3pgraph p3pgraphnodes p3pgui p3pipeline + p3pnmimage p3pnmtext p3pstatclient p3putil p3recorder p3text p3tform) + +if(HAVE_AUDIO) + list(APPEND CORE_MODULE_COMPONENTS p3audio) +endif() + +add_python_module(core ${CORE_MODULE_COMPONENTS}) + +if(HAVE_EGG) + add_python_module(egg p3egg p3egg2pg) +endif() diff --git a/panda/src/audio/CMakeLists.txt b/panda/src/audio/CMakeLists.txt new file mode 100644 index 0000000000..9503acc783 --- /dev/null +++ b/panda/src/audio/CMakeLists.txt @@ -0,0 +1,24 @@ +if(HAVE_AUDIO) + set(P3AUDIO_HEADERS + config_audio.h + filterProperties.h filterProperties.I + audioLoadRequest.h audioLoadRequest.I + audioManager.h audioManager.I + audioSound.h audioSound.I + nullAudioManager.h + nullAudioSound.h) + + set(P3AUDIO_SOURCES + config_audio.cxx + filterProperties.cxx + audioLoadRequest.cxx + audioManager.cxx + audioSound.cxx + nullAudioManager.cxx + nullAudioSound.cxx) + + composite_sources(p3audio P3AUDIO_SOURCES) + add_library(p3audio ${P3AUDIO_HEADERS} ${P3AUDIO_SOURCES}) + target_link_libraries(p3audio p3putil p3event p3movies p3linmath) + target_interrogate(p3audio ALL) +endif() diff --git a/panda/src/grutil/CMakeLists.txt b/panda/src/grutil/CMakeLists.txt index d7d2dd44ce..d4f2087cd3 100644 --- a/panda/src/grutil/CMakeLists.txt +++ b/panda/src/grutil/CMakeLists.txt @@ -37,5 +37,8 @@ set(P3GRUTIL_SOURCES composite_sources(p3grutil P3GRUTIL_SOURCES) add_library(p3grutil ${P3GRUTIL_SOURCES} ${P3GRUTIL_HEADERS}) -target_link_libraries(p3grutil p3display p3text) +target_link_libraries(p3grutil p3display p3text p3movies) +if(HAVE_AUDIO) + target_link_libraries(p3grutil p3audio) +endif() target_interrogate(p3grutil ALL) diff --git a/panda/src/movies/CMakeLists.txt b/panda/src/movies/CMakeLists.txt new file mode 100644 index 0000000000..4ae884c012 --- /dev/null +++ b/panda/src/movies/CMakeLists.txt @@ -0,0 +1,39 @@ +set(P3MOVIES_HEADERS + config_movies.h + inkblotVideo.h inkblotVideo.I + inkblotVideoCursor.h inkblotVideoCursor.I + microphoneAudio.h microphoneAudio.I + movieAudio.h movieAudio.I + movieAudioCursor.h movieAudioCursor.I + movieTypeRegistry.h movieTypeRegistry.I + movieVideo.h movieVideo.I + movieVideoCursor.h movieVideoCursor.I + userDataAudio.h userDataAudio.I + userDataAudioCursor.h userDataAudioCursor.I + vorbisAudio.h vorbisAudio.I + vorbisAudioCursor.h vorbisAudioCursor.I + wavAudio.h wavAudio.I + wavAudioCursor.h wavAudioCursor.I) + +set(P3MOVIES_SOURCES + config_movies.cxx + inkblotVideo.cxx + inkblotVideoCursor.cxx + microphoneAudio.cxx + microphoneAudioDS.cxx + movieAudio.cxx + movieAudioCursor.cxx + movieTypeRegistry.cxx + movieVideo.cxx + movieVideoCursor.cxx + userDataAudio.cxx + userDataAudioCursor.cxx + vorbisAudio.cxx + vorbisAudioCursor.cxx + wavAudio.cxx + wavAudioCursor.cxx) + +composite_sources(p3movies P3MOVIES_SOURCES) +add_library(p3movies ${P3MOVIES_HEADERS} ${P3MOVIES_SOURCES}) +target_link_libraries(p3movies p3pandabase p3express p3pstatclient p3gobj p3dconfig p3prc) +target_interrogate(p3movies ALL) From ff62637101b08cbf9fb8fc92f9cb68b972e3b162 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 4 Feb 2014 19:09:33 -0700 Subject: [PATCH 09/12] CMake: Build+Interrogate p3showbase. --- direct/CMakeLists.txt | 4 ++-- direct/src/showbase/CMakeLists.txt | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 direct/src/showbase/CMakeLists.txt diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 4f32ebb6b0..904bf6f9ae 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -11,6 +11,6 @@ add_subdirectory(src/distributed) #add_subdirectory(src/http) add_subdirectory(src/interval) #add_subdirectory(src/motiontrail) -#add_subdirectory(src/showbase) +add_subdirectory(src/showbase) -add_python_module(direct p3dcparser p3deadrec p3distributed p3interval) +add_python_module(direct p3dcparser p3deadrec p3distributed p3interval p3showbase) diff --git a/direct/src/showbase/CMakeLists.txt b/direct/src/showbase/CMakeLists.txt new file mode 100644 index 0000000000..36e4f70b25 --- /dev/null +++ b/direct/src/showbase/CMakeLists.txt @@ -0,0 +1,3 @@ +add_library(p3showbase showBase.cxx showBase.h) +target_link_libraries(p3showbase p3directbase p3express p3event p3chan p3display p3dconfig p3prc) +target_interrogate(p3showbase ALL) From 87cae490cd3b906b28fc068e317daebee5411b0d Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 8 Feb 2014 17:51:05 -0700 Subject: [PATCH 10/12] CMake: Only build 'direct' if BUILD_DIRECT is on. --- CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c242ea016..d7ca1c4600 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,8 +26,9 @@ include(dtool/Package.cmake) include(dtool/Config.cmake) # Determine which trees to build. -option(BUILD_DTOOL "Build the dtool source tree." ON) -option(BUILD_PANDA "Build the panda source tree." ON) +option(BUILD_DTOOL "Build the dtool source tree." ON) +option(BUILD_PANDA "Build the panda source tree." ON) +option(BUILD_DIRECT "Build the direct source tree." ON) # Include Panda3D packages if(BUILD_DTOOL) @@ -38,4 +39,6 @@ if(BUILD_PANDA) add_subdirectory(panda) endif() -add_subdirectory(direct) +if(BUILD_DIRECT) + add_subdirectory(direct) +endif() From e2a03d6435f94afc390bdc1b73e8be4542199c33 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 8 Feb 2014 17:51:14 -0700 Subject: [PATCH 11/12] CMake: 'direct' depends on 'panda' --- direct/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 904bf6f9ae..28f09f3c8c 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT BUILD_PANDA) + message(FATAL_ERROR "Cannot build direct without panda! Please enable the BUILD_PANDA option.") +endif() + # Include source directories which have C++ components: add_subdirectory(src/directbase) add_subdirectory(src/autorestart) From 9035f7aa85f02b0f3f90c50dd82a157978b3a65e Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 8 Feb 2014 17:59:12 -0700 Subject: [PATCH 12/12] CMake: Only build 'autorestart' on UNIX. --- direct/src/autorestart/CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/direct/src/autorestart/CMakeLists.txt b/direct/src/autorestart/CMakeLists.txt index 31524487c5..3293a08e08 100644 --- a/direct/src/autorestart/CMakeLists.txt +++ b/direct/src/autorestart/CMakeLists.txt @@ -1,3 +1,5 @@ -add_executable(autorestart autorestart.c) -set_target_properties(autorestart PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) -target_link_libraries(autorestart p3dtool) +if(UNIX) + add_executable(autorestart autorestart.c) + set_target_properties(autorestart PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) + target_link_libraries(autorestart p3dtool) +endif()