Skip to content

Commit

Permalink
Fix exporting of include directories (rapidsai#540)
Browse files Browse the repository at this point in the history
The CUDA and cufile include directories should not be exported as absolute paths when installing, only in the build tree. Add a `$<BUILD_INTERFACE>` generator expression.

Authors:
  - Kyle Edwards (https://github.com/KyleFromNVIDIA)

Approvers:
  - Vyas Ramasubramani (https://github.com/vyasr)
  - Bradley Dice (https://github.com/bdice)

URL: rapidsai#540
  • Loading branch information
KyleFromNVIDIA authored Nov 6, 2024
1 parent dac0803 commit 130db96
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,19 @@ add_library(kvikio::kvikio ALIAS kvikio)

target_include_directories(
kvikio
PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>" "${CUDAToolkit_INCLUDE_DIRS}"
"${cuFile_INCLUDE_DIRS}"
PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
INTERFACE "$<INSTALL_INTERFACE:include>"
)

# Notice, we do not link to cuda or cufile since KvikIO opens them manually using `dlopen()`.
target_link_libraries(
kvikio
PUBLIC Threads::Threads BS::thread_pool ${CMAKE_DL_LIBS} $<TARGET_NAME_IF_EXISTS:nvtx3::nvtx3-cpp>
PUBLIC Threads::Threads
BS::thread_pool
${CMAKE_DL_LIBS}
$<TARGET_NAME_IF_EXISTS:nvtx3::nvtx3-cpp>
$<COMPILE_ONLY:$<TARGET_NAME_IF_EXISTS:CUDA::cudart>>
$<COMPILE_ONLY:$<TARGET_NAME_IF_EXISTS:cufile::cufile>>
PRIVATE $<TARGET_NAME_IF_EXISTS:CURL::libcurl>
)

Expand Down

0 comments on commit 130db96

Please sign in to comment.