Skip to content

Commit

Permalink
Fix issue with CMake versions prior to 3.18
Browse files Browse the repository at this point in the history
Ported from a pybind11 PR by @henryiii: pybind/pybind11#4805
  • Loading branch information
wjakob committed Oct 27, 2023
1 parent 5f1cbae commit 4be9abe
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,14 @@ endif()
if (NOT TARGET Python::Module OR NOT TARGET Python::Interpreter)
set(Python_FIND_FRAMEWORK LAST) # Prefer Brew/Conda to Apple framework python

if (CMAKE_VERSION VERSION_LESS 3.18)
set(NB_PYTHON_DEV_MODULE Development)
else()
set(NB_PYTHON_DEV_MODULE Development.Module)
endif()

find_package(Python 3.8
REQUIRED COMPONENTS Interpreter Development.Module
REQUIRED COMPONENTS Interpreter ${NB_PYTHON_DEV_MODULE}
OPTIONAL_COMPONENTS Development.SABIModule)
endif()

Expand Down

0 comments on commit 4be9abe

Please sign in to comment.