Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ if(EXISTS "${Python_INCLUDE_DIR}")
elseif(EXISTS "${Python_INCLUDE_DIRS}")
set(PYTHON_INCLUDE_DIR "${Python_INCLUDE_DIRS}" CACHE INTERNAL "" FORCE)
endif()
string(REGEX MATCH "[0-9]+\.[0-9]+" PythonMAJMIN "${Python_VERSION}")

# Set the minimum pybind11 version to 2.3 (before that the pybind11::embed target did not exist)
find_package(pybind11 2.3 CONFIG QUIET REQUIRED)
Expand Down Expand Up @@ -145,6 +146,8 @@ message(STATUS "Python:
Libraries: ${Python_LIBRARIES}
User site: ${PYTHON_USER_SITE}"
)


message(STATUS "pybind11:
Version: ${pybind11_VERSION}
Config: ${pybind11_CONFIG}"
Expand Down
2 changes: 1 addition & 1 deletion SofaPython3Config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ include(SofaPython3Tools)

# Find Python3
if(NOT Python_FOUND)
find_package(Python @Python_VERSION@ EXACT QUIET REQUIRED COMPONENTS Interpreter Development)
find_package(Python @PythonMAJMIN@ EXACT QUIET REQUIRED COMPONENTS Interpreter Development)
endif()

# Find pybind11
Expand Down