Skip to content

Commit 6171c32

Browse files
authored
Reduced required CMake version (#498)
1 parent 6fdccaa commit 6171c32

File tree

2 files changed

+21
-11
lines changed

2 files changed

+21
-11
lines changed

scripts/find_python.cmake

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
1-
cmake_minimum_required(VERSION 3.12)
1+
cmake_minimum_required(VERSION 3.0)
22

3-
if(DEFINED ENV{HUNTER_PYTHON_LOCATION})
4-
set(Python_ROOT_DIR $ENV{HUNTER_PYTHON_LOCATION})
5-
set(Python_FIND_STRATEGY LOCATION)
6-
endif()
3+
if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
4+
find_package(PythonInterp 3 QUIET)
5+
if(NOT PYTHONINTERP_FOUND)
6+
message(FATAL_ERROR "Python not found")
7+
endif()
8+
message(${PYTHON_EXECUTABLE})
9+
else()
10+
cmake_minimum_required(VERSION 3.12)
711

8-
find_package(Python COMPONENTS Interpreter QUIET)
12+
if(DEFINED ENV{HUNTER_PYTHON_LOCATION})
13+
set(Python_ROOT_DIR $ENV{HUNTER_PYTHON_LOCATION})
14+
set(Python_FIND_STRATEGY LOCATION)
15+
endif()
916

10-
if(NOT Python_Interpreter_FOUND)
11-
message(FATAL_ERROR "Python not found")
12-
endif()
17+
find_package(Python COMPONENTS Interpreter QUIET)
1318

14-
message(${Python_EXECUTABLE})
19+
if(NOT Python_Interpreter_FOUND)
20+
message(FATAL_ERROR "Python not found")
21+
endif()
22+
23+
message(${Python_EXECUTABLE})
24+
endif()

scripts/link-all.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.12)
1+
cmake_minimum_required(VERSION 3.0)
22

33
string(COMPARE EQUAL "${HUNTER_INSTALL_PREFIX}" "" is_empty)
44
if(is_empty)

0 commit comments

Comments
 (0)