File tree Expand file tree Collapse file tree 1 file changed +23
-11
lines changed
Expand file tree Collapse file tree 1 file changed +23
-11
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,21 @@ endif()
2828jrl_find_package(Eigen3 CONFIG REQUIRED)
2929
3030jrl_find_python(3.8 REQUIRED COMPONENTS Interpreter Development.Module)
31- jrl_find_nanobind(2.5.0 CONFIG REQUIRED)
31+ jrl_find_nanobind(2.5.0 CONFIG QUIET )
32+
33+ # On Ubuntu 24.04, the nanobind-dev package ships nanobind 1.9.2.
34+ # We require >=2.5.0 for nanobind_add_stub,
35+ # NB_SUPPRESS_WARNINGS, and visitor pattern (c++)
36+ if (NOT nanobind_FOUND)
37+ include (FetchContent)
38+ FetchContent_Declare(
39+ nanobind
40+ GIT_REPOSITORY https://github.com/wjakob/nanobind.git
41+ GIT_TAG v2.10.1
42+ GIT_SHALLOW True
43+ )
44+ FetchContent_MakeAvailable(nanobind)
45+ endif ()
3246
3347if (BUILD_WITH_CHOLMOD_SUPPORT)
3448 jrl_find_package(CHOLMOD CONFIG REQUIRED)
@@ -167,16 +181,14 @@ if(BUILD_WITH_ACCELERATE_SUPPORT AND APPLE)
167181 target_compile_definitions (nanoeigenpy PRIVATE NANOEIGENPY_HAS_ACCELERATE)
168182endif ()
169183
170- if (COMMAND nanobind_add_stub)
171- nanobind_add_stub(
172- nanoeigenpy_stub
173- VERBOSE
174- MODULE nanoeigenpy
175- OUTPUT ${CMAKE_BINARY_DIR} /lib/site-packages/nanoeigenpy.pyi
176- PYTHON_PATH $<TARGET_FILE_DIR:nanoeigenpy>
177- DEPENDS nanoeigenpy
178- )
179- endif ()
184+ nanobind_add_stub(
185+ nanoeigenpy_stub
186+ VERBOSE
187+ MODULE nanoeigenpy
188+ OUTPUT ${CMAKE_BINARY_DIR} /lib/site-packages/nanoeigenpy.pyi
189+ PYTHON_PATH $<TARGET_FILE_DIR:nanoeigenpy>
190+ DEPENDS nanoeigenpy
191+ )
180192
181193jrl_python_compute_install_dir(python_install_dir)
182194# NOTE: install the whole binary dir, we need the "/" at the end to copy the content.
You can’t perform that action at this time.
0 commit comments