From c4c99ca24a0b44bfa64a257716c1d7cda4279454 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 1 Apr 2020 12:13:11 +0200 Subject: [PATCH] CMake: fix bad location of panda3d/__init__.py in multiconfig build --- panda/CMakeLists.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index a545ef14bd..9bcb2e61ab 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -113,8 +113,7 @@ if(INTERROGATE_PYTHON_INTERFACE) set(win32_init "") endif() - file(WRITE "${PROJECT_BINARY_DIR}/panda3d/__init__.py" - "\"Python bindings for the Panda3D libraries\" + set(init_file "\"Python bindings for the Panda3D libraries\" __version__ = '${PROJECT_VERSION}' @@ -130,8 +129,13 @@ To suppress this warning, upgrade to Python 3. ${win32_init}") - if(BUILD_SHARED_LIBS) - install_python_package(panda3d ARCH) + if(IS_MULTICONFIG) + foreach(config ${CMAKE_CONFIGURATION_TYPES}) + # Generate an __init__.py in the per-configuration directory. + file(WRITE "${PROJECT_BINARY_DIR}/${config}/panda3d/__init__.py" ${init_file}) + endforeach(config) + else() + file(WRITE "${PROJECT_BINARY_DIR}/panda3d/__init__.py" ${init_file}) endif() if(HAVE_BULLET)