From 5e77793b0f981ab418ee875ec754367b33937113 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 4 Feb 2014 22:43:23 -0700 Subject: [PATCH 01/12] CMake: Add some install(...) directives. --- direct/src/autorestart/CMakeLists.txt | 1 + direct/src/dcparse/CMakeLists.txt | 1 + direct/src/dcparser/CMakeLists.txt | 2 ++ direct/src/deadrec/CMakeLists.txt | 2 ++ direct/src/directbase/CMakeLists.txt | 2 ++ direct/src/distributed/CMakeLists.txt | 2 ++ direct/src/interval/CMakeLists.txt | 2 ++ direct/src/showbase/CMakeLists.txt | 2 ++ dtool/metalibs/dtool/CMakeLists.txt | 2 ++ dtool/metalibs/dtoolconfig/CMakeLists.txt | 2 ++ dtool/src/cppparser/CMakeLists.txt | 2 ++ dtool/src/dconfig/CMakeLists.txt | 2 ++ dtool/src/dtoolbase/CMakeLists.txt | 2 ++ dtool/src/dtoolutil/CMakeLists.txt | 2 ++ dtool/src/interrogate/CMakeLists.txt | 2 ++ dtool/src/interrogatedb/CMakeLists.txt | 2 ++ dtool/src/prc/CMakeLists.txt | 2 ++ panda/metalibs/panda/CMakeLists.txt | 2 ++ panda/metalibs/pandaegg/CMakeLists.txt | 2 ++ panda/metalibs/pandagl/CMakeLists.txt | 2 ++ panda/src/audio/CMakeLists.txt | 2 ++ panda/src/chan/CMakeLists.txt | 2 ++ panda/src/char/CMakeLists.txt | 2 ++ panda/src/collide/CMakeLists.txt | 2 ++ panda/src/cull/CMakeLists.txt | 2 ++ panda/src/device/CMakeLists.txt | 2 ++ panda/src/dgraph/CMakeLists.txt | 2 ++ panda/src/display/CMakeLists.txt | 2 ++ panda/src/downloader/CMakeLists.txt | 2 ++ panda/src/egg/CMakeLists.txt | 2 ++ panda/src/egg2pg/CMakeLists.txt | 2 ++ panda/src/event/CMakeLists.txt | 4 +++- panda/src/express/CMakeLists.txt | 2 ++ panda/src/framework/CMakeLists.txt | 2 ++ panda/src/glgsg/CMakeLists.txt | 2 ++ panda/src/glstuff/CMakeLists.txt | 2 ++ panda/src/glxdisplay/CMakeLists.txt | 2 ++ panda/src/gobj/CMakeLists.txt | 2 ++ panda/src/grutil/CMakeLists.txt | 2 ++ panda/src/gsgbase/CMakeLists.txt | 2 ++ panda/src/linmath/CMakeLists.txt | 2 ++ panda/src/mathutil/CMakeLists.txt | 2 ++ panda/src/movies/CMakeLists.txt | 2 ++ panda/src/nativenet/CMakeLists.txt | 2 ++ panda/src/net/CMakeLists.txt | 2 ++ panda/src/pandabase/CMakeLists.txt | 2 ++ panda/src/parametrics/CMakeLists.txt | 2 ++ panda/src/pgraph/CMakeLists.txt | 2 ++ panda/src/pgraphnodes/CMakeLists.txt | 2 ++ panda/src/pgui/CMakeLists.txt | 2 ++ panda/src/pipeline/CMakeLists.txt | 2 ++ panda/src/pnmimage/CMakeLists.txt | 2 ++ panda/src/pnmimagetypes/CMakeLists.txt | 2 ++ panda/src/pnmtext/CMakeLists.txt | 2 ++ panda/src/pstatclient/CMakeLists.txt | 2 ++ panda/src/putil/CMakeLists.txt | 2 ++ panda/src/recorder/CMakeLists.txt | 2 ++ panda/src/testbed/CMakeLists.txt | 1 + panda/src/text/CMakeLists.txt | 2 ++ panda/src/tform/CMakeLists.txt | 2 ++ panda/src/x11display/CMakeLists.txt | 2 ++ 61 files changed, 120 insertions(+), 1 deletion(-) diff --git a/direct/src/autorestart/CMakeLists.txt b/direct/src/autorestart/CMakeLists.txt index 31524487c55..eef609e69cf 100644 --- a/direct/src/autorestart/CMakeLists.txt +++ b/direct/src/autorestart/CMakeLists.txt @@ -1,3 +1,4 @@ add_executable(autorestart autorestart.c) set_target_properties(autorestart PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) target_link_libraries(autorestart p3dtool) +install(TARGETS autorestart DESTINATION bin) diff --git a/direct/src/dcparse/CMakeLists.txt b/direct/src/dcparse/CMakeLists.txt index a50ebdb3b1d..947c67dfecb 100644 --- a/direct/src/dcparse/CMakeLists.txt +++ b/direct/src/dcparse/CMakeLists.txt @@ -1,3 +1,4 @@ add_executable(dcparse dcparse.cxx) set_target_properties(dcparse PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) target_link_libraries(dcparse p3dcparser) +install(TARGETS dcparse DESTINATION bin) diff --git a/direct/src/dcparser/CMakeLists.txt b/direct/src/dcparser/CMakeLists.txt index 1838865b81c..36ef2541e07 100644 --- a/direct/src/dcparser/CMakeLists.txt +++ b/direct/src/dcparser/CMakeLists.txt @@ -51,3 +51,5 @@ add_library(p3dcparser ${P3DCPARSER_SOURCES} ${P3DCPARSER_HEADERS} set_target_properties(p3dcparser PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) target_link_libraries(p3dcparser p3directbase p3express p3pstatclient p3prc) target_interrogate(p3dcparser ${P3DCPARSER_SOURCES} ${P3DCPARSER_HEADERS}) + +install(TARGETS p3dcparser DESTINATION lib) diff --git a/direct/src/deadrec/CMakeLists.txt b/direct/src/deadrec/CMakeLists.txt index 043fc62cd61..669d98b28f8 100644 --- a/direct/src/deadrec/CMakeLists.txt +++ b/direct/src/deadrec/CMakeLists.txt @@ -9,3 +9,5 @@ set(P3DEADREC_SOURCES add_library(p3deadrec ${P3DEADREC_HEADERS} ${P3DEADREC_SOURCES}) target_link_libraries(p3deadrec p3directbase p3linmath p3pgraph p3prc) target_interrogate(p3deadrec ALL) + +install(TARGETS p3deadrec DESTINATION lib) diff --git a/direct/src/directbase/CMakeLists.txt b/direct/src/directbase/CMakeLists.txt index 1be8a56434f..3e1d332ab58 100644 --- a/direct/src/directbase/CMakeLists.txt +++ b/direct/src/directbase/CMakeLists.txt @@ -9,3 +9,5 @@ set(P3DIRECTBASE_HEADERS # Not worth compositing sources, there's really only one. add_library(p3directbase ${P3DIRECTBASE_SOURCES} ${P3DIRECTBASE_HEADERS}) target_link_libraries(p3directbase p3pandabase) + +install(TARGETS p3directbase DESTINATION lib) diff --git a/direct/src/distributed/CMakeLists.txt b/direct/src/distributed/CMakeLists.txt index 681004e608b..0da55087a15 100644 --- a/direct/src/distributed/CMakeLists.txt +++ b/direct/src/distributed/CMakeLists.txt @@ -21,4 +21,6 @@ if(HAVE_PYTHON) target_link_libraries(p3distributed p3net) endif() target_interrogate(p3distributed ALL) + + install(TARGETS p3distributed DESTINATION lib) endif() diff --git a/direct/src/interval/CMakeLists.txt b/direct/src/interval/CMakeLists.txt index 03b9feddf07..6931de86c92 100644 --- a/direct/src/interval/CMakeLists.txt +++ b/direct/src/interval/CMakeLists.txt @@ -39,3 +39,5 @@ 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) + +install(TARGETS p3interval DESTINATION lib) diff --git a/direct/src/showbase/CMakeLists.txt b/direct/src/showbase/CMakeLists.txt index 36e4f70b258..879a23918e8 100644 --- a/direct/src/showbase/CMakeLists.txt +++ b/direct/src/showbase/CMakeLists.txt @@ -1,3 +1,5 @@ add_library(p3showbase showBase.cxx showBase.h) target_link_libraries(p3showbase p3directbase p3express p3event p3chan p3display p3dconfig p3prc) target_interrogate(p3showbase ALL) + +install(TARGETS p3showbase DESTINATION lib) diff --git a/dtool/metalibs/dtool/CMakeLists.txt b/dtool/metalibs/dtool/CMakeLists.txt index 54f02f00459..1ace8556693 100644 --- a/dtool/metalibs/dtool/CMakeLists.txt +++ b/dtool/metalibs/dtool/CMakeLists.txt @@ -1,2 +1,4 @@ add_library(p3dtool dtool.cxx) target_link_libraries(p3dtool p3dtoolutil p3dtoolbase) + +install(TARGETS p3dtool DESTINATION lib) diff --git a/dtool/metalibs/dtoolconfig/CMakeLists.txt b/dtool/metalibs/dtoolconfig/CMakeLists.txt index 054d2095bcf..cf791fbde96 100644 --- a/dtool/metalibs/dtoolconfig/CMakeLists.txt +++ b/dtool/metalibs/dtoolconfig/CMakeLists.txt @@ -8,3 +8,5 @@ else() endif() target_link_libraries(p3dtoolconfig p3prc p3dconfig p3interrogatedb) + +install(TARGETS p3dtoolconfig DESTINATION lib) diff --git a/dtool/src/cppparser/CMakeLists.txt b/dtool/src/cppparser/CMakeLists.txt index 1e6ba9e511e..9e1f20a1863 100644 --- a/dtool/src/cppparser/CMakeLists.txt +++ b/dtool/src/cppparser/CMakeLists.txt @@ -40,3 +40,5 @@ composite_sources(p3cppParser P3CPPPARSER_SOURCES) add_library(p3cppParser STATIC ${P3CPPPARSER_HEADERS} ${P3CPPPARSER_SOURCES}) target_link_libraries(p3cppParser p3dtoolutil) + +install(TARGETS p3cppParser DESTINATION lib) diff --git a/dtool/src/dconfig/CMakeLists.txt b/dtool/src/dconfig/CMakeLists.txt index 7c71d68d82e..f07c356b587 100644 --- a/dtool/src/dconfig/CMakeLists.txt +++ b/dtool/src/dconfig/CMakeLists.txt @@ -8,3 +8,5 @@ composite_sources(p3dconfig P3DCONFIG_SOURCES) add_library(p3dconfig ${P3DCONFIG_HEADERS} ${P3DCONFIG_SOURCES}) target_link_libraries(p3dconfig p3prc) + +install(TARGETS p3dconfig DESTINATION lib) diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index 98c7ed19e92..8a93e833990 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -65,3 +65,5 @@ add_library(p3dtoolbase ${P3DTOOLBASE_HEADERS} ${P3DTOOLBASE_SOURCES}) if(HAVE_PYTHON) target_link_libraries(p3dtoolbase ${PYTHON_LIBRARIES}) endif() + +install(TARGETS p3dtoolbase DESTINATION lib) diff --git a/dtool/src/dtoolutil/CMakeLists.txt b/dtool/src/dtoolutil/CMakeLists.txt index a7c94098ace..04a4e0ce6c7 100644 --- a/dtool/src/dtoolutil/CMakeLists.txt +++ b/dtool/src/dtoolutil/CMakeLists.txt @@ -55,3 +55,5 @@ target_link_libraries(p3dtoolutil p3dtoolbase ${CMAKE_DL_LIBS}) if(HAVE_PYTHON) target_link_libraries(p3dtoolutil ${PYTHON_LIBRARIES}) endif() + +install(TARGETS p3dtoolutil DESTINATION lib) diff --git a/dtool/src/interrogate/CMakeLists.txt b/dtool/src/interrogate/CMakeLists.txt index f5404dc028d..7ff12f5850c 100644 --- a/dtool/src/interrogate/CMakeLists.txt +++ b/dtool/src/interrogate/CMakeLists.txt @@ -51,8 +51,10 @@ add_executable(interrogate ${INTERROGATE_HEADERS} ${INTERROGATE_SOURCES}) target_link_libraries(interrogate p3cppParser p3interrogatedb p3dconfig p3prc p3dtoolutil p3dtoolbase p3pystub ${_OPENSSL_LIBRARIES}) +install(TARGETS interrogate DESTINATION bin) add_executable(interrogate_module interrogate_module.cxx) target_link_libraries(interrogate_module p3cppParser p3interrogatedb p3dconfig p3prc p3dtoolutil p3dtoolbase p3pystub ${OPENSSL_LIBRARIES}) +install(TARGETS interrogate DESTINATION bin) diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index 58477d2ad75..01b34cd51f0 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -31,3 +31,5 @@ composite_sources(p3interrogatedb P3INTERROGATEDB_SOURCES) add_library(p3interrogatedb ${P3INTERROGATEDB_HEADERS} ${P3INTERROGATEDB_SOURCES}) target_link_libraries(p3interrogatedb p3dconfig ${PYTHON_LIBRARIES}) + +install(TARGETS p3interrogatedb DESTINATION lib) diff --git a/dtool/src/prc/CMakeLists.txt b/dtool/src/prc/CMakeLists.txt index 57cea800b0f..ad2213024f0 100644 --- a/dtool/src/prc/CMakeLists.txt +++ b/dtool/src/prc/CMakeLists.txt @@ -66,3 +66,5 @@ composite_sources(p3prc P3PRC_SOURCES) add_library(p3prc ${P3PRC_HEADERS} ${P3PRC_SOURCES}) target_link_libraries(p3prc p3dtoolutil p3dtoolbase ${_OPENSSL_LIBRARIES}) + +install(TARGETS p3prc DESTINATION lib) diff --git a/panda/metalibs/panda/CMakeLists.txt b/panda/metalibs/panda/CMakeLists.txt index cd62d585c87..3170a4717e0 100644 --- a/panda/metalibs/panda/CMakeLists.txt +++ b/panda/metalibs/panda/CMakeLists.txt @@ -11,3 +11,5 @@ endif() add_library(panda panda.cxx) target_link_libraries(panda ${PANDA_LINK_TARGETS}) + +install(TARGETS panda DESTINATION lib) diff --git a/panda/metalibs/pandaegg/CMakeLists.txt b/panda/metalibs/pandaegg/CMakeLists.txt index 3d17cbfd10f..a8684b4fe92 100644 --- a/panda/metalibs/pandaegg/CMakeLists.txt +++ b/panda/metalibs/pandaegg/CMakeLists.txt @@ -3,4 +3,6 @@ if(HAVE_EGG) add_library(pandaegg pandaegg.cxx) target_link_libraries(pandaegg ${PANDAEGG_LINK_TARGETS}) + + install(TARGETS pandaegg DESTINATION lib) endif() diff --git a/panda/metalibs/pandagl/CMakeLists.txt b/panda/metalibs/pandagl/CMakeLists.txt index 96eb7465cc8..2134f350ebb 100644 --- a/panda/metalibs/pandagl/CMakeLists.txt +++ b/panda/metalibs/pandagl/CMakeLists.txt @@ -17,4 +17,6 @@ if(HAVE_GL) add_library(pandagl pandagl.cxx) target_link_libraries(pandagl ${PANDAGL_LINK_TARGETS}) + + install(TARGETS pandagl DESTINATION lib) endif() diff --git a/panda/src/audio/CMakeLists.txt b/panda/src/audio/CMakeLists.txt index 9503acc7834..b674c313f73 100644 --- a/panda/src/audio/CMakeLists.txt +++ b/panda/src/audio/CMakeLists.txt @@ -21,4 +21,6 @@ if(HAVE_AUDIO) add_library(p3audio ${P3AUDIO_HEADERS} ${P3AUDIO_SOURCES}) target_link_libraries(p3audio p3putil p3event p3movies p3linmath) target_interrogate(p3audio ALL) + + install(TARGETS p3audio DESTINATION lib) endif() diff --git a/panda/src/chan/CMakeLists.txt b/panda/src/chan/CMakeLists.txt index 53f4f64fc94..4bf13ea0c62 100644 --- a/panda/src/chan/CMakeLists.txt +++ b/panda/src/chan/CMakeLists.txt @@ -54,3 +54,5 @@ composite_sources(p3chan P3CHAN_SOURCES) add_library(p3chan ${P3CHAN_HEADERS} ${P3CHAN_SOURCES}) target_link_libraries(p3chan p3pgraph) target_interrogate(p3chan ALL) + +install(TARGETS p3chan DESTINATION lib) diff --git a/panda/src/char/CMakeLists.txt b/panda/src/char/CMakeLists.txt index 421573ed54c..8196969d63b 100644 --- a/panda/src/char/CMakeLists.txt +++ b/panda/src/char/CMakeLists.txt @@ -22,3 +22,5 @@ composite_sources(p3char P3CHAR_SOURCES) add_library(p3char ${P3CHAR_HEADERS} ${P3CHAR_SOURCES}) target_link_libraries(p3char p3chan) target_interrogate(p3char ALL) + +install(TARGETS p3char DESTINATION lib) diff --git a/panda/src/collide/CMakeLists.txt b/panda/src/collide/CMakeLists.txt index 3b557b981b9..dd3994ff9b0 100644 --- a/panda/src/collide/CMakeLists.txt +++ b/panda/src/collide/CMakeLists.txt @@ -67,6 +67,8 @@ add_library(p3collide ${P3COLLIDE_SOURCES} ${P3COLLIDE_HEADERS}) target_link_libraries(p3collide p3tform) target_interrogate(p3collide ALL) +install(TARGETS p3collide DESTINATION lib) + #begin test_bin_target #define TARGET test_collide #define LOCAL_LIBS diff --git a/panda/src/cull/CMakeLists.txt b/panda/src/cull/CMakeLists.txt index f41ca915a8d..4b8001920fb 100644 --- a/panda/src/cull/CMakeLists.txt +++ b/panda/src/cull/CMakeLists.txt @@ -24,3 +24,5 @@ composite_sources(p3cull P3CULL_SOURCES) add_library(p3cull ${P3CULL_HEADERS} ${P3CULL_SOURCES}) target_link_libraries(p3cull p3pgraph) target_interrogate(p3cull ALL) + +install(TARGETS p3cull DESTINATION lib) diff --git a/panda/src/device/CMakeLists.txt b/panda/src/device/CMakeLists.txt index 0b7eaedb1e9..16dc4b9164c 100644 --- a/panda/src/device/CMakeLists.txt +++ b/panda/src/device/CMakeLists.txt @@ -30,3 +30,5 @@ composite_sources(p3device P3DEVICE_SOURCES) add_library(p3device ${P3DEVICE_SOURCES} ${P3DEVICE_HEADERS}) target_link_libraries(p3device p3dgraph p3display) target_interrogate(p3device ALL) + +install(TARGETS p3device DESTINATION lib) diff --git a/panda/src/dgraph/CMakeLists.txt b/panda/src/dgraph/CMakeLists.txt index 0117da03346..c085c0e8e14 100644 --- a/panda/src/dgraph/CMakeLists.txt +++ b/panda/src/dgraph/CMakeLists.txt @@ -15,3 +15,5 @@ composite_sources(p3dgraph P3DGRAPH_SOURCES) add_library(p3dgraph ${P3DGRAPH_SOURCES} ${P3DGRAPH_HEADERS}) target_link_libraries(p3dgraph p3pgraph) target_interrogate(p3dgraph ALL) + +install(TARGETS p3dgraph DESTINATION lib) diff --git a/panda/src/display/CMakeLists.txt b/panda/src/display/CMakeLists.txt index b9f9813cc3f..106fab56463 100644 --- a/panda/src/display/CMakeLists.txt +++ b/panda/src/display/CMakeLists.txt @@ -91,6 +91,8 @@ add_library(p3display ${P3DISPLAY_HEADERS} ${P3DISPLAY_SOURCES}) target_link_libraries(p3display p3cull p3pgraphnodes) target_interrogate(p3display ALL) +install(TARGETS p3display DESTINATION lib) + if(OSX_PLATFORM AND HAVE_P3D_PLUGIN) # We build a static library of just these files, so the plugin can # link with it in direct/src/plugin, without pulling in the rest of diff --git a/panda/src/downloader/CMakeLists.txt b/panda/src/downloader/CMakeLists.txt index 03c03b418de..cc4c747f920 100644 --- a/panda/src/downloader/CMakeLists.txt +++ b/panda/src/downloader/CMakeLists.txt @@ -66,3 +66,5 @@ composite_sources(p3downloader P3DOWNLOADER_SOURCES) add_library(p3downloader ${P3DOWNLOADER_SOURCES} ${P3DOWNLOADER_HEADERS}) target_link_libraries(p3downloader p3express) target_interrogate(p3downloader ALL) + +install(TARGETS p3downloader DESTINATION lib) diff --git a/panda/src/egg/CMakeLists.txt b/panda/src/egg/CMakeLists.txt index c397beb6b40..99103a9e54a 100644 --- a/panda/src/egg/CMakeLists.txt +++ b/panda/src/egg/CMakeLists.txt @@ -97,4 +97,6 @@ if(HAVE_EGG) add_library(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES} ${P3EGG_PARSER_SOURCES}) target_link_libraries(p3egg p3prc p3pandabase p3express p3linmath p3mathutil) target_interrogate(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES}) + + install(TARGETS p3egg DESTINATION lib) endif() diff --git a/panda/src/egg2pg/CMakeLists.txt b/panda/src/egg2pg/CMakeLists.txt index 877cd20e12b..71d91c33657 100644 --- a/panda/src/egg2pg/CMakeLists.txt +++ b/panda/src/egg2pg/CMakeLists.txt @@ -33,4 +33,6 @@ if(HAVE_EGG) add_library(p3egg2pg ${P3EGG2PG_HEADERS} ${P3EGG2PG_SOURCES}) target_link_libraries(p3egg2pg p3parametrics p3collide p3egg p3pgraph p3chan p3char) target_interrogate(p3egg2pg ALL) + + install(TARGETS p3egg2pg DESTINATION lib) endif() diff --git a/panda/src/event/CMakeLists.txt b/panda/src/event/CMakeLists.txt index 3a3b2933561..d3cc6dff516 100644 --- a/panda/src/event/CMakeLists.txt +++ b/panda/src/event/CMakeLists.txt @@ -41,6 +41,8 @@ add_library(p3event ${P3EVENT_HEADERS} ${P3EVENT_SOURCES}) target_link_libraries(p3event p3linmath p3pstatclient) target_interrogate(p3event ALL) +install(TARGETS p3event DESTINATION lib) + #begin test_bin_target #define TARGET test_task #define LOCAL_LIBS $[LOCAL_LIBS] p3mathutil @@ -51,4 +53,4 @@ target_interrogate(p3event ALL) #define SOURCES \ # test_task.cxx -#end test_bin_target \ No newline at end of file +#end test_bin_target diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index 34645871ae7..631078215f6 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -130,6 +130,8 @@ target_link_libraries(p3express p3pandabase p3dtool p3dtoolconfig ${_TAR_LIBRARY}) target_interrogate(p3express ALL) +install(TARGETS p3express DESTINATION lib) + #add_executable(p3expressTestTypes test_types.cxx) #target_link_libraries(p3expressTestTypes p3express p3dtoolutil p3dtool p3prc p3dtoolconfig p3pystub) #add_test(p3express_test_types p3expressTestTypes) diff --git a/panda/src/framework/CMakeLists.txt b/panda/src/framework/CMakeLists.txt index 1863f00ff06..75ececfec90 100644 --- a/panda/src/framework/CMakeLists.txt +++ b/panda/src/framework/CMakeLists.txt @@ -58,3 +58,5 @@ endif() composite_sources(p3framework P3FRAMEWORK_SOURCES) add_library(p3framework ${P3FRAMEWORK_HEADERS} ${P3FRAMEWORK_SOURCES}) target_link_libraries(p3framework ${P3FRAMEWORK_LINK_TARGETS}) + +install(TARGETS p3framework DESTINATION lib) diff --git a/panda/src/glgsg/CMakeLists.txt b/panda/src/glgsg/CMakeLists.txt index 6f2fbd9aa71..676ee264eb3 100644 --- a/panda/src/glgsg/CMakeLists.txt +++ b/panda/src/glgsg/CMakeLists.txt @@ -12,4 +12,6 @@ if(HAVE_GL) add_library(p3glgsg ${P3GLGSG_HEADERS} ${P3GLGSG_SOURCES}) target_link_libraries(p3glgsg p3glstuff p3display ${OPENGL_LIBRARIES} ${_CG_LIBRARIES}) + + install(TARGETS p3glgsg DESTINATION lib) endif() diff --git a/panda/src/glstuff/CMakeLists.txt b/panda/src/glstuff/CMakeLists.txt index dd983c08019..527e9e827fd 100644 --- a/panda/src/glstuff/CMakeLists.txt +++ b/panda/src/glstuff/CMakeLists.txt @@ -33,4 +33,6 @@ if(HAVE_GL) composite_sources(p3glstuff P3GLSTUFF_SOURCES) add_library(p3glstuff ${P3GLSTUFF_HEADERS} ${P3GLSTUFF_SOURCES}) target_link_libraries(p3glstuff p3pandabase p3gobj) + + install(TARGETS p3glstuff DESTINATION lib) endif() diff --git a/panda/src/glxdisplay/CMakeLists.txt b/panda/src/glxdisplay/CMakeLists.txt index 975be01ad44..b7f6019786d 100644 --- a/panda/src/glxdisplay/CMakeLists.txt +++ b/panda/src/glxdisplay/CMakeLists.txt @@ -23,4 +23,6 @@ if(HAVE_GLX) composite_sources(p3glxdisplay P3GLXDISPLAY_SOURCES) add_library(p3glxdisplay ${P3GLXDISPLAY_HEADERS} ${P3GLXDISPLAY_SOURCES}) target_link_libraries(p3glxdisplay p3glgsg p3x11display) + + install(TARGETS p3glxdisplay DESTINATION lib) endif() diff --git a/panda/src/gobj/CMakeLists.txt b/panda/src/gobj/CMakeLists.txt index 52ab97b586f..2cdb133c77d 100644 --- a/panda/src/gobj/CMakeLists.txt +++ b/panda/src/gobj/CMakeLists.txt @@ -147,6 +147,8 @@ target_link_libraries(p3gobj p3gsgbase p3pnmimage ${_ZLIB_LIBRARIES} ${_SQUISH_LIBRARY} ${_CG_LIBRARIES}) target_interrogate(p3gobj ALL) +install(TARGETS p3gobj DESTINATION lib) + #begin test_bin_target #define TARGET test_gobj #define LOCAL_LIBS \ diff --git a/panda/src/grutil/CMakeLists.txt b/panda/src/grutil/CMakeLists.txt index d4f2087cd3d..cb9bfa75d8a 100644 --- a/panda/src/grutil/CMakeLists.txt +++ b/panda/src/grutil/CMakeLists.txt @@ -42,3 +42,5 @@ if(HAVE_AUDIO) target_link_libraries(p3grutil p3audio) endif() target_interrogate(p3grutil ALL) + +install(TARGETS p3grutil DESTINATION lib) diff --git a/panda/src/gsgbase/CMakeLists.txt b/panda/src/gsgbase/CMakeLists.txt index 53ba50d152d..8c5d8cf105f 100644 --- a/panda/src/gsgbase/CMakeLists.txt +++ b/panda/src/gsgbase/CMakeLists.txt @@ -17,6 +17,8 @@ add_library(p3gsgbase ${P3GSGBASE_HEADERS} ${P3GSGBASE_SOURCES}) target_link_libraries(p3gsgbase p3linmath) target_interrogate(p3gsgbase ALL) +install(TARGETS p3gsgbase DESTINATION lib) + #begin test_bin_target #define TARGET test_gsgbase #define LOCAL_LIBS diff --git a/panda/src/linmath/CMakeLists.txt b/panda/src/linmath/CMakeLists.txt index 5b08370b994..630ea6e7ceb 100644 --- a/panda/src/linmath/CMakeLists.txt +++ b/panda/src/linmath/CMakeLists.txt @@ -47,6 +47,8 @@ add_library(p3linmath ${P3LINMATH_HEADERS} ${P3LINMATH_SOURCES}) target_link_libraries(p3linmath p3putil) target_interrogate(p3linmath ALL) +install(TARGETS p3linmath DESTINATION lib) + #begin test_bin_target #define TARGET test_math #define LOCAL_LIBS \ diff --git a/panda/src/mathutil/CMakeLists.txt b/panda/src/mathutil/CMakeLists.txt index 0df47736819..7a482eda353 100644 --- a/panda/src/mathutil/CMakeLists.txt +++ b/panda/src/mathutil/CMakeLists.txt @@ -65,6 +65,8 @@ add_library(p3mathutil ${P3MATHUTIL_HEADERS} ${P3MATHUTIL_SOURCES}) target_link_libraries(p3mathutil p3event ${FFTW2_LIBRARY_DIR}) target_interrogate(p3mathutil ALL) +install(TARGETS p3mathutil DESTINATION lib) + #begin test_bin_target #define TARGET test_mathutil #define LOCAL_LIBS \ diff --git a/panda/src/movies/CMakeLists.txt b/panda/src/movies/CMakeLists.txt index 4ae884c0122..3f31767fa00 100644 --- a/panda/src/movies/CMakeLists.txt +++ b/panda/src/movies/CMakeLists.txt @@ -37,3 +37,5 @@ 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) + +install(TARGETS p3movies DESTINATION lib) diff --git a/panda/src/nativenet/CMakeLists.txt b/panda/src/nativenet/CMakeLists.txt index 3e133614101..565d4ccb1c9 100644 --- a/panda/src/nativenet/CMakeLists.txt +++ b/panda/src/nativenet/CMakeLists.txt @@ -27,4 +27,6 @@ if(WANT_NATIVE_NET) add_library(p3nativenet ${P3NATIVENET_HEADERS} ${P3NATIVENET_SOURCES}) target_link_libraries(p3nativenet p3express p3pandabase) target_interrogate(p3nativenet ALL) + + install(TARGETS p3nativenet DESTINATION lib) endif() diff --git a/panda/src/net/CMakeLists.txt b/panda/src/net/CMakeLists.txt index 9fec4780fc1..68eac476344 100644 --- a/panda/src/net/CMakeLists.txt +++ b/panda/src/net/CMakeLists.txt @@ -29,4 +29,6 @@ if(HAVE_NET AND WANT_NATIVE_NET) add_library(p3net ${P3NET_HEADERS} ${P3NET_SOURCES}) target_link_libraries(p3net p3express p3downloader p3pandabase p3nativenet p3pipeline) target_interrogate(p3net ALL) + + install(TARGETS p3net DESTINATION lib) endif() diff --git a/panda/src/pandabase/CMakeLists.txt b/panda/src/pandabase/CMakeLists.txt index bcb2d1f85d2..d43bb13e178 100644 --- a/panda/src/pandabase/CMakeLists.txt +++ b/panda/src/pandabase/CMakeLists.txt @@ -8,3 +8,5 @@ set(P3PANDABASE_SOURCES add_library(p3pandabase ${P3PANDABASE_HEADERS} ${P3PANDABASE_SOURCES}) target_link_libraries(p3pandabase p3dtoolbase) + +install(TARGETS p3pandabase DESTINATION lib) diff --git a/panda/src/parametrics/CMakeLists.txt b/panda/src/parametrics/CMakeLists.txt index 5b204e752bc..1a61873e96e 100644 --- a/panda/src/parametrics/CMakeLists.txt +++ b/panda/src/parametrics/CMakeLists.txt @@ -38,6 +38,8 @@ add_library(p3parametrics ${P3PARAMETRICS_SOURCES} ${P3PARAMETRICS_HEADERS}) target_link_libraries(p3parametrics p3pgraph) target_interrogate(p3parametrics ALL) +install(TARGETS p3parametrics DESTINATION lib) + #begin test_bin_target #define TARGET test_parametrics #define LOCAL_LIBS diff --git a/panda/src/pgraph/CMakeLists.txt b/panda/src/pgraph/CMakeLists.txt index 0eeb65dddcf..c75b90c9665 100644 --- a/panda/src/pgraph/CMakeLists.txt +++ b/panda/src/pgraph/CMakeLists.txt @@ -201,6 +201,8 @@ add_library(p3pgraph ${P3PGRAPH_HEADERS} ${P3PGRAPH_SOURCES}) target_link_libraries(p3pgraph p3gobj p3event p3gsgbase p3putil p3linmath p3downloader) target_interrogate(p3pgraph ALL) +install(TARGETS p3pgraph DESTINATION lib) + #begin test_bin_target #define TARGET test_pgraph diff --git a/panda/src/pgraphnodes/CMakeLists.txt b/panda/src/pgraphnodes/CMakeLists.txt index 22961aa9f1b..1f42f992e45 100644 --- a/panda/src/pgraphnodes/CMakeLists.txt +++ b/panda/src/pgraphnodes/CMakeLists.txt @@ -42,3 +42,5 @@ composite_sources(p3pgraphnodes P3PGRAPHNODES_SOURCES) add_library(p3pgraphnodes ${P3PGRAPHNODES_HEADERS} ${P3PGRAPHNODES_SOURCES}) target_link_libraries(p3pgraphnodes p3pgraph) target_interrogate(p3pgraphnodes ALL) + +install(TARGETS p3pgraphnodes DESTINATION lib) diff --git a/panda/src/pgui/CMakeLists.txt b/panda/src/pgui/CMakeLists.txt index 55839744cba..15bbfdb736d 100644 --- a/panda/src/pgui/CMakeLists.txt +++ b/panda/src/pgui/CMakeLists.txt @@ -44,6 +44,8 @@ add_library(p3pgui ${P3PGUI_SOURCES} ${P3PGUI_HEADERS}) target_link_libraries(p3pgui p3tform) target_interrogate(p3pgui ALL) +install(TARGETS p3pgui DESTINATION lib) + #begin test_bin_target #define TARGET test_pgentry diff --git a/panda/src/pipeline/CMakeLists.txt b/panda/src/pipeline/CMakeLists.txt index 2f008e5d41e..29e5dfc586d 100644 --- a/panda/src/pipeline/CMakeLists.txt +++ b/panda/src/pipeline/CMakeLists.txt @@ -140,6 +140,8 @@ add_library(p3pipeline ${P3PIPELINE_HEADERS} ${P3PIPELINE_SOURCES}) target_link_libraries(p3pipeline p3express) target_interrogate(p3pipeline ALL) +install(TARGETS p3pipeline DESTINATION lib) + #begin test_bin_target #define TARGET test_threaddata #define LOCAL_LIBS $[LOCAL_LIBS] p3pipeline diff --git a/panda/src/pnmimage/CMakeLists.txt b/panda/src/pnmimage/CMakeLists.txt index e23f01f69a2..52f6246a2d6 100644 --- a/panda/src/pnmimage/CMakeLists.txt +++ b/panda/src/pnmimage/CMakeLists.txt @@ -28,3 +28,5 @@ composite_sources(p3pnmimage P3PNMIMAGE_SOURCES) add_library(p3pnmimage ${P3PNMIMAGE_HEADERS} ${P3PNMIMAGE_SOURCES}) target_link_libraries(p3pnmimage p3mathutil) target_interrogate(p3pnmimage ALL) + +install(TARGETS p3pnmimage DESTINATION lib) diff --git a/panda/src/pnmimagetypes/CMakeLists.txt b/panda/src/pnmimagetypes/CMakeLists.txt index 295cba0ddb0..680b767ecb5 100644 --- a/panda/src/pnmimagetypes/CMakeLists.txt +++ b/panda/src/pnmimagetypes/CMakeLists.txt @@ -30,3 +30,5 @@ composite_sources(p3pnmimagetypes P3PNMIMAGETYPES_SOURCES) add_library(p3pnmimagetypes ${P3PNMIMAGETYPES_HEADERS} ${P3PNMIMAGETYPES_SOURCES}) target_link_libraries(p3pnmimagetypes p3pnmimage ${_JPEG_LIBRARIES} ${_TIFF_LIBRARIES} ${_PNG_LIBRARIES}) + +install(TARGETS p3pnmimagetypes DESTINATION lib) diff --git a/panda/src/pnmtext/CMakeLists.txt b/panda/src/pnmtext/CMakeLists.txt index 534b9a80e32..9af9df27146 100644 --- a/panda/src/pnmtext/CMakeLists.txt +++ b/panda/src/pnmtext/CMakeLists.txt @@ -17,3 +17,5 @@ composite_sources(p3pnmtext P3PNMTEXT_SOURCES) add_library(p3pnmtext ${P3PNMTEXT_SOURCES} ${P3PNMTEXT_HEADERS}) target_link_libraries(p3pnmtext p3pnmimage ${_FREETYPE_LIBRARIES}) target_interrogate(p3pnmtext ALL) + +install(TARGETS p3pnmtext DESTINATION lib) diff --git a/panda/src/pstatclient/CMakeLists.txt b/panda/src/pstatclient/CMakeLists.txt index 13f8e8ae3d4..007e73d03cc 100644 --- a/panda/src/pstatclient/CMakeLists.txt +++ b/panda/src/pstatclient/CMakeLists.txt @@ -27,6 +27,8 @@ add_library(p3pstatclient ${P3PSTATCLIENT_HEADERS} ${P3PSTATCLIENT_SOURCES}) target_link_libraries(p3pstatclient p3putil) target_interrogate(p3pstatclient ALL) +install(TARGETS p3pstatclient DESTINATION lib) + #begin test_bin_target #define LOCAL_LIBS \ # p3pstatclient diff --git a/panda/src/putil/CMakeLists.txt b/panda/src/putil/CMakeLists.txt index c77cac1d7d6..116522b457a 100644 --- a/panda/src/putil/CMakeLists.txt +++ b/panda/src/putil/CMakeLists.txt @@ -117,6 +117,8 @@ add_library(p3putil ${P3PUTIL_HEADERS} ${P3PUTIL_SOURCES}) target_link_libraries(p3putil p3pipeline) target_interrogate(p3putil ALL) +install(TARGETS p3putil DESTINATION lib) + #begin test_bin_target #define TARGET test_bamRead #define LOCAL_LIBS diff --git a/panda/src/recorder/CMakeLists.txt b/panda/src/recorder/CMakeLists.txt index 8289ef7ecb3..8590e3ab832 100644 --- a/panda/src/recorder/CMakeLists.txt +++ b/panda/src/recorder/CMakeLists.txt @@ -20,3 +20,5 @@ composite_sources(p3recorder P3RECORDER_SOURCES) add_library(p3recorder ${P3RECORDER_SOURCES} ${P3RECORDER_HEADERS}) target_link_libraries(p3recorder p3dgraph p3downloader) target_interrogate(p3recorder ALL) + +install(TARGETS p3recorder DESTINATION lib) diff --git a/panda/src/testbed/CMakeLists.txt b/panda/src/testbed/CMakeLists.txt index e7b659bb179..21e15e788ce 100644 --- a/panda/src/testbed/CMakeLists.txt +++ b/panda/src/testbed/CMakeLists.txt @@ -1,5 +1,6 @@ add_executable(pview pview.cxx) target_link_libraries(pview p3framework p3pystub) +install(TARGETS pview DESTINATION bin) #begin test_bin_target #define TARGET pgrid diff --git a/panda/src/text/CMakeLists.txt b/panda/src/text/CMakeLists.txt index 1815b6e529f..5bbe2e8ef16 100644 --- a/panda/src/text/CMakeLists.txt +++ b/panda/src/text/CMakeLists.txt @@ -36,3 +36,5 @@ composite_sources(p3text P3TEXT_SOURCES) add_library(p3text ${P3TEXT_SOURCES} ${P3TEXT_HEADERS}) target_link_libraries(p3text p3pnmtext p3parametrics ${_FREETYPE_LIBRARIES}) target_interrogate(p3text ALL) + +install(TARGETS p3text DESTINATION lib) diff --git a/panda/src/tform/CMakeLists.txt b/panda/src/tform/CMakeLists.txt index 1de7ffe2370..abc730148b3 100644 --- a/panda/src/tform/CMakeLists.txt +++ b/panda/src/tform/CMakeLists.txt @@ -28,3 +28,5 @@ composite_sources(p3tform P3TFORM_SOURCES) add_library(p3tform ${P3TFORM_SOURCES} ${P3TFORM_HEADERS}) target_link_libraries(p3tform p3device p3grutil) target_interrogate(p3tform ALL) + +install(TARGETS p3tform DESTINATION lib) diff --git a/panda/src/x11display/CMakeLists.txt b/panda/src/x11display/CMakeLists.txt index bae6e338fc5..8c66448497e 100644 --- a/panda/src/x11display/CMakeLists.txt +++ b/panda/src/x11display/CMakeLists.txt @@ -11,4 +11,6 @@ if(HAVE_X11) composite_sources(p3x11display P3X11DISPLAY_SOURCES) add_library(p3x11display ${P3X11DISPLAY_HEADERS} ${P3X11DISPLAY_SOURCES}) target_link_libraries(p3x11display p3display ${X11_LIBRARIES}) + + install(TARGETS p3x11display DESTINATION lib) endif() From 1d2561b0121ae51db2462f85b411f86f883514dc Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 4 Feb 2014 23:10:56 -0700 Subject: [PATCH 02/12] CMake: Install the Interrogated _igate libraries. (Temporary; part of the dependency hack.) --- cmake/macros/Interrogate.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 3a9c9982261..b4b98121153 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -241,6 +241,7 @@ function(add_python_module module) # against the component library in question. add_library(${target}_igate ${target}_igate.cxx) list(APPEND HACKlinklibs "${target}_igate") + install(TARGETS ${target}_igate DESTINATION lib) get_target_property(target_links "${target}" LINK_LIBRARIES) target_link_libraries(${target}_igate ${target_links}) From f5f2f39a30054d2199e0fd7c1a51b562bbfe2f0b Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 5 Feb 2014 18:09:18 -0700 Subject: [PATCH 03/12] CMake: Remove PYTHON_LIBRARIES link from interrogatedb; it's unused there. --- dtool/src/interrogatedb/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index 01b34cd51f0..5de820961d0 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -30,6 +30,6 @@ set(P3INTERROGATEDB_SOURCES composite_sources(p3interrogatedb P3INTERROGATEDB_SOURCES) add_library(p3interrogatedb ${P3INTERROGATEDB_HEADERS} ${P3INTERROGATEDB_SOURCES}) -target_link_libraries(p3interrogatedb p3dconfig ${PYTHON_LIBRARIES}) +target_link_libraries(p3interrogatedb p3dconfig) install(TARGETS p3interrogatedb DESTINATION lib) From 50a6ab2a4d0a9aa0f4f1f441e4593a85b29449df Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 5 Feb 2014 22:27:46 -0700 Subject: [PATCH 04/12] CMake: Rearrange panda/CMakeLists.txt for dependency order; older CMakes insist on it. --- panda/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index da3023c357f..1a0c7ded181 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -29,10 +29,6 @@ add_subdirectory(src/linmath) add_subdirectory(src/event) add_subdirectory(src/mathutil) add_subdirectory(src/gsgbase) -add_subdirectory(src/glstuff) -add_subdirectory(src/glgsg) -add_subdirectory(src/glxdisplay) -add_subdirectory(src/x11display) add_subdirectory(src/pnmimage) add_subdirectory(src/pnmimagetypes) add_subdirectory(src/gobj) @@ -40,6 +36,10 @@ add_subdirectory(src/pgraph) add_subdirectory(src/pgraphnodes) add_subdirectory(src/cull) add_subdirectory(src/display) +add_subdirectory(src/glstuff) +add_subdirectory(src/glgsg) +add_subdirectory(src/x11display) +add_subdirectory(src/glxdisplay) add_subdirectory(src/movies) add_subdirectory(src/audio) add_subdirectory(src/chan) From cc7e03f5eb56c74f4c0806eb06007852c2af3f87 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 6 Feb 2014 13:37:46 -0700 Subject: [PATCH 05/12] CMake: Fix typo. --- dtool/src/interrogate/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dtool/src/interrogate/CMakeLists.txt b/dtool/src/interrogate/CMakeLists.txt index 7ff12f5850c..ce48803a043 100644 --- a/dtool/src/interrogate/CMakeLists.txt +++ b/dtool/src/interrogate/CMakeLists.txt @@ -56,5 +56,5 @@ install(TARGETS interrogate DESTINATION bin) add_executable(interrogate_module interrogate_module.cxx) target_link_libraries(interrogate_module p3cppParser p3interrogatedb p3dconfig p3prc p3dtoolutil p3dtoolbase - p3pystub ${OPENSSL_LIBRARIES}) + p3pystub ${_OPENSSL_LIBRARIES}) install(TARGETS interrogate DESTINATION bin) From 6e0dc789b6a42cf62194a0cc8f23fea278940f67 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 6 Feb 2014 16:32:37 -0700 Subject: [PATCH 06/12] CMake: Rearrange root CMakeLists; some includes may depend on dtool config. --- CMakeLists.txt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c242ea0160..80561e21826 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,22 +9,24 @@ enable_testing() set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/macros/") +# Include global modules needed for configure scripts +include(PackageConfig) # Defines package_option AND target_use_packages + +# Configure Panda3D +include(dtool/PandaVersion.cmake) +include(dtool/Package.cmake) +include(dtool/Config.cmake) + # Include global modules include(AutoInclude) # Implements automatic include_directories finding include(AddBisonTarget) # Defines add_bison_target function include(AddFlexTarget) # Defines add_flex_target function include(CompositeSources) # Defines composite_sources function -include(PackageConfig) # Defines package_option AND target_use_packages include(Interrogate) # Defines target_interrogate AND add_python_module # Add the include path for source and header files generated by CMake include_directories("${CMAKE_BINARY_DIR}/include") -# Configure Panda3D -include(dtool/PandaVersion.cmake) -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) From 5e78a80acc732546bfc4a7366a349333d3e32627 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 6 Feb 2014 16:33:27 -0700 Subject: [PATCH 07/12] CMake: When HAVE_PYTHON, detect the Python install directories. Also, only include Python directories if HAVE_PYTHON. --- dtool/Config.cmake | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index f2dfa07993e..a5595f22fca 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -437,9 +437,28 @@ package_option(PYTHON DEFAULT ON "Enables support for Python. If INTERROGATE_PYTHON_INTERFACE is also enabled, Python bindings will be generated.") -# Always include Python, because we include it pretty much everywhere -# though we don't usually want to link it in as well. -include_directories(${PYTHON_INCLUDE_DIRS}) +# Also detect the optimal install paths: +if(HAVE_PYTHON) + execute_process( + COMMAND ${PYTHON_EXECUTABLE} + -c "from distutils.sysconfig import get_python_lib; print get_python_lib(False)" + OUTPUT_VARIABLE _LIB_DIR) + execute_process( + COMMAND ${PYTHON_EXECUTABLE} + -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True)" + OUTPUT_VARIABLE _ARCH_DIR) + + set(PYTHON_LIB_INSTALL_DIR "${_LIB_DIR}" CACHE STRING + "Path to the Python architecture-independent package directory.") + + set(PYTHON_ARCH_INSTALL_DIR "${_ARCH_DIR}" CACHE STRING + "Path to the Python architecture-dependent package directory.") + + # Always include Python, because we include it pretty much everywhere + # though we don't usually want to link it in as well. + include_directories(${PYTHON_INCLUDE_DIRS}) +endif() + # By default, we'll assume the user only wants to run with Debug # python if he has to--that is, on Windows when building a debug build. From e5a6259e46f47a0335014e84bed0883e850d3b72 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 6 Feb 2014 16:33:34 -0700 Subject: [PATCH 08/12] CMake: Get Interrogated modules to install. --- cmake/macros/Interrogate.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index b4b98121153..8fdb80e2ddd 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -272,3 +272,14 @@ function(add_python_module module) endif() endif() endfunction(add_python_module) + + +if(HAVE_PYTHON) + # We have to create an __init__.py so that Python 2.x can recognize 'panda3d' + # as a package. + file(WRITE "${PROJECT_BINARY_DIR}/panda3d/__init__.py" "") + + # The Interrogate path needs to be installed to the architecture-dependent + # Python directory. + install(DIRECTORY "${PROJECT_BINARY_DIR}/panda3d" DESTINATION "${PYTHON_LIB_INSTALL_DIR}") +endif() From 6c5dcb0a7536c176f6266156fd6c26d8e6c4bd23 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 7 Feb 2014 13:36:03 -0700 Subject: [PATCH 09/12] CMake: Install 'direct'. --- direct/CMakeLists.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 904bf6f9aef..e14c11ad144 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -14,3 +14,25 @@ add_subdirectory(src/interval) add_subdirectory(src/showbase) add_python_module(direct p3dcparser p3deadrec p3distributed p3interval p3showbase) + +# Installation: +if(HAVE_PYTHON) + set(DIRECT_INSTALL_DIRECTORIES + actor cluster controls directbase directdevices directnotify directscripts + directtools directutil distributed extensions extensions_native ffi filter + fsm gui http interval leveleditor motiontrail p3d particles physics pyinst + showbase showutil stdpy task test tkpanels tkwidgets wxwidgets) + + foreach(dir ${DIRECT_INSTALL_DIRECTORIES}) + install( + DIRECTORY "src/${dir}" + DESTINATION "${PYTHON_LIB_INSTALL_DIR}/direct" + PATTERN "*.py") + endforeach() + + # We also need an __init__.py file, which we have to generate: + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/__init__.py" "") + install( + FILES "${CMAKE_CURRENT_BINARY_DIR}/__init__.py" + DESTINATION "${PYTHON_LIB_INSTALL_DIR}/direct") +endif() From 9fc2e6829b31e4f5153b8cd70c8cd2c8debe80c0 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 7 Feb 2014 14:30:46 -0700 Subject: [PATCH 10/12] CMake: Generate and install 'pandac' for backwards-compatibility. --- cmake/macros/Interrogate.cmake | 7 ++++++- direct/CMakeLists.txt | 3 +++ direct/src/pandac/CMakeLists.txt | 15 +++++++++++++++ direct/src/pandac/__init__.py | 5 +++++ 4 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 direct/src/pandac/CMakeLists.txt create mode 100644 direct/src/pandac/__init__.py diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 8fdb80e2ddd..72b595ec1c6 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -36,6 +36,8 @@ endif() set(IMOD_FLAGS -python-native) +# This stores the names of every module added to the Interrogate system: +set(ALL_INTERROGATE_MODULES CACHE INTERNAL "Internal variable") # # Function: target_interrogate(target [ALL] [source1 [source2 ...]]) @@ -270,6 +272,9 @@ function(add_python_module module) if(WIN32 AND NOT CYGWIN) set_target_properties(${module} PROPERTIES SUFFIX ".pyd") endif() + + list(APPEND ALL_INTERROGATE_MODULES "${module}") + set(ALL_INTERROGATE_MODULES "${ALL_INTERROGATE_MODULES}" CACHE INTERNAL "Internal variable") endif() endfunction(add_python_module) @@ -281,5 +286,5 @@ if(HAVE_PYTHON) # The Interrogate path needs to be installed to the architecture-dependent # Python directory. - install(DIRECTORY "${PROJECT_BINARY_DIR}/panda3d" DESTINATION "${PYTHON_LIB_INSTALL_DIR}") + install(DIRECTORY "${PROJECT_BINARY_DIR}/panda3d" DESTINATION "${PYTHON_ARCH_INSTALL_DIR}") endif() diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index e14c11ad144..9bf1cbdb194 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -36,3 +36,6 @@ if(HAVE_PYTHON) FILES "${CMAKE_CURRENT_BINARY_DIR}/__init__.py" DESTINATION "${PYTHON_LIB_INSTALL_DIR}/direct") endif() + +# pandac has its own installation steps necessary: +add_subdirectory(src/pandac) diff --git a/direct/src/pandac/CMakeLists.txt b/direct/src/pandac/CMakeLists.txt new file mode 100644 index 00000000000..62969e7acf5 --- /dev/null +++ b/direct/src/pandac/CMakeLists.txt @@ -0,0 +1,15 @@ +if(HAVE_PYTHON) + # Generate PandaModules: + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/PandaModules.py" + "# Generated by CMake; edits not preserved\n") + foreach(module ${ALL_INTERROGATE_MODULES}) + file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/PandaModules.py" + "from panda3d.${module} import *\n") + endforeach() + + # Now install ourselves: + file(GLOB python_sources "${CMAKE_CURRENT_SOURCE_DIR}/*.py") + install( + FILES ${python_sources} "${CMAKE_CURRENT_BINARY_DIR}/PandaModules.py" + DESTINATION "${PYTHON_LIB_INSTALL_DIR}/pandac") +endif() diff --git a/direct/src/pandac/__init__.py b/direct/src/pandac/__init__.py new file mode 100644 index 00000000000..d313bda3ddf --- /dev/null +++ b/direct/src/pandac/__init__.py @@ -0,0 +1,5 @@ +# N.B. PandaModules is generated at build time by CMake +from PandaModules import * + +# Now import all extensions: + From b7ddeacc8bfd111b77216dfc666acf1c9489d095 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 7 Feb 2014 14:36:48 -0700 Subject: [PATCH 11/12] direct: libpandaexpress -> panda3d.core --- direct/src/directnotify/DirectNotify.py | 6 ++---- direct/src/directnotify/Notifier.py | 4 ++-- direct/src/showbase/Messenger.py | 2 +- direct/src/showbase/ProfileSession.py | 2 +- direct/src/showbase/PythonUtil.py | 2 +- direct/src/showbase/VFSImporter.py | 2 +- 6 files changed, 8 insertions(+), 10 deletions(-) diff --git a/direct/src/directnotify/DirectNotify.py b/direct/src/directnotify/DirectNotify.py index f2b8e351d1b..d61420e3f51 100644 --- a/direct/src/directnotify/DirectNotify.py +++ b/direct/src/directnotify/DirectNotify.py @@ -61,10 +61,8 @@ def setDconfigLevel(self, categoryName): """ # We use ConfigVariableString instead of base.config, in case - # we're running before ShowBase has finished initializing; and - # we import it directly from libpandaexpress, in case we're - # running before libpanda.dll is available. - from libpandaexpress import ConfigVariableString + # we're running before ShowBase has finished initializing + from panda3d.core import ConfigVariableString dconfigParam = ("notify-level-" + categoryName) cvar = ConfigVariableString(dconfigParam, "") diff --git a/direct/src/directnotify/Notifier.py b/direct/src/directnotify/Notifier.py index 5b1508fa99b..eb91d5244e0 100644 --- a/direct/src/directnotify/Notifier.py +++ b/direct/src/directnotify/Notifier.py @@ -4,7 +4,7 @@ """ from LoggerGlobal import defaultLogger from direct.showbase import PythonUtil -from libpandaexpress import ConfigVariableBool +from panda3d.core import ConfigVariableBool import time import types import sys @@ -18,7 +18,7 @@ class Notifier: # with the C++ notify system. streamWriter = None if ConfigVariableBool('notify-integrate', True): - from libpandaexpress import StreamWriter, Notify + from panda3d.core import StreamWriter, Notify streamWriter = StreamWriter(Notify.out(), False) showTime = ConfigVariableBool('notify-timestamp', False) diff --git a/direct/src/showbase/Messenger.py b/direct/src/showbase/Messenger.py index 56ec2958deb..44248e6a4e3 100644 --- a/direct/src/showbase/Messenger.py +++ b/direct/src/showbase/Messenger.py @@ -7,7 +7,7 @@ from direct.directnotify import DirectNotifyGlobal import types -from libpandaexpress import ConfigVariableBool +from panda3d.core import ConfigVariableBool # If using the Toontown ActiveX launcher, this must be set true. # Also, Panda must be compiled with SIMPLE_THREADS or no HAVE_THREADS diff --git a/direct/src/showbase/ProfileSession.py b/direct/src/showbase/ProfileSession.py index ad2cdc26066..c2cd4f7b67e 100755 --- a/direct/src/showbase/ProfileSession.py +++ b/direct/src/showbase/ProfileSession.py @@ -1,4 +1,4 @@ -from pandac.libpandaexpressModules import TrueClock +from panda3d.core import TrueClock from direct.directnotify.DirectNotifyGlobal import directNotify from direct.showbase.PythonUtil import ( StdoutCapture, _installProfileCustomFuncs,_removeProfileCustomFuncs, diff --git a/direct/src/showbase/PythonUtil.py b/direct/src/showbase/PythonUtil.py index 418bb86f6b1..84ca4c32f6f 100644 --- a/direct/src/showbase/PythonUtil.py +++ b/direct/src/showbase/PythonUtil.py @@ -63,7 +63,7 @@ # Don't import libpandaexpressModules, which doesn't get built until # genPyCode. import direct.extensions_native.extension_native_helpers -from libpandaexpress import ConfigVariableBool +from panda3d.core import ConfigVariableBool ScalarTypes = (types.FloatType, types.IntType, types.LongType) diff --git a/direct/src/showbase/VFSImporter.py b/direct/src/showbase/VFSImporter.py index 3bf8275cfc1..f9cc552a598 100644 --- a/direct/src/showbase/VFSImporter.py +++ b/direct/src/showbase/VFSImporter.py @@ -1,4 +1,4 @@ -from libpandaexpress import Filename, VirtualFileSystem, VirtualFileMountSystem, OFileStream, copyStream +from panda3d.core import Filename, VirtualFileSystem, VirtualFileMountSystem, OFileStream, copyStream import sys import os import marshal From 211f4cb49843ef3605a0ec943e17c448dbca8fef Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 7 Feb 2014 15:54:39 -0700 Subject: [PATCH 12/12] direct: Kind of hacky, but make 'pandac' install the extensions. --- direct/src/pandac/__init__.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/direct/src/pandac/__init__.py b/direct/src/pandac/__init__.py index d313bda3ddf..4b79eb4dce8 100644 --- a/direct/src/pandac/__init__.py +++ b/direct/src/pandac/__init__.py @@ -1,5 +1,32 @@ # N.B. PandaModules is generated at build time by CMake from PandaModules import * +import __builtin__ # Now import all extensions: +from direct.extensions_native.extension_native_helpers import * +extensions = [ + 'CInterval', 'EggGroupNode', 'EggPrimitive', 'HTTPChannel', 'Mat3', + 'NodePath', 'NodePathCollection', 'OdeBody', 'OdeGeom', 'OdeJoint', + 'OdeSpace', 'Ramfile', 'StreamReader', 'VBase3', 'VBase4' +] +# Prior to importing, we need to make the Dtool_funcToMethod function and +# the extended class available globally. This is hacky, but tacking it on +# __builtin__ works just fine: +import __builtin__ +__builtin__.Dtool_funcToMethod = Dtool_funcToMethod +__builtin__.Dtool_ObjectToDict = Dtool_ObjectToDict + +for extension in extensions: + if extension not in locals(): + # Not a class we have compiled in, skip it! + continue + + module = 'direct.extensions_native.%s_extensions' % extension + + setattr(__builtin__, extension, locals()[extension]) + __import__(module) + del __builtin__.__dict__[extension] + +del __builtin__.Dtool_funcToMethod +del __builtin__.Dtool_ObjectToDict