Skip to content

Commit

Permalink
Explicitly use old CMake FindPython policy
Browse files Browse the repository at this point in the history
  • Loading branch information
GarrettDMorrison committed Dec 6, 2023
1 parent b345842 commit d6bccbd
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
cmake_policy(SET CMP0148 OLD)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_LIST_DIR}/scikit-build-cmake)
include(UseCython)
include(FindPythonExtensions)
Expand Down
2 changes: 2 additions & 0 deletions python/scikit-build-cmake/FindCython.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
# Use the Cython executable that lives next to the Python executable
# if it is a local installation.

cmake_policy(SET CMP0148 OLD)

find_package(PythonInterp)
if(PYTHONINTERP_FOUND)
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from os import path; import cython; print(path.dirname(cython.__file__))"
Expand Down
2 changes: 2 additions & 0 deletions python/scikit-build-cmake/FindNumPy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
# set(NumPy_FROM_TEMPLATE_EXECUTABLE /path/to/python /path/to/site-packages/numpy/distutils/from_template.py CACHE STRING "Command executing from-template program" FORCE)
#

cmake_policy(SET CMP0148 OLD)

if(NOT NumPy_FOUND)
set(_find_extra_args)
if(NumPy_FIND_REQUIRED)
Expand Down
2 changes: 2 additions & 0 deletions python/scikit-build-cmake/FindPythonExtensions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@
# limitations under the License.
#=============================================================================

cmake_policy(SET CMP0148 OLD)

find_package(PythonInterp REQUIRED)
find_package(PythonLibs)
include(targetLinkLibrariesWithDynamicLookup)
Expand Down
2 changes: 2 additions & 0 deletions python/scikit-build-cmake/UseCython.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@
# limitations under the License.
#=============================================================================

cmake_policy(SET CMP0148 OLD)

# Configuration options.
set(CYTHON_ANNOTATE OFF
CACHE BOOL "Create an annotated .html file when compiling *.pyx.")
Expand Down
1 change: 1 addition & 0 deletions tests/python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
cmake_policy(SET CMP0148 OLD)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/python/scikit-build-cmake)

find_package(PythonInterp REQUIRED)
Expand Down

0 comments on commit d6bccbd

Please sign in to comment.