Skip to content

Commit

Permalink
Migrate CMake packages to central location.
Browse files Browse the repository at this point in the history
  • Loading branch information
alliepiper committed Sep 6, 2024
1 parent 4f56b23 commit 4163ee6
Show file tree
Hide file tree
Showing 36 changed files with 117 additions and 108 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ if (CCCL_ENABLE_INSTALL_RULES)
endif()

# Support adding CCCL to a parent project via add_subdirectory.
include(cmake/CCCLAddSubdirHelper.cmake) # Always include, this is used by subprojects as well.
if (NOT CCCL_TOPLEVEL_PROJECT)
include(cmake/CCCLAddSubdir.cmake)
endif()
Expand Down
9 changes: 4 additions & 5 deletions cmake/CCCLAddSubdir.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
find_package(CCCL REQUIRED CONFIG
NO_DEFAULT_PATH # Only check the explicit path in HINTS:
HINTS "${CCCL_SOURCE_DIR}"
COMPONENTS ${CCCL_REQUIRED_COMPONENTS}
OPTIONAL_COMPONENTS ${CCCL_OPTIONAL_COMPONENTS}
cccl_add_subdir_helper(CCCL
# These component lists may be set by users to explicitly request subprojects:
REQUIRED_COMPONENTS "${CCCL_REQUIRED_COMPONENTS}"
OPTIONAL_COMPONENTS "${CCCL_OPTIONAL_COMPONENTS}"
)
43 changes: 43 additions & 0 deletions cmake/CCCLAddSubdirHelper.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# project_name: The name of the project when calling `find_package`. Case sensitive.
# `PACKAGE_FILEBASE` the name of the project in the config files, ie. ${PACKAGE_FILEBASE}-config.cmake.
# `PACKAGE_PATH` the path to the project's CMake package config files.
function(cccl_add_subdir_helper project_name)
set(options)
set(oneValueArgs PACKAGE_PATH PACKAGE_FILEBASE REQUIRED_COMPONENTS OPTIONAL_COMPONENTS)
set(multiValueArgs)
cmake_parse_arguments(CCCL_SUBDIR "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

if (DEFINED CCCL_SUBDIR_PACKAGE_FILEBASE)
set(package_filebase "${CCCL_SUBDIR_PACKAGE_FILEBASE}")
else()
string(TOLOWER "${project_name}" package_filebase)
endif()

if (DEFINED CCCL_SUBDIR_PACKAGE_PATH)
set(package_prefix "${CCCL_SUBDIR_PACKAGE_PATH}/${package_filebase}")
else()
set(package_prefix "${CCCL_SOURCE_DIR}/lib/cmake/${package_filebase}/${package_filebase}")
endif()

set(CMAKE_FIND_PACKAGE_NAME ${project_name})
set(${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS)
if (DEFINED CCCL_SUBDIR_REQUIRED_COMPONENTS)
list(APPEND ${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS ${CCCL_SUBDIR_REQUIRED_COMPONENTS})
foreach(component IN LISTS CCCL_SUBDIR_REQUIRED_COMPONENTS)
set(${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED_${component} TRUE)
endforeach()
endif()

if (DEFINED CCCL_SUBDIR_OPTIONAL_COMPONENTS)
list(APPEND ${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS ${CCCL_SUBDIR_OPTIONAL_COMPONENTS})
endif()

# This effectively does a `find_package` actually going through the find_package
# machinery. Using `find_package` works for the first configure, but creates
# inconsistencies during subsequent configurations when using CPM..
#
# More details are in the discussion at
# https://github.com/NVIDIA/libcudacxx/pull/242#discussion_r794003857
include("${package_prefix}-config-version.cmake")
include("${package_prefix}-config.cmake")
endfunction()
1 change: 1 addition & 0 deletions cmake/CCCLInstallRules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ include(GNUInstallDirs)
# CCCL has no installable binaries, no need to build before installing:
set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY TRUE)

# CMake package
install(DIRECTORY "${CCCL_SOURCE_DIR}/lib/cmake/cccl"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/"
)
5 changes: 1 addition & 4 deletions cub/cmake/CubAddSubdir.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
find_package(CUB REQUIRED CONFIG
NO_DEFAULT_PATH # Only check the explicit path in HINTS:
HINTS "${CMAKE_CURRENT_LIST_DIR}/.."
)
cccl_add_subdir_helper(CUB)
5 changes: 3 additions & 2 deletions cub/cmake/CubBuildTargetList.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,15 @@ function(cub_build_target_list)
# Set up the CUB target while testing out our find_package scripts.
find_package(CUB REQUIRED CONFIG
NO_DEFAULT_PATH # Only check the explicit path in HINTS:
HINTS "${CUB_SOURCE_DIR}"
HINTS "${CCCL_SOURCE_DIR}/lib/cmake/cub/"
)

# TODO
# Some of the iterators and unittests depend on thrust. We should break the
# cyclical dependency by migrating CUB's Thrust bits into Thrust.
find_package(Thrust ${CUB_VERSION} EXACT CONFIG
HINTS "../thrust" # Monorepo path
NO_DEFAULT_PATH # Only check the explicit path in HINTS:
HINTS "${CCCL_SOURCE_DIR}/lib/cmake/thrust/"
)

if (Thrust_FOUND)
Expand Down
6 changes: 3 additions & 3 deletions cub/cmake/CubInstallRules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ install(DIRECTORY "${CUB_SOURCE_DIR}/cub"
PATTERN "*.hpp"
)

install(DIRECTORY "${CUB_SOURCE_DIR}/cub/cmake/"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/cub"
install(DIRECTORY "${CCCL_SOURCE_DIR}/lib/cmake/cub"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/"
REGEX .*header-search.cmake.* EXCLUDE
)
# Need to configure a file to store the infix specified in
Expand All @@ -35,7 +35,7 @@ string(REGEX REPLACE "/" ";" from_install_prefix "${install_location}")
list(TRANSFORM from_install_prefix REPLACE ".+" "../")
list(JOIN from_install_prefix "" from_install_prefix)

configure_file("${CUB_SOURCE_DIR}/cub/cmake/cub-header-search.cmake.in"
configure_file("${CCCL_SOURCE_DIR}/lib/cmake/cub/cub-header-search.cmake.in"
"${CUB_BINARY_DIR}/cub/cmake/cub-header-search.cmake"
@ONLY)
install(FILES "${CUB_BINARY_DIR}/cub/cmake/cub-header-search.cmake"
Expand Down
9 changes: 1 addition & 8 deletions cudax/cmake/cudaxAddSubdir.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
# This effectively does a `find_package` actually going through the find_package
# machinery. Using `find_package` works for the first configure, but creates
# inconsistencies during subsequent configurations when using CPM..
#
# More details are in the discussion at
# https://github.com/NVIDIA/libcudacxx/pull/242#discussion_r794003857
include(${cudax_SOURCE_DIR}/lib/cmake/cudax/cudax-config-version.cmake)
include(${cudax_SOURCE_DIR}/lib/cmake/cudax/cudax-config.cmake)
cccl_add_subdir_helper(cudax)
10 changes: 9 additions & 1 deletion cudax/cmake/cudaxBuildTargetList.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,16 @@ function(_cn_add_target_to_target_list target_name dialect prefix)

cudax_set_target_properties(${target_name} ${dialect} ${prefix})

# Bring in thrust as a dev dependency, only used in tests:
find_package(Thrust ${cudax_VERSION} EXACT CONFIG
NO_DEFAULT_PATH # Only check the explicit path in HINTS:
HINTS "${CCCL_SOURCE_DIR}/lib/cmake/thrust/"
)
thrust_create_target(cudax::Thrust)

target_link_libraries(${target_name} INTERFACE
cudax::cudax
cudax::Thrust
cudax.compiler_interface_cpp${dialect}
)

Expand Down Expand Up @@ -141,7 +149,7 @@ function(cudax_build_target_list)
# Set up the cudax::cudax target while testing out our find_package scripts.
find_package(cudax REQUIRED CONFIG
NO_DEFAULT_PATH # Only check the explicit path in HINTS:
HINTS "${cudax_SOURCE_DIR}"
HINTS "${CCCL_SOURCE_DIR}/lib/cmake/cudax/"
)

# Build cudax_TARGETS
Expand Down
4 changes: 2 additions & 2 deletions cudax/cmake/cudaxInstallRules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ install(DIRECTORY "${cudax_SOURCE_DIR}/include/cuda"
)

# CMake package
install(DIRECTORY "${cudax_SOURCE_DIR}/lib/cmake/cudax"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake"
install(DIRECTORY "${CCCL_SOURCE_DIR}/lib/cmake/cudax"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/"
)
4 changes: 0 additions & 4 deletions cudax/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ CPMAddPackage("gh:catchorg/[email protected]")
add_library(catch2_main STATIC catch2_helpers/catch2_main.cpp)
target_link_libraries(catch2_main PUBLIC Catch2::Catch2)

find_package(Thrust REQUIRED CONFIG)
thrust_create_target(cudax::Thrust)

## cudax_add_test
#
# Add a catch2 test executable and register it with ctest.
Expand All @@ -28,7 +25,6 @@ function(cudax_add_catch2_test target_name_var test_name cn_target) # ARGN=test
add_executable(${test_target} ${test_sources})
target_include_directories(${test_target} PRIVATE "common")
target_link_libraries(${test_target} PRIVATE ${cn_target} Catch2::Catch2 catch2_main)
target_link_libraries(${test_target} PRIVATE ${cn_target} cudax::Thrust)
target_compile_options(${test_target} PRIVATE "-DLIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE")
target_compile_options(${test_target} PRIVATE $<$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>:--extended-lambda>)
cudax_clone_target_properties(${test_target} ${cn_target})
Expand Down
19 changes: 7 additions & 12 deletions lib/cmake/cccl/cccl-config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ if (NOT TARGET CCCL::CCCL)
add_library(CCCL::CCCL INTERFACE IMPORTED GLOBAL)
endif()

message(STATUS "Finding CCCL components: ${components}")
message(STATUS "cccl_cmake_dir: ${cccl_cmake_dir}")

foreach(component IN LISTS components)
string(TOLOWER "${component}" component_lower)

Expand All @@ -39,9 +42,7 @@ foreach(component IN LISTS components)
${cccl_quiet_flag}
${cccl_comp_required_flag}
NO_DEFAULT_PATH # Only check the explicit HINTS below:
HINTS
"${cccl_cmake_dir}/../../../libcudacxx/lib/cmake/" # Source layout (GitHub)
"${cccl_cmake_dir}/.." # Install layout
HINTS "${cccl_cmake_dir}/../libcudacxx/"
)
# Can't alias other alias targets, so use the uglified target name instead
# of libcudacxx::libcudacxx:
Expand All @@ -54,9 +55,7 @@ foreach(component IN LISTS components)
${cccl_quiet_flag}
${cccl_comp_required_flag}
NO_DEFAULT_PATH # Only check the explicit HINTS below:
HINTS
"${cccl_cmake_dir}/../../../cub/cub/cmake/" # Source layout (GitHub)
"${cccl_cmake_dir}/.." # Install layout
HINTS "${cccl_cmake_dir}/../cub/"
)
# Can't alias other alias targets, so use the uglified target name instead
# of CUB::CUB:
Expand All @@ -69,9 +68,7 @@ foreach(component IN LISTS components)
${cccl_quiet_flag}
${cccl_comp_required_flag}
NO_DEFAULT_PATH # Only check the explicit HINTS below:
HINTS
"${cccl_cmake_dir}/../../../thrust/thrust/cmake/" # Source layout (GitHub)
"${cccl_cmake_dir}/.." # Install layout
HINTS "${cccl_cmake_dir}/../thrust/"
)

if (TARGET Thrust::Thrust AND NOT TARGET CCCL::Thrust)
Expand Down Expand Up @@ -100,9 +97,7 @@ foreach(component IN LISTS components)
${cccl_quiet_flag}
${cccl_comp_required_flag}
NO_DEFAULT_PATH # Only check the explicit HINTS below:
HINTS
"${cccl_cmake_dir}/../../../cudax/lib/cmake/" # Source layout (GitHub)
"${cccl_cmake_dir}/.." # Install layout
HINTS "${cccl_cmake_dir}/../cudax/"
)
if (TARGET cudax::cudax AND NOT TARGET CCCL::cudax)
add_library(CCCL::cudax ALIAS cudax::cudax)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ if (NOT TARGET CUB::libcudacxx)
find_package(libcudacxx ${cub_libcudacxx_version} CONFIG
${_CUB_QUIET_FLAG}
NO_DEFAULT_PATH # Only check the explicit HINTS below:
HINTS
"${_CUB_INCLUDE_DIR}/../libcudacxx" # Source layout
"${_CUB_CMAKE_DIR}/.." # Install layout
HINTS "${CMAKE_CURRENT_LIST_DIR}/../libcudacxx/"
)

# A second required search allows externally packaged to be used and fails if
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Parse version information from version.h in source tree
set(_CUB_VERSION_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/../..")
set(_CUB_VERSION_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../cub")
if(EXISTS "${_CUB_VERSION_INCLUDE_DIR}/cub/version.cuh")
set(_CUB_VERSION_INCLUDE_DIR "${_CUB_VERSION_INCLUDE_DIR}" CACHE FILEPATH "" FORCE) # Clear old result
set_property(CACHE _CUB_VERSION_INCLUDE_DIR PROPERTY TYPE INTERNAL)
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ endif()

set(cn_cmake_dir "${CMAKE_CURRENT_LIST_DIR}")
set(cn_prefix_dir "${cn_cmake_dir}/../../..")
set(cn_include_dir "${cn_prefix_dir}/include")
find_path(cn_include_dir "cuda/experimental/version.cuh"
NO_DEFAULT_PATH NO_CACHE REQUIRED
HINTS
"${cn_prefix_dir}/cudax/include" # Source
"${cn_prefix_dir}/include" # Install
)

if (NOT TARGET cudax::libcudacxx)
if (NOT TARGET libcudacxx::libcudacxx)
Expand All @@ -22,9 +27,7 @@ if (NOT TARGET cudax::libcudacxx)
find_package(libcudacxx ${cudax_VERSION} CONFIG
${cn_quiet_flag}
NO_DEFAULT_PATH # Only check the explicit HINTS below:
HINTS
"${cn_prefix_dir}/../libcudacxx" # Source layout
"${cn_cmake_dir}/.." # Install layout
HINTS "${cn_cmake_dir}/../libcudacxx"
)

# A second required search allows externally packaged to be used and fails if
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Parse version information from version header:
set(_libcudacxx_VERSION_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../include")
set(_libcudacxx_VERSION_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../libcudacxx/include")
if(EXISTS "${_libcudacxx_VERSION_INCLUDE_DIR}/cuda/std/detail/__config")
set(_libcudacxx_VERSION_INCLUDE_DIR "${_libcudacxx_VERSION_INCLUDE_DIR}" CACHE FILEPATH "" FORCE) # Clear old result
set_property(CACHE _libcudacxx_VERSION_INCLUDE_DIR PROPERTY TYPE INTERNAL)
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ set(THRUST_VERSION_PATCH 0) # Thrust: "subminor" CMake: "patch"
set(THRUST_VERSION_TWEAK 0)
set(THRUST_VERSION "${THRUST_VERSION_MAJOR}.${THRUST_VERSION_MINOR}.${THRUST_VERSION_PATCH}.${THRUST_VERSION_TWEAK}")

# The package name "Thrust" differs in case from the legacy THRUST_ variables above.
# Sync both spellings:
set(${CMAKE_FIND_PACKAGE_NAME}_VERSION_MAJOR "${THRUST_VERSION_MAJOR}")
set(${CMAKE_FIND_PACKAGE_NAME}_VERSION_MINOR "${THRUST_VERSION_MINOR}")
set(${CMAKE_FIND_PACKAGE_NAME}_VERSION_PATCH "${THRUST_VERSION_PATCH}")
set(${CMAKE_FIND_PACKAGE_NAME}_VERSION_TWEAK "${THRUST_VERSION_TWEAK}")
set(${CMAKE_FIND_PACKAGE_NAME}_VERSION "${THRUST_VERSION}")

set(PACKAGE_VERSION ${THRUST_VERSION})
set(PACKAGE_VERSION_COMPATIBLE FALSE)
set(PACKAGE_VERSION_EXACT FALSE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,20 @@ set(THRUST_DEVICE_SYSTEM_OPTIONS
)

# Workaround cmake issue #20670 https://gitlab.kitware.com/cmake/cmake/-/issues/20670
# Legacy all-caps THRUST variables:
set(THRUST_VERSION ${${CMAKE_FIND_PACKAGE_NAME}_VERSION} CACHE INTERNAL "" FORCE)
set(THRUST_VERSION_MAJOR ${${CMAKE_FIND_PACKAGE_NAME}_VERSION_MAJOR} CACHE INTERNAL "" FORCE)
set(THRUST_VERSION_MINOR ${${CMAKE_FIND_PACKAGE_NAME}_VERSION_MINOR} CACHE INTERNAL "" FORCE)
set(THRUST_VERSION_PATCH ${${CMAKE_FIND_PACKAGE_NAME}_VERSION_PATCH} CACHE INTERNAL "" FORCE)
set(THRUST_VERSION_TWEAK ${${CMAKE_FIND_PACKAGE_NAME}_VERSION_TWEAK} CACHE INTERNAL "" FORCE)
set(THRUST_VERSION_COUNT ${${CMAKE_FIND_PACKAGE_NAME}_VERSION_COUNT} CACHE INTERNAL "" FORCE)
# "Thrust" (ie. CMAKE_FIND_PACKAGE_NAME) variables. Promote to cache vars:
set(${CMAKE_FIND_PACKAGE_NAME}_VERSION ${${CMAKE_FIND_PACKAGE_NAME}_VERSION} CACHE INTERNAL "" FORCE)
set(${CMAKE_FIND_PACKAGE_NAME}_VERSION_MAJOR ${${CMAKE_FIND_PACKAGE_NAME}_VERSION_MAJOR} CACHE INTERNAL "" FORCE)
set(${CMAKE_FIND_PACKAGE_NAME}_VERSION_MINOR ${${CMAKE_FIND_PACKAGE_NAME}_VERSION_MINOR} CACHE INTERNAL "" FORCE)
set(${CMAKE_FIND_PACKAGE_NAME}_VERSION_PATCH ${${CMAKE_FIND_PACKAGE_NAME}_VERSION_PATCH} CACHE INTERNAL "" FORCE)
set(${CMAKE_FIND_PACKAGE_NAME}_VERSION_TWEAK ${${CMAKE_FIND_PACKAGE_NAME}_VERSION_TWEAK} CACHE INTERNAL "" FORCE)
set(${CMAKE_FIND_PACKAGE_NAME}_VERSION_COUNT ${${CMAKE_FIND_PACKAGE_NAME}_VERSION_COUNT} CACHE INTERNAL "" FORCE)

function(thrust_create_target target_name)
thrust_debug("Assembling target ${target_name}. Options: ${ARGN}" internal)
Expand Down Expand Up @@ -550,10 +558,7 @@ macro(_thrust_find_CUDA required)
${_THRUST_QUIET_FLAG}
${required}
NO_DEFAULT_PATH # Only check the explicit HINTS below:
HINTS
"${_THRUST_INCLUDE_DIR}/dependencies/cub" # Source layout (GitHub)
"${_THRUST_INCLUDE_DIR}/../cub/cub/cmake" # Source layout (Perforce)
"${_THRUST_CMAKE_DIR}/.." # Install layout
HINTS "${_THRUST_CMAKE_DIR}/../cub/"
)

if (TARGET CUB::CUB)
Expand Down Expand Up @@ -709,9 +714,7 @@ if (NOT TARGET Thrust::libcudacxx)
find_package(libcudacxx ${thrust_libcudacxx_version} CONFIG
${_THRUST_QUIET_FLAG}
NO_DEFAULT_PATH # Only check the explicit HINTS below:
HINTS
"${_THRUST_INCLUDE_DIR}/../libcudacxx" # Source layout
"${_THRUST_CMAKE_DIR}/.." # Install layout
HINTS "${_THRUST_CMAKE_DIR}/../libcudacxx/" # Install layout
)

# A second required search allows externally packaged to be used and fails if
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Parse version information from version.h in source tree
set(_THRUST_VERSION_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/../..")
set(_THRUST_VERSION_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../thrust")
if(EXISTS "${_THRUST_VERSION_INCLUDE_DIR}/thrust/version.h")
set(_THRUST_VERSION_INCLUDE_DIR "${_THRUST_VERSION_INCLUDE_DIR}" CACHE FILEPATH "" FORCE) # Clear old result
set_property(CACHE _THRUST_VERSION_INCLUDE_DIR PROPERTY TYPE INTERNAL)
Expand Down
9 changes: 1 addition & 8 deletions libcudacxx/cmake/libcudacxxAddSubdir.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
# This effectively does a `find_package` actually going through the find_package
# machinery. Using `find_package` works for the first configure, but creates
# inconsistencies during subsequent configurations when using CPM..
#
# More details are in the discussion at
# https://github.com/NVIDIA/libcudacxx/pull/242#discussion_r794003857
include(${libcudacxx_SOURCE_DIR}/lib/cmake/libcudacxx/libcudacxx-config-version.cmake)
include(${libcudacxx_SOURCE_DIR}/lib/cmake/libcudacxx/libcudacxx-config.cmake)
cccl_add_subdir_helper(libcudacxx)
4 changes: 2 additions & 2 deletions libcudacxx/cmake/libcudacxxInstallRules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ install(DIRECTORY "${libcudacxx_SOURCE_DIR}/include/nv"
)

# Libcudacxx cmake package
install(DIRECTORY "${libcudacxx_SOURCE_DIR}/lib/cmake/libcudacxx"
install(DIRECTORY "${CCCL_SOURCE_DIR}/lib/cmake/libcudacxx"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake"
REGEX .*header-search.cmake.* EXCLUDE
)
Expand All @@ -46,7 +46,7 @@ string(REGEX REPLACE "/" ";" from_install_prefix "${install_location}")
list(TRANSFORM from_install_prefix REPLACE ".+" "../")
list(JOIN from_install_prefix "" from_install_prefix)

configure_file("${libcudacxx_SOURCE_DIR}/lib/cmake/libcudacxx/libcudacxx-header-search.cmake.in"
configure_file("${CCCL_SOURCE_DIR}/lib/cmake/libcudacxx/libcudacxx-header-search.cmake.in"
"${libcudacxx_BINARY_DIR}/lib/cmake/libcudacxx/libcudacxx-header-search.cmake"
@ONLY
)
Expand Down
2 changes: 1 addition & 1 deletion libcudacxx/cmake/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ endfunction()
libcudacxx_add_compile_test(test_name
test_export
source_tree
-D "libcudacxx_DIR=${libcudacxx_SOURCE_DIR}/lib/cmake/libcudacxx/"
-D "libcudacxx_DIR=${CCCL_SOURCE_DIR}/lib/cmake/libcudacxx/"
-D TEST_TYPE=SOURCE_TREE
)

Expand Down
1 change: 0 additions & 1 deletion test/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ foreach (root_type IN ITEMS SOURCE INSTALL)
"${suffix}"
${cmake_opts}
-D "CCCL_ROOT=${cccl_root}"
-D "ROOT_TYPE=${root_type}"
-D "COMPONENTS=${components}"
-D "PACKAGE_TYPE=${package_type}"
-D "CCCL_ENABLE_UNSTABLE=${CCCL_ENABLE_UNSTABLE}"
Expand Down
Loading

0 comments on commit 4163ee6

Please sign in to comment.