-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate CMake packages to central location.
- Loading branch information
1 parent
4f56b23
commit 4163ee6
Showing
36 changed files
with
117 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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. | ||
|
@@ -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}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
cub/cub/cmake/cub-header-search.cmake → lib/cmake/cub/cub-header-search.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...libcudacxx/libcudacxx-header-search.cmake → ...libcudacxx/libcudacxx-header-search.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...t/thrust/cmake/thrust-header-search.cmake → lib/cmake/thrust/thrust-header-search.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.