Skip to content

Commit

Permalink
fixing CMake Python finding procedure (#275)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitalita authored Nov 17, 2023
1 parent 4d3f536 commit 5a66684
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/FindPython/Support.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5a66684

Please sign in to comment.