Skip to content

Commit 69f81e5

Browse files
committed
fix Versioning to allow patches (#404)
1 parent 13f7385 commit 69f81e5

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ if(EXISTS "${Python_INCLUDE_DIR}")
109109
elseif(EXISTS "${Python_INCLUDE_DIRS}")
110110
set(PYTHON_INCLUDE_DIR "${Python_INCLUDE_DIRS}" CACHE INTERNAL "" FORCE)
111111
endif()
112+
string(REGEX MATCH "[0-9]+\.[0-9]+" PythonMAJMIN "${Python_VERSION}")
112113

113114
# Set the minimum pybind11 version to 2.3 (before that the pybind11::embed target did not exist)
114115
find_package(pybind11 2.3 CONFIG QUIET REQUIRED)
@@ -145,6 +146,8 @@ message(STATUS "Python:
145146
Libraries: ${Python_LIBRARIES}
146147
User site: ${PYTHON_USER_SITE}"
147148
)
149+
150+
148151
message(STATUS "pybind11:
149152
Version: ${pybind11_VERSION}
150153
Config: ${pybind11_CONFIG}"

SofaPython3Config.cmake.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ include(SofaPython3Tools)
1010

1111
# Find Python3
1212
if(NOT Python_FOUND)
13-
find_package(Python @Python_VERSION@ QUIET REQUIRED COMPONENTS Interpreter Development)
13+
find_package(Python @PythonMAJMIN@ EXACT QUIET REQUIRED COMPONENTS Interpreter Development)
1414
endif()
1515

1616
# Find pybind11

0 commit comments

Comments
 (0)