Skip to content

Commit fa67fe9

Browse files
committed
[CMake] Propagate fix to Config.cmake.in
1 parent 6d40651 commit fa67fe9

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

SofaPython3Config.cmake.in

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,16 @@ set(PYTHON_VERSION "${Python_VERSION}" CACHE STRING "" FORCE)
2626
set(PYTHON_EXECUTABLE "${Python_EXECUTABLE}" CACHE FILEPATH "" FORCE)
2727
set(PYTHON_LIBRARIES "${Python_LIBRARIES}" CACHE STRING "" FORCE)
2828
set(PYTHON_INCLUDE_DIRS "${Python_INCLUDE_DIRS}" CACHE STRING "" FORCE)
29-
set(PYTHON_LIBRARY "${Python_LIBRARY}" CACHE INTERNAL "" FORCE)
30-
set(PYTHON_INCLUDE_DIR "${Python_INCLUDE_DIR}" CACHE INTERNAL "" FORCE)
29+
if(EXISTS "${Python_LIBRARY}")
30+
set(PYTHON_LIBRARY "${Python_LIBRARY}" CACHE INTERNAL "" FORCE)
31+
elseif(EXISTS "${Python_LIBRARIES}")
32+
set(PYTHON_LIBRARY "${Python_LIBRARIES}" CACHE INTERNAL "" FORCE)
33+
endif()
34+
if(EXISTS "${Python_INCLUDE_DIR}")
35+
set(PYTHON_INCLUDE_DIR "${Python_INCLUDE_DIR}" CACHE INTERNAL "" FORCE)
36+
elseif(EXISTS "${Python_INCLUDE_DIRS}")
37+
set(PYTHON_INCLUDE_DIR "${Python_INCLUDE_DIRS}" CACHE INTERNAL "" FORCE)
38+
endif()
3139

3240
# Set the minimum pybind11 version to 2.3 (before that the pybind11::embed target did not exist)
3341
find_package(pybind11 2.3 CONFIG QUIET REQUIRED)

0 commit comments

Comments
 (0)