Skip to content

Commit

Permalink
CMake install targets: include Python files as well
Browse files Browse the repository at this point in the history
  • Loading branch information
wjakob committed Feb 18, 2024
1 parent fc77093 commit f5d8def
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions CMakeLists.txt
Expand Up @@ -52,36 +52,43 @@ if(NB_CREATE_INSTALL_RULES AND NOT CMAKE_SKIP_INSTALL_RULES)

# Normally these would be configurable by the user, but we can't allow that
# because the lookup paths are hard-coded in 'cmake/nanobind-config.cmake'
set(CMAKE_INSTALL_INCLUDEDIR "${NB_INSTALL_DATADIR}/include")
set(NB_INSTALL_SRCDIR "${NB_INSTALL_DATADIR}/src")
set(NB_INSTALL_EXTDIR "${NB_INSTALL_DATADIR}/ext")
set(NB_INSTALL_CMAKEDIR "${NB_INSTALL_DATADIR}/cmake")
set(NB_INSTALL_INC_DIR "${NB_INSTALL_DATADIR}/include")
set(NB_INSTALL_SRC_DIR "${NB_INSTALL_DATADIR}/src")
set(NB_INSTALL_EXT_DIR "${NB_INSTALL_DATADIR}/ext")
set(NB_INSTALL_MODULE_DIR "${NB_INSTALL_DATADIR}")
set(NB_INSTALL_CMAKE_DIR "${NB_INSTALL_DATADIR}/cmake")

install(
DIRECTORY include/
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
DESTINATION "${NB_INSTALL_INC_DIR}"
)

install(
DIRECTORY src/
DESTINATION "${NB_INSTALL_SRCDIR}"
DESTINATION "${NB_INSTALL_SRC_DIR}"
PATTERN "*.py" EXCLUDE
)

install(
DIRECTORY src/
DESTINATION "${NB_INSTALL_MODULE_DIR}"
FILES_MATCHING PATTERN "*\.py"
)

if(NB_USE_SUBMODULE_DEPS)
install(
DIRECTORY ext/robin_map/include/
DESTINATION "${NB_INSTALL_EXTDIR}/robin_map/include"
DESTINATION "${NB_INSTALL_EXT_DIR}/robin_map/include"
)
install(
FILES ext/robin_map/CMakeLists.txt
DESTINATION "${NB_INSTALL_EXTDIR}/robin_map"
DESTINATION "${NB_INSTALL_EXT_DIR}/robin_map"
)
endif()

install(
DIRECTORY cmake/
DESTINATION "${NB_INSTALL_CMAKEDIR}"
DESTINATION "${NB_INSTALL_CMAKE_DIR}"
)
endif()

Expand Down

0 comments on commit f5d8def

Please sign in to comment.