Skip to content

Commit

Permalink
Reduced required CMake version (#498)
Browse files Browse the repository at this point in the history
  • Loading branch information
themarpe committed Dec 15, 2021
1 parent 6fdccaa commit 6171c32
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
30 changes: 20 additions & 10 deletions scripts/find_python.cmake
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
cmake_minimum_required(VERSION 3.12)
cmake_minimum_required(VERSION 3.0)

if(DEFINED ENV{HUNTER_PYTHON_LOCATION})
set(Python_ROOT_DIR $ENV{HUNTER_PYTHON_LOCATION})
set(Python_FIND_STRATEGY LOCATION)
endif()
if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
find_package(PythonInterp 3 QUIET)
if(NOT PYTHONINTERP_FOUND)
message(FATAL_ERROR "Python not found")
endif()
message(${PYTHON_EXECUTABLE})
else()
cmake_minimum_required(VERSION 3.12)

find_package(Python COMPONENTS Interpreter QUIET)
if(DEFINED ENV{HUNTER_PYTHON_LOCATION})
set(Python_ROOT_DIR $ENV{HUNTER_PYTHON_LOCATION})
set(Python_FIND_STRATEGY LOCATION)
endif()

if(NOT Python_Interpreter_FOUND)
message(FATAL_ERROR "Python not found")
endif()
find_package(Python COMPONENTS Interpreter QUIET)

message(${Python_EXECUTABLE})
if(NOT Python_Interpreter_FOUND)
message(FATAL_ERROR "Python not found")
endif()

message(${Python_EXECUTABLE})
endif()
2 changes: 1 addition & 1 deletion scripts/link-all.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.12)
cmake_minimum_required(VERSION 3.0)

string(COMPARE EQUAL "${HUNTER_INSTALL_PREFIX}" "" is_empty)
if(is_empty)
Expand Down

0 comments on commit 6171c32

Please sign in to comment.