From b0bb2c9c4247ae92fd4c15d220c1d9b40dbfab6e Mon Sep 17 00:00:00 2001 From: Hirek193 Date: Sat, 27 Jun 2026 15:15:11 +0200 Subject: [PATCH] Fix autodetect python directory --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 99b9eb65..28f40a43 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -478,6 +478,12 @@ if(WITH_PYTHON) target_link_libraries(${PROJECT_NAME} ${Python3_LIBRARIES}) if(WIN32) + # Python3_ROOT_DIR is only an input hint and is not populated by + # find_package(... COMPONENTS Development). Derive the install root from + # the include dir (parent of /include) when it was not provided. + if(NOT Python3_ROOT_DIR) + get_filename_component(Python3_ROOT_DIR "${Python3_INCLUDE_DIRS}" DIRECTORY) + endif() set(EU07_PY_DLL "${Python3_ROOT_DIR}/python314.dll") set(EU07_PY_ZLIB "${Python3_ROOT_DIR}/DLLs/zlib1.dll") set(EU07_PY_LIBDIR "${Python3_ROOT_DIR}/Lib")