Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REVIEW] install cmake config file with RMM #580

Merged
merged 19 commits into from
Oct 2, 2020
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- PR #529 Add debug logging and fix multithreaded replay benchmark
- PR #560 Remove deprecated `get/set_default_resource` APIs
- PR #543 Add an arena-based memory resource
- PR #580 Install CMake config with RMM

## Improvements

Expand Down
34 changes: 31 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ endif(PER_THREAD_DEFAULT_STREAM)
# library targets

add_library(rmm INTERFACE)
add_library(rmm::rmm ALIAS rmm)

target_include_directories(rmm INTERFACE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
Expand Down Expand Up @@ -140,12 +141,39 @@ endif(BUILD_BENCHMARKS)
###################################################################################################
# install targets

include(GNUInstallDirs)
set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/rmm)

install(TARGETS rmm
DESTINATION lib)
EXPORT rmm-targets)

install(DIRECTORY include/rmm
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

include(CMakePackageConfigHelpers)
configure_package_config_file(
rmm-config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/rmm-config.cmake
germasch marked this conversation as resolved.
Show resolved Hide resolved
INSTALL_DESTINATION ${INSTALL_CONFIGDIR}
)

install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/rmm
DESTINATION include)
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/rmm-config-version.cmake
germasch marked this conversation as resolved.
Show resolved Hide resolved
COMPATIBILITY SameMinorVersion
)

install(EXPORT rmm-targets
FILE rmm-targets.cmake
NAMESPACE rmm::
DESTINATION ${INSTALL_CONFIGDIR}
)

install(FILES
${CMAKE_CURRENT_BINARY_DIR}/rmm-config.cmake
${CMAKE_CURRENT_BINARY_DIR}/rmm-config-version.cmake
germasch marked this conversation as resolved.
Show resolved Hide resolved
DESTINATION ${INSTALL_CONFIGDIR}
)

###################################################################################################
# make documentation

Expand Down
4 changes: 4 additions & 0 deletions cmake/RMM_thirdparty.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ CPMFindPackage(
GITHUB_REPOSITORY gabime/spdlog
VERSION 1.7.0
GIT_SHALLOW TRUE
OPTIONS
# If there is no pre-installed spdlog we can use, we'll install our fetched copy
# together with RMM
"SPDLOG_INSTALL TRUE"
)

###################################################################################################
Expand Down
18 changes: 18 additions & 0 deletions rmm-config.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

@PACKAGE_INIT@

cmake_minimum_required(VERSION 3.17)

include(CMakeFindDependencyMacro)
find_dependency(CUDAToolkit)
find_dependency(spdlog 1.7.0)

include("${CMAKE_CURRENT_LIST_DIR}/rmm-targets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/rmm-config-version.cmake")

check_required_components(rmm)

set(${CMAKE_FIND_PACKAGE_NAME}_CONFIG "${CMAKE_CURRENT_LIST_FILE}")

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(${CMAKE_FIND_PACKAGE_NAME} CONFIG_MODE)