CMake: fix bad location of panda3d/__init__.py in multiconfig build

This commit is contained in:
rdb 2020-04-01 12:13:11 +02:00
parent 980c6bb389
commit c4c99ca24a
1 changed files with 8 additions and 4 deletions

View File

@ -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)