|
@@ -49,3 +49,33 @@ endif()
|
|
|
if(BUILD_PANDATOOL)
|
|
if(BUILD_PANDATOOL)
|
|
|
add_subdirectory(pandatool)
|
|
add_subdirectory(pandatool)
|
|
|
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 "${CMAKE_CURRENT_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 "${CMAKE_CURRENT_BINARY_DIR}/PandaModules.py" "
|
|
|
|
|
+try:
|
|
|
|
|
+ from panda3d.${module} import *
|
|
|
|
|
+except ImportError as err:
|
|
|
|
|
+ if \"No module named %s\" not in str(err):
|
|
|
|
|
+ raise
|
|
|
|
|
+")
|
|
|
|
|
+ endforeach()
|
|
|
|
|
+
|
|
|
|
|
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pandac/__init__.py" "")
|
|
|
|
|
+
|
|
|
|
|
+ # Now install ourselves:
|
|
|
|
|
+ install(
|
|
|
|
|
+ FILES "${CMAKE_CURRENT_BINARY_DIR}/pandac/__init__.py" "${CMAKE_CURRENT_BINARY_DIR}/pandac/PandaModules.py"
|
|
|
|
|
+ DESTINATION "${PYTHON_LIB_INSTALL_DIR}/pandac")
|
|
|
|
|
+endif()
|