From d594b49d0c2d884d88e8374cb5cea9b13f4023c6 Mon Sep 17 00:00:00 2001 From: Marcin Wojdyr Date: Sun, 17 Dec 2023 14:48:10 +0100 Subject: [PATCH] and again --- CMakeLists.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b6e2fe..30072dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,10 +64,14 @@ if (DEFINED SKBUILD) c:/Users/runneradmin/AppData/Local/*/gemmi-config.cmake) message(STATUS "found gemmi configs: ${FOUND_FILES}") set(CMAKE_FIND_DEBUG_MODE TRUE) - find_package(gemmi 0.6.4 CONFIG REQUIRED - # On Windows, when both gemmi and pybind11 are installed from - # wheels and gemmi can't be found, pybind11 location can helps: - PATHS ${pybind11_INCLUDE_DIRS}/../../../..) + if (WIN32) + # On Windows, when gemmi is installed from wheel, its location is + # hard to find. For now, locate it relatively to pybind11. + message(STATUS "pybind11_INCLUDE_DIR is ${pybind11_INCLUDE_DIR}") + get_filename_component(gemmi_ROOT "${pybind11_INCLUDE_DIR}/../../../.." ABSOLUTE) + message(STATUS "gemmi_ROOT is ${gemmi_ROOT}") + endif() + find_package(gemmi 0.6.4 CONFIG REQUIRED) set(CMAKE_FIND_DEBUG_MODE FALSE) else() set(USE_PYTHON ON CACHE BOOL "" FORCE)