Browse Source

Merge pull request #6 from kestred/cmake-cfs-install

CMake: Add installation target rules
Sam Edwards 11 years ago
parent
commit
ba86e28375
73 changed files with 248 additions and 20 deletions
  1. 8 6
      CMakeLists.txt
  2. 17 0
      cmake/macros/Interrogate.cmake
  3. 25 0
      direct/CMakeLists.txt
  4. 2 0
      direct/src/autorestart/CMakeLists.txt
  5. 1 0
      direct/src/dcparse/CMakeLists.txt
  6. 2 0
      direct/src/dcparser/CMakeLists.txt
  7. 2 0
      direct/src/deadrec/CMakeLists.txt
  8. 2 0
      direct/src/directbase/CMakeLists.txt
  9. 2 4
      direct/src/directnotify/DirectNotify.py
  10. 2 2
      direct/src/directnotify/Notifier.py
  11. 2 0
      direct/src/distributed/CMakeLists.txt
  12. 2 0
      direct/src/interval/CMakeLists.txt
  13. 15 0
      direct/src/pandac/CMakeLists.txt
  14. 32 0
      direct/src/pandac/__init__.py
  15. 2 0
      direct/src/showbase/CMakeLists.txt
  16. 1 1
      direct/src/showbase/Messenger.py
  17. 1 1
      direct/src/showbase/ProfileSession.py
  18. 1 1
      direct/src/showbase/PythonUtil.py
  19. 1 1
      direct/src/showbase/VFSImporter.py
  20. 22 3
      dtool/Config.cmake
  21. 2 0
      dtool/metalibs/dtool/CMakeLists.txt
  22. 2 0
      dtool/metalibs/dtoolconfig/CMakeLists.txt
  23. 2 0
      dtool/src/cppparser/CMakeLists.txt
  24. 2 0
      dtool/src/dconfig/CMakeLists.txt
  25. 2 0
      dtool/src/dtoolbase/CMakeLists.txt
  26. 2 0
      dtool/src/dtoolutil/CMakeLists.txt
  27. 2 0
      dtool/src/interrogate/CMakeLists.txt
  28. 2 0
      dtool/src/interrogatedb/CMakeLists.txt
  29. 2 0
      dtool/src/prc/CMakeLists.txt
  30. 2 0
      panda/metalibs/panda/CMakeLists.txt
  31. 2 0
      panda/metalibs/pandaegg/CMakeLists.txt
  32. 2 0
      panda/metalibs/pandagl/CMakeLists.txt
  33. 2 0
      panda/src/audio/CMakeLists.txt
  34. 2 0
      panda/src/chan/CMakeLists.txt
  35. 2 0
      panda/src/char/CMakeLists.txt
  36. 2 0
      panda/src/collide/CMakeLists.txt
  37. 2 0
      panda/src/cull/CMakeLists.txt
  38. 2 0
      panda/src/device/CMakeLists.txt
  39. 2 0
      panda/src/dgraph/CMakeLists.txt
  40. 2 0
      panda/src/display/CMakeLists.txt
  41. 2 0
      panda/src/downloader/CMakeLists.txt
  42. 2 0
      panda/src/egg/CMakeLists.txt
  43. 2 0
      panda/src/egg2pg/CMakeLists.txt
  44. 3 1
      panda/src/event/CMakeLists.txt
  45. 2 0
      panda/src/express/CMakeLists.txt
  46. 2 0
      panda/src/framework/CMakeLists.txt
  47. 2 0
      panda/src/glgsg/CMakeLists.txt
  48. 2 0
      panda/src/glstuff/CMakeLists.txt
  49. 2 0
      panda/src/glxdisplay/CMakeLists.txt
  50. 2 0
      panda/src/gobj/CMakeLists.txt
  51. 2 0
      panda/src/grutil/CMakeLists.txt
  52. 2 0
      panda/src/gsgbase/CMakeLists.txt
  53. 2 0
      panda/src/linmath/CMakeLists.txt
  54. 2 0
      panda/src/mathutil/CMakeLists.txt
  55. 2 0
      panda/src/movies/CMakeLists.txt
  56. 2 0
      panda/src/nativenet/CMakeLists.txt
  57. 2 0
      panda/src/net/CMakeLists.txt
  58. 2 0
      panda/src/pandabase/CMakeLists.txt
  59. 2 0
      panda/src/parametrics/CMakeLists.txt
  60. 2 0
      panda/src/pgraph/CMakeLists.txt
  61. 2 0
      panda/src/pgraphnodes/CMakeLists.txt
  62. 2 0
      panda/src/pgui/CMakeLists.txt
  63. 2 0
      panda/src/pipeline/CMakeLists.txt
  64. 2 0
      panda/src/pnmimage/CMakeLists.txt
  65. 2 0
      panda/src/pnmimagetypes/CMakeLists.txt
  66. 2 0
      panda/src/pnmtext/CMakeLists.txt
  67. 2 0
      panda/src/pstatclient/CMakeLists.txt
  68. 2 0
      panda/src/putil/CMakeLists.txt
  69. 2 0
      panda/src/recorder/CMakeLists.txt
  70. 1 0
      panda/src/testbed/CMakeLists.txt
  71. 2 0
      panda/src/text/CMakeLists.txt
  72. 2 0
      panda/src/tform/CMakeLists.txt
  73. 2 0
      panda/src/x11display/CMakeLists.txt

