From e5e7824b96fd4c6b461d3fee4885c56f6d4990af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 26 Jan 2024 20:45:35 +0100 Subject: [PATCH] python: don't generate corrade/__init__.py to two different locations. Causes problems when running tests with multi-config (Ninja) builds, as the corrade module is then attempted to be imported from a directory where __init__.py is, but not the actual binaries. --- src/python/corrade/CMakeLists.txt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/python/corrade/CMakeLists.txt b/src/python/corrade/CMakeLists.txt index 7d87b04..1d3613e 100644 --- a/src/python/corrade/CMakeLists.txt +++ b/src/python/corrade/CMakeLists.txt @@ -112,7 +112,7 @@ else() set(_MAGNUM_BUILD_PYTHON_BINDINGS_RTLD_GLOBAL "## ") endif() configure_file(${CMAKE_CURRENT_SOURCE_DIR}/__init__.py.in - ${CMAKE_CURRENT_BINARY_DIR}/__init__.py) + ${output_dir}/corrade/__init__.py) pybind11_add_module(corrade ${pybind11_add_module_SYSTEM} ${corrade_SRCS}) target_include_directories(corrade PRIVATE @@ -124,9 +124,6 @@ set_target_properties(corrade PROPERTIES OUTPUT_NAME "_corrade" LIBRARY_OUTPUT_DIRECTORY ${output_dir}) -file(GENERATE OUTPUT ${output_dir}/corrade/__init__.py - INPUT ${CMAKE_CURRENT_BINARY_DIR}/__init__.py) - if(MAGNUM_BUILD_TESTS) add_subdirectory(test) endif()