From 9da7988909b821c73fbca8f7f8c468b1fa8d91c3 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 13 Sep 2020 16:18:02 +0200 Subject: [PATCH] CMake: fix pandac/PandaModules.py to match makepanda's --- direct/CMakeLists.txt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 686ca23cc5..628f7cd763 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -53,7 +53,8 @@ if(HAVE_PYTHON) 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") +if __debug__: + print(\"Warning: pandac.PandaModules is deprecated, import from panda3d.core instead\")\n") foreach(module ${ALL_INTERROGATE_MODULES}) string(REGEX REPLACE "^.*\\." "" module_name "${module}") @@ -66,6 +67,19 @@ except ImportError as err: ") endforeach() + file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/pandac/PandaModules.py" + "from direct.showbase import DConfig + +def get_config_showbase(): + return DConfig + +def get_config_express(): + return DConfig + +getConfigShowbase = get_config_showbase +getConfigExpress = get_config_express +") + # Now install ourselves: install_python_package(pandac SOURCE "${CMAKE_CURRENT_BINARY_DIR}/pandac" LIB COMPONENT Direct) endif()