Skip to content

Commit d9d0380

Browse files
committed
cmake fixes
1 parent 53e88b6 commit d9d0380

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

CMakeLists.txt

+10
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@ if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
2424
"MinSizeRel" "RelWithDebInfo")
2525
endif()
2626

27+
# ---------------------------------------------------------------------------
28+
# Check whether all dependencies are present
29+
# ---------------------------------------------------------------------------
30+
31+
if (NOT IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/ext/robin_map/include")
32+
message(FATAL_ERROR "The nanobind dependencies are missing! "
33+
"You probably did not clone the project with --recursive. It is possible to recover "
34+
"by invoking\n$ git submodule update --init --recursive")
35+
endif()
36+
2737
# ---------------------------------------------------------------------------
2838
# Compile with a few more compiler warnings turned on
2939
# ---------------------------------------------------------------------------

tests/CMakeLists.txt

-13
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,5 @@ if (NOT (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR) OR MSVC)
3232
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${IN_FILE} ${OUT_DIR})
3333
endforeach()
3434

35-
if (WIN32)
36-
set(OUT_FILE ${OUT_DIR}/nanobind.dll)
37-
elseif(APPLE)
38-
set(OUT_FILE ${OUT_DIR}/libnanobind.dylib)
39-
else()
40-
set(OUT_FILE ${OUT_DIR}/libnanobind.so)
41-
endif()
42-
43-
add_custom_command(
44-
DEPENDS nanobind TARGET OUTPUT ${OUT_FILE}
45-
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:nanobind> ${OUT_DIR})
46-
set(TEST_FILES_OUT ${TEST_FILES_OUT} ${OUT_FILE})
47-
4835
add_custom_target(copy-tests ALL DEPENDS ${TEST_FILES_OUT})
4936
endif()

0 commit comments

Comments
 (0)