Skip to content

Commit

Permalink
fix Versioning to allow patches (#404)
Browse files Browse the repository at this point in the history
  • Loading branch information
bakpaul committed Mar 14, 2024
1 parent 13f7385 commit 69f81e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
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@ QUIET REQUIRED COMPONENTS Interpreter Development)
find_package(Python @PythonMAJMIN@ EXACT QUIET REQUIRED COMPONENTS Interpreter Development)
endif()

# Find pybind11
Expand Down

0 comments on commit 69f81e5

Please sign in to comment.