Skip to content

Commit

Permalink
Don't force-set Python cache variables
Browse files Browse the repository at this point in the history
Allow the user to override Python paths
from the command line.
  • Loading branch information
benmwebb committed Nov 14, 2024
1 parent 08a8bc9 commit 87506e6
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions cmake_modules/IMPFindPython.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ function(imp_find_python)

if(Python3_Interpreter_FOUND AND Python3_Development_FOUND)
# Use Python 3 tools
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE} CACHE INTERNAL "" FORCE)
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE} CACHE STRING "")
set(PYTHON_TEST_EXECUTABLE ${Python3_EXECUTABLE} CACHE STRING "")
set(PYTHON_LIBRARIES ${Python3_LIBRARIES} CACHE INTERNAL "" FORCE)
set(PYTHON_INCLUDE_DIRS ${Python3_INCLUDE_DIRS} CACHE INTERNAL "" FORCE)
set(PYTHON_LIBRARY_DIRS ${Python3_LIBRARY_DIRS} CACHE INTERNAL "" FORCE)
set(PYTHON_NUMPY_FOUND ${Python3_NumPy_FOUND} CACHE INTERNAL "" FORCE)
set(PYTHON_LIBRARIES ${Python3_LIBRARIES} CACHE STRING "")
set(PYTHON_INCLUDE_DIRS ${Python3_INCLUDE_DIRS} CACHE STRING "")
set(PYTHON_LIBRARY_DIRS ${Python3_LIBRARY_DIRS} CACHE STRING "")
set(PYTHON_NUMPY_FOUND ${Python3_NumPy_FOUND} CACHE STRING "")
set(PYTHON_NUMPY_INCLUDE_DIR ${Python3_NumPy_INCLUDE_DIRS}
CACHE INTERNAL "" FORCE)
set(PYTHON_VERSION ${Python3_VERSION} CACHE INTERNAL "" FORCE)
set(PYTHON_VERSION_MAJOR ${Python3_VERSION_MAJOR} CACHE INTERNAL "" FORCE)
set(PYTHON_VERSION_MINOR ${Python3_VERSION_MINOR} CACHE INTERNAL "" FORCE)
set(PYTHON_VERSION_PATCH ${Python3_VERSION_PATCH} CACHE INTERNAL "" FORCE)
CACHE STRING "")
set(PYTHON_VERSION ${Python3_VERSION} CACHE STRING "")
set(PYTHON_VERSION_MAJOR ${Python3_VERSION_MAJOR} CACHE STRING "")
set(PYTHON_VERSION_MINOR ${Python3_VERSION_MINOR} CACHE STRING "")
set(PYTHON_VERSION_PATCH ${Python3_VERSION_PATCH} CACHE STRING "")
else()
message(FATAL_ERROR "Could not find a Python interpreter and matching headers/libraries. Python is required to build.")
endif()
Expand Down

0 comments on commit 87506e6

Please sign in to comment.