Skip to content

Commit

Permalink
cmake fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
wjakob committed Jul 13, 2022
1 parent 53e88b6 commit d9d0380
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
"MinSizeRel" "RelWithDebInfo")
endif()

# ---------------------------------------------------------------------------
# Check whether all dependencies are present
# ---------------------------------------------------------------------------

if (NOT IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/ext/robin_map/include")
message(FATAL_ERROR "The nanobind dependencies are missing! "
"You probably did not clone the project with --recursive. It is possible to recover "
"by invoking\n$ git submodule update --init --recursive")
endif()

# ---------------------------------------------------------------------------
# Compile with a few more compiler warnings turned on
# ---------------------------------------------------------------------------
Expand Down
13 changes: 0 additions & 13 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,5 @@ if (NOT (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR) OR MSVC)
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${IN_FILE} ${OUT_DIR})
endforeach()

if (WIN32)
set(OUT_FILE ${OUT_DIR}/nanobind.dll)
elseif(APPLE)
set(OUT_FILE ${OUT_DIR}/libnanobind.dylib)
else()
set(OUT_FILE ${OUT_DIR}/libnanobind.so)
endif()

add_custom_command(
DEPENDS nanobind TARGET OUTPUT ${OUT_FILE}
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:nanobind> ${OUT_DIR})
set(TEST_FILES_OUT ${TEST_FILES_OUT} ${OUT_FILE})

add_custom_target(copy-tests ALL DEPENDS ${TEST_FILES_OUT})
endif()

0 comments on commit d9d0380

Please sign in to comment.