mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 19:08:55 -04:00
CMake: Do something sensible with static Python modules
These *do* make sense and there are Panda3D users that use this kind of configuration, so we should try to be accommodating.
This commit is contained in:
parent
77018c5383
commit
1970751c8a
@ -317,6 +317,7 @@ function(add_python_target target)
|
|||||||
add_library(${target} ${MODULE_TYPE} ${sources})
|
add_library(${target} ${MODULE_TYPE} ${sources})
|
||||||
target_use_packages(${target} PYTHON)
|
target_use_packages(${target} PYTHON)
|
||||||
|
|
||||||
|
if(BUILD_SHARED_LIBS)
|
||||||
set_target_properties(${target} PROPERTIES
|
set_target_properties(${target} PROPERTIES
|
||||||
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/panda3d"
|
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/panda3d"
|
||||||
OUTPUT_NAME "${basename}"
|
OUTPUT_NAME "${basename}"
|
||||||
@ -324,10 +325,18 @@ function(add_python_target target)
|
|||||||
SUFFIX "${PYTHON_EXTENSION_SUFFIX}")
|
SUFFIX "${PYTHON_EXTENSION_SUFFIX}")
|
||||||
|
|
||||||
install(TARGETS ${target} DESTINATION "${PYTHON_ARCH_INSTALL_DIR}/panda3d")
|
install(TARGETS ${target} DESTINATION "${PYTHON_ARCH_INSTALL_DIR}/panda3d")
|
||||||
|
else()
|
||||||
|
set_target_properties(${target} PROPERTIES
|
||||||
|
OUTPUT_NAME "${basename}"
|
||||||
|
PREFIX "libpython_panda3d_")
|
||||||
|
|
||||||
|
install(TARGETS ${target} DESTINATION lib)
|
||||||
|
endif()
|
||||||
|
|
||||||
endfunction(add_python_target)
|
endfunction(add_python_target)
|
||||||
|
|
||||||
|
|
||||||
if(HAVE_PYTHON)
|
if(INTERROGATE_PYTHON_INTERFACE AND BUILD_SHARED_LIBS)
|
||||||
# We have to create an __init__.py so that Python 2.x can recognize 'panda3d'
|
# We have to create an __init__.py so that Python 2.x can recognize 'panda3d'
|
||||||
# as a package.
|
# as a package.
|
||||||
file(WRITE "${PROJECT_BINARY_DIR}/panda3d/__init__.py" "")
|
file(WRITE "${PROJECT_BINARY_DIR}/panda3d/__init__.py" "")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user