diff --git a/CMakeLists.txt b/CMakeLists.txt index 888927ee..6426b0fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,14 @@ set(USE_EXTERNAL_LLVM ON) include("GNUInstallDirs") set(LLVM_DIR_ORIG ${LLVM_DIR}) set(Clang_DIR_ORIG ${Clang_DIR}) -set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules ${CMAKE_MODULE_PATH}) +# cmake version >= 3.19 includes all our modules +if(${CMAKE_VERSION} VERSION_LESS "3.19") + set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules ${CMAKE_MODULE_PATH}) +else() + # set CMP0054 to NEW + # https://cmake.org/cmake/help/latest/policy/CMP0054.html + cmake_policy(SET CMP0054 NEW) +endif() SET(CMAKE_MODULE_PATH_ORIG "${CMAKE_MODULE_PATH}") set (CMAKE_MODULE_PATH "${LLVM_DIR};${Clang_DIR};${CMAKE_MODULE_PATH}") option(BINDER_ENABLE_TEST "Enables building of tests" ON) diff --git a/cmake/Modules/FindPython/Support.cmake b/cmake/Modules/FindPython/Support.cmake index ab42a46f..8df7576c 100644 --- a/cmake/Modules/FindPython/Support.cmake +++ b/cmake/Modules/FindPython/Support.cmake @@ -259,7 +259,7 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS) # try more generic names if (NOT ${_PYTHON_PREFIX}_EXECUTABLE) find_program (${_PYTHON_PREFIX}_EXECUTABLE - NAMES python${${_PYTHON_PREFIX}_VERSION_MAJOR} python + NAMES python${${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR} python ${_${_PYTHON_PREFIX}_IRON_PYTHON_NAMES} HINTS ${_${_PYTHON_PREFIX}_HINTS} PATH_SUFFIXES bin)