Skip to content

Commit

Permalink
update cmakelists
Browse files Browse the repository at this point in the history
  • Loading branch information
yomichi committed Mar 21, 2024
1 parent da9a047 commit 7f084c8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,15 @@ include_directories(${Boost_INCLUDE_DIRS})

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/third-party/plog)

set(python_version_required 3.8)

if(NOT PYTHON_EXECUTABLE)
if(BUILD_NEW_GENERATORS OR Testing OR Document)
if(${CMAKE_VERSION} VERSION_LESS 3.12)
find_package(PythonInterp 3.6 REQUIRED)
find_package(PythonInterp ${python_version_required} REQUIRED)
set(python_version_mm "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")
else(${CMAKE_VERSION} VERSION_LESS 3.12)
find_package(Python3 3.6 COMPONENTS Interpreter REQUIRED)
find_package(Python3 ${python_version_required} COMPONENTS Interpreter REQUIRED)
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
set(python_version_mm "${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}")
endif(${CMAKE_VERSION} VERSION_LESS 3.12)
Expand All @@ -87,8 +89,8 @@ else()
message(STATUS "Given Python interpreter: ${PYTHON_EXECUTABLE}")
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" result "${result}")
message(STATUS "Python version: ${result}")
if("${result}" VERSION_LESS 3.6)
message(FATAL_ERROR "Python ${result} is not supported (3.6 or later is required)")
if("${result}" VERSION_LESS ${python_version_required})
message(FATAL_ERROR "Python ${result} is not supported (${python_version_required} or later is required)")
endif()
string(REPLACE "." ";" result "${result}")
set(result "${result}")
Expand Down

0 comments on commit 7f084c8

Please sign in to comment.