+ 8 - 6
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)

+ 17 - 0
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 ...]])
@@ -241,6 +243,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})
@@ -269,5 +272,19 @@ 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)
+
+
+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_ARCH_INSTALL_DIR}")
+endif()

+ 25 - 0
direct/CMakeLists.txt

@@ -18,3 +18,28 @@ 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()
+
+# pandac has its own installation steps necessary:
+add_subdirectory(src/pandac)

+ 2 - 0
direct/src/autorestart/CMakeLists.txt

@@ -2,4 +2,6 @@ if(UNIX)
   add_executable(autorestart autorestart.c)
   set_target_properties(autorestart PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA)
   target_link_libraries(autorestart p3dtool)
+
+  install(TARGETS autorestart DESTINATION bin)
 endif()

+ 1 - 0
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)

+ 2 - 0
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)

+ 2 - 0
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)

+ 2 - 0
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)

+ 2 - 4
direct/src/directnotify/DirectNotify.py

@@ -61,10 +61,8 @@ class DirectNotify:
         """
 
         # 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, "")

+ 2 - 2
direct/src/directnotify/Notifier.py

@@ -4,7 +4,7 @@ for the programmer/user
 """
 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)

+ 2 - 0
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()

+ 2 - 0
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)

+ 15 - 0
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()

+ 32 - 0
direct/src/pandac/__init__.py

@@ -0,0 +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

+ 2 - 0
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)

+ 1 - 1
direct/src/showbase/Messenger.py

@@ -7,7 +7,7 @@ from PythonUtil import *
 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

+ 1 - 1
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,

+ 1 - 1
direct/src/showbase/PythonUtil.py

@@ -63,7 +63,7 @@ from direct.directutil import Verify
 # 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)
 

+ 1 - 1
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

+ 22 - 3
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.

+ 2 - 0
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)

+ 2 - 0
dtool/metalibs/dtoolconfig/CMakeLists.txt

@@ -8,3 +8,5 @@ else()
 endif()
 
 target_link_libraries(p3dtoolconfig p3prc p3dconfig p3interrogatedb)
+
+install(TARGETS p3dtoolconfig DESTINATION lib)

+ 2 - 0
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)

+ 2 - 0
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)

+ 2 - 0
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)

+ 2 - 0
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)

+ 2 - 0
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)

+ 2 - 0
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)
+
+install(TARGETS p3interrogatedb DESTINATION lib)

+ 2 - 0
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)

+ 2 - 0
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)

+ 2 - 0
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()

+ 2 - 0
panda/metalibs/pandagl/CMakeLists.txt

@@ -20,4 +20,6 @@ if(HAVE_GL)
 
   add_library(pandagl pandagl.cxx)
   target_link_libraries(pandagl ${PANDAGL_LINK_TARGETS})
+
+  install(TARGETS pandagl DESTINATION lib)
 endif()

+ 2 - 0
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()

+ 2 - 0
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)

+ 2 - 0
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)

+ 2 - 0
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

+ 2 - 0
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)

+ 2 - 0
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)

+ 2 - 0
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)

+ 2 - 0
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 

+ 2 - 0
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)

+ 2 - 0
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()

+ 2 - 0
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()

+ 3 - 1
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
+#end test_bin_target

+ 2 - 0
panda/src/express/CMakeLists.txt

@@ -134,6 +134,8 @@ if(WIN32)
   target_link_libraries(p3express advapi32.lib ws2_32.lib)
 endif()
 
+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)

+ 2 - 0
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)

+ 2 - 0
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()

+ 2 - 0
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()

+ 2 - 0
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()

+ 2 - 0
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 \

+ 2 - 0
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)

+ 2 - 0
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

+ 2 - 0
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 \

+ 2 - 0
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 \

+ 2 - 0
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)

+ 2 - 0
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()

+ 2 - 0
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()

+ 2 - 0
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)

+ 2 - 0
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

+ 2 - 0
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

+ 2 - 0
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)

+ 2 - 0
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
 

+ 2 - 0
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

+ 2 - 0
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)

+ 2 - 0
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)

+ 2 - 0
panda/src/pnmtext/CMakeLists.txt

@@ -18,4 +18,6 @@ if(HAVE_FREETYPE)
   add_library(p3pnmtext ${P3PNMTEXT_SOURCES} ${P3PNMTEXT_HEADERS})
   target_link_libraries(p3pnmtext p3pnmimage ${_FREETYPE_LIBRARIES})
   target_interrogate(p3pnmtext ALL)
+
+  install(TARGETS p3pnmtext DESTINATION lib)
 endif()

+ 2 - 0
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 

+ 2 - 0
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

+ 2 - 0
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)

+ 1 - 0
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

+ 2 - 0
panda/src/text/CMakeLists.txt

@@ -39,3 +39,5 @@ if(HAVE_FREETYPE)
   target_link_libraries(p3text p3pnmtext ${_FREETYPE_LIBRARIES})
 endif()
 target_interrogate(p3text ALL)
+
+install(TARGETS p3text DESTINATION lib)

+ 2 - 0
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)

+ 2 - 0
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()