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

WIP: [DO NOT MERGE] Associate headers with raft target via a CMake FILE_SET #2528

Draft
wants to merge 25 commits into
base: branch-25.02
Choose a base branch
from
Draft
Changes from all 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
27 changes: 21 additions & 6 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,25 @@ target_include_directories(
raft INTERFACE "$<BUILD_INTERFACE:${RAFT_SOURCE_DIR}/include>" "$<INSTALL_INTERFACE:include>"
)

# associate headers with the target, so other projects can install just the
# headers via 'install(TARGETS raft)`
# TODO(jameslamb): remove commented-out stuff
file(
GLOB_RECURSE _raft_headers
#"${CMAKE_CURRENT_SOURCE_DIR}/include/*"
"include/*"
)
target_sources(
raft
PUBLIC
FILE_SET raft_headers
TYPE HEADERS
FILES
#include/raft/common/cub_wrappers.cuh
${_raft_headers}
# BASE_DIRS include/raft/
)

# Keep RAFT as lightweight as possible. Only CUDA libs and rmm should be used in global target.
target_link_libraries(
raft INTERFACE rmm::rmm rmm::rmm_logger spdlog::spdlog_header_only cuco::cuco
Expand Down Expand Up @@ -386,11 +405,13 @@ rapids_cmake_install_lib_dir(lib_dir)
include(GNUInstallDirs)
include(CPack)

message(STATUS "--- using jameslamb/raft ---")
install(
TARGETS raft
DESTINATION ${lib_dir}
COMPONENT raft
EXPORT raft-exports
FILE_SET raft_headers
)

install(
Expand Down Expand Up @@ -427,12 +448,6 @@ install(
EXPORT raft-distributed-exports
)

install(
DIRECTORY include/raft
COMPONENT raft
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)

# Temporary install of raft.hpp while the file is removed
install(
FILES include/raft.hpp
Expand Down
Loading