Skip to content

Commit 5c9487b

Browse files
committed
add debug messages to explain what we do with nanobind
if we apt install nanobind-dev on ubuntu 24, we get nanobind 1.9.1, which does not ship version from the config file
1 parent 711d587 commit 5c9487b

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

CMakeLists.txt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,27 @@ jrl_find_package(Eigen3 CONFIG REQUIRED)
3030
jrl_find_python(3.8 REQUIRED COMPONENTS Interpreter Development.Module)
3131
jrl_find_nanobind(2.5.0 CONFIG QUIET)
3232

33+
if(nanobind_ROOT AND NOT nanobind_FOUND)
34+
message(WARNING "nanobind found at ${nanobind_ROOT} but too old")
35+
endif()
36+
3337
# On Ubuntu 24.04, the nanobind-dev package ships nanobind 1.9.2.
3438
# We require >=2.5.0 for nanobind_add_stub,
3539
# NB_SUPPRESS_WARNINGS, and visitor pattern (c++)
3640
if(NOT nanobind_FOUND)
41+
set(nanobind_GIT_REPOSITORY "https://github.com/wjakob/nanobind.git")
42+
set(nanobind_GIT_TAG "v2.10.1")
43+
44+
message(
45+
STATUS
46+
"nanobind: fallback to FetchContent from ${nanobind_GIT_REPOSITORY} (tag: ${nanobind_GIT_TAG})"
47+
)
48+
3749
include(FetchContent)
3850
FetchContent_Declare(
3951
nanobind
40-
GIT_REPOSITORY https://github.com/wjakob/nanobind.git
41-
GIT_TAG v2.10.1
52+
GIT_REPOSITORY ${nanobind_GIT_REPOSITORY}
53+
GIT_TAG ${nanobind_GIT_TAG}
4254
GIT_SHALLOW True
4355
)
4456
FetchContent_MakeAvailable(nanobind)

0 commit comments

Comments
 (0)