mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 08:44:19 -04:00
CMake: Move pandac.* generation to be part of direct
This commit is contained in:
parent
df805bd02b
commit
368cdc2802
@ -166,29 +166,3 @@ if(INTERROGATE_PYTHON_INTERFACE)
|
|||||||
|
|
||||||
add_test(pytest "${PYTHON_EXECUTABLE}" -m pytest "${PROJECT_SOURCE_DIR}/tests")
|
add_test(pytest "${PYTHON_EXECUTABLE}" -m pytest "${PROJECT_SOURCE_DIR}/tests")
|
||||||
endif()
|
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 *
|
|
||||||
# instead of
|
|
||||||
# from panda3d.FOO import *
|
|
||||||
if(HAVE_PYTHON)
|
|
||||||
# Generate PandaModules:
|
|
||||||
file(WRITE "${PROJECT_BINARY_DIR}/pandac/PandaModules.py"
|
|
||||||
"\"This module is deprecated. Import from panda3d.core and other panda3d.* modules instead.\"
|
|
||||||
|
|
||||||
print(\"Warning: pandac.PandaModules is deprecated, import from panda3d.core instead\")\n")
|
|
||||||
|
|
||||||
foreach(module ${ALL_INTERROGATE_MODULES})
|
|
||||||
file(APPEND "${PROJECT_BINARY_DIR}/pandac/PandaModules.py" "
|
|
||||||
try:
|
|
||||||
from panda3d.${module} import *
|
|
||||||
except ImportError as err:
|
|
||||||
if \"No module named %s\" not in str(err):
|
|
||||||
raise
|
|
||||||
")
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
# Now install ourselves:
|
|
||||||
install_python_package("${PROJECT_BINARY_DIR}/pandac" LIB)
|
|
||||||
endif()
|
|
||||||
|
@ -49,4 +49,28 @@ if(HAVE_PYTHON)
|
|||||||
|
|
||||||
# Install all files
|
# Install all files
|
||||||
install_python_package("${PROJECT_BINARY_DIR}/direct" LIB)
|
install_python_package("${PROJECT_BINARY_DIR}/direct" LIB)
|
||||||
|
|
||||||
|
# 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 *
|
||||||
|
# instead of
|
||||||
|
# from panda3d.FOO import *
|
||||||
|
# Generate PandaModules:
|
||||||
|
file(WRITE "${PROJECT_BINARY_DIR}/pandac/PandaModules.py"
|
||||||
|
"\"This module is deprecated. Import from panda3d.core and other panda3d.* modules instead.\"
|
||||||
|
|
||||||
|
print(\"Warning: pandac.PandaModules is deprecated, import from panda3d.core instead\")\n")
|
||||||
|
|
||||||
|
foreach(module ${ALL_INTERROGATE_MODULES})
|
||||||
|
file(APPEND "${PROJECT_BINARY_DIR}/pandac/PandaModules.py" "
|
||||||
|
try:
|
||||||
|
from panda3d.${module} import *
|
||||||
|
except ImportError as err:
|
||||||
|
if not (\"No module named\" in str(err) and \"${module}\" in str(err)):
|
||||||
|
raise
|
||||||
|
")
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
# Now install ourselves:
|
||||||
|
install_python_package("${PROJECT_BINARY_DIR}/pandac" LIB)
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user