|
|
@@ -54,6 +54,7 @@ include(AddBisonTarget) # Defines add_bison_target function
|
|
|
include(AddFlexTarget) # Defines add_flex_target function
|
|
|
include(CompositeSources) # Defines composite_sources function
|
|
|
include(Interrogate) # Defines target_interrogate AND add_python_module
|
|
|
+include(RunPzip) # Defines run_pzip function
|
|
|
|
|
|
# Add the include path for source and header files generated by CMake
|
|
|
include_directories("${PROJECT_BINARY_DIR}/include")
|
|
|
@@ -63,6 +64,7 @@ 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)
|
|
|
option(BUILD_PANDATOOL "Build the pandatool source tree." ON)
|
|
|
+option(BUILD_MODELS "Build/install the built-in models." ON)
|
|
|
|
|
|
# Include Panda3D packages
|
|
|
if(BUILD_DTOOL)
|
|
|
@@ -81,6 +83,29 @@ if(BUILD_PANDATOOL)
|
|
|
add_subdirectory(pandatool "${CMAKE_BINARY_DIR}/pandatool")
|
|
|
endif()
|
|
|
|
|
|
+if(BUILD_MODELS)
|
|
|
+ # We don't really "build" the models, just pzip them
|
|
|
+ file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/models/maps/"
|
|
|
+ DESTINATION "${PROJECT_BINARY_DIR}/models/maps"
|
|
|
+ )
|
|
|
+ run_pzip(models
|
|
|
+ "${CMAKE_CURRENT_SOURCE_DIR}/models"
|
|
|
+ "${PROJECT_BINARY_DIR}/models"
|
|
|
+ *.egg
|
|
|
+ )
|
|
|
+ file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/dmodels/src/"
|
|
|
+ DESTINATION "${PROJECT_BINARY_DIR}/models"
|
|
|
+ FILES_MATCHING PATTERN *.rgb PATTERN *.png PATTERN *.jpg PATTERN *.wav
|
|
|
+ )
|
|
|
+ run_pzip(dmodels
|
|
|
+ "${CMAKE_CURRENT_SOURCE_DIR}/dmodels/src"
|
|
|
+ "${PROJECT_BINARY_DIR}/models"
|
|
|
+ *.egg
|
|
|
+ )
|
|
|
+ install(DIRECTORY "${PROJECT_BINARY_DIR}/models"
|
|
|
+ DESTINATION share/panda3d)
|
|
|
+endif()
|
|
|
+
|
|
|
# This bit is to generate the 'pandac' compatibility shim. It's deprecated now,
|
|
|
# but in older versions of Panda3D, one would use
|
|
|
# from pandac.PandaModules import *
|