mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
CMake: Reorganize Python installation in direct/CMakeLists.txt
This commit is contained in:
parent
9c3841177b
commit
67e6c4299e
@ -23,19 +23,17 @@ endif()
|
|||||||
add_metalib(p3direct INIT init_libdirect direct.h COMPONENTS ${P3DIRECT_COMPONENTS})
|
add_metalib(p3direct INIT init_libdirect direct.h COMPONENTS ${P3DIRECT_COMPONENTS})
|
||||||
set_property(TARGET p3direct PROPERTY LINKER_LANGUAGE "CXX")
|
set_property(TARGET p3direct PROPERTY LINKER_LANGUAGE "CXX")
|
||||||
|
|
||||||
|
# Installation:
|
||||||
|
install(TARGETS p3direct DESTINATION lib)
|
||||||
|
|
||||||
if(HAVE_PYTHON)
|
if(HAVE_PYTHON)
|
||||||
|
# Now for the Python side of everything
|
||||||
|
|
||||||
add_python_module(direct
|
add_python_module(direct
|
||||||
p3dcparser p3deadrec p3distributed p3interval
|
p3dcparser p3deadrec p3distributed p3interval
|
||||||
p3motiontrail p3showbase LINK p3direct IMPORT panda3d.core)
|
p3motiontrail p3showbase LINK p3direct IMPORT panda3d.core)
|
||||||
|
|
||||||
# Make an __init__.py pointing at the source directory so users can run
|
# Copy Python source files into the build directory
|
||||||
# Panda3D code straight from their build path:
|
|
||||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/__init__.py" "__path__.insert(0,r\"${CMAKE_CURRENT_SOURCE_DIR}/src\")")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Installation:
|
|
||||||
install(TARGETS p3direct DESTINATION lib)
|
|
||||||
if(HAVE_PYTHON)
|
|
||||||
set(DIRECT_INSTALL_DIRECTORIES
|
set(DIRECT_INSTALL_DIRECTORIES
|
||||||
actor cluster controls directbase directdevices directnotify directscripts
|
actor cluster controls directbase directdevices directnotify directscripts
|
||||||
directtools directutil distributed extensions extensions_native ffi filter
|
directtools directutil distributed extensions extensions_native ffi filter
|
||||||
@ -47,15 +45,14 @@ if(HAVE_PYTHON)
|
|||||||
DIRECTORY "src/${dir}"
|
DIRECTORY "src/${dir}"
|
||||||
DESTINATION "${PROJECT_BINARY_DIR}/direct"
|
DESTINATION "${PROJECT_BINARY_DIR}/direct"
|
||||||
FILES_MATCHING PATTERN "*.py")
|
FILES_MATCHING PATTERN "*.py")
|
||||||
install(
|
|
||||||
DIRECTORY "src/${dir}"
|
|
||||||
DESTINATION "${PYTHON_LIB_INSTALL_DIR}/direct"
|
|
||||||
FILES_MATCHING PATTERN "*.py")
|
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
# We also need an __init__.py file, which we have to generate:
|
# We also need an __init__.py file, which we have to generate:
|
||||||
file(WRITE "${PROJECT_BINARY_DIR}/direct/__init__.py" "")
|
file(WRITE "${PROJECT_BINARY_DIR}/direct/__init__.py" "")
|
||||||
|
|
||||||
|
# Install all files
|
||||||
install(
|
install(
|
||||||
FILES "${PROJECT_BINARY_DIR}/direct/__init__.py"
|
DIRECTORY "${PROJECT_BINARY_DIR}/direct"
|
||||||
DESTINATION "${PYTHON_LIB_INSTALL_DIR}/direct")
|
DESTINATION "${PYTHON_LIB_INSTALL_DIR}"
|
||||||
|
FILES_MATCHING REGEX "\\.py[co]?$")
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user