diff --git a/CMakeLists.txt b/CMakeLists.txt index ba1104c08..b5313854c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,7 +37,7 @@ if(NOT "${rapids-cmake-dir}" IN_LIST CMAKE_MODULE_PATH) list(APPEND CMAKE_MODULE_PATH "${rapids-cmake-dir}") endif() -#install a hook that sets up `rapids-cmake-dir` and `CMAKE_MODULE_PATH` -#all the way up the call-stack -cmake_language(DEFER DIRECTORY ${CMAKE_CURRENT_LIST_DIR} - CALL include "${rapids-cmake-dir}/../init.cmake") +# install a hook that sets up `rapids-cmake-dir` and `CMAKE_MODULE_PATH` all the way up the +# call-stack +cmake_language(DEFER DIRECTORY ${CMAKE_CURRENT_LIST_DIR} CALL include + "${rapids-cmake-dir}/../init.cmake") diff --git a/ci/checks/cmake_config_format.json b/ci/checks/cmake_config_format.json new file mode 100644 index 000000000..6025b3da4 --- /dev/null +++ b/ci/checks/cmake_config_format.json @@ -0,0 +1,11 @@ +{ + "format": { + "line_width": 100, + "tab_size": 2, + "command_case": "unchanged", + "dangle_parens": false, + "max_subgroups_hwrap": 4, + "min_prefix_chars": 32, + "max_pargs_hwrap": 999 + } +} diff --git a/ci/checks/cmake_config_lint.json b/ci/checks/cmake_config_lint.json new file mode 100644 index 000000000..56f84be4a --- /dev/null +++ b/ci/checks/cmake_config_lint.json @@ -0,0 +1,14 @@ +{ + "lint": { + "disabled_codes": ["C0301", "C0112"], + "function_pattern": "[0-9A-z_]+", + "macro_pattern": "[0-9A-z_]+", + "global_var_pattern": "[A-z][0-9A-z_]+", + "internal_var_pattern": "rapids[_-][A-z][0-9A-z_]+", + "local_var_pattern": "[A-z][A-z0-9_]+", + "private_var_pattern": "rapids[_-][0-9A-z_]+", + "public_var_pattern": "[A-z][0-9A-z_]+", + "argument_var_pattern": "[A-z][A-z0-9_]+", + "keyword_pattern": "[A-z][0-9A-z_]+" + } +} diff --git a/ci/checks/cmake_config_testing_lint.json b/ci/checks/cmake_config_testing_lint.json new file mode 100644 index 000000000..7c26cfa87 --- /dev/null +++ b/ci/checks/cmake_config_testing_lint.json @@ -0,0 +1,14 @@ +{ + "lint": { + "disabled_codes": ["C0301", "C0111","C0112"], + "function_pattern": "[0-9A-z_]+", + "macro_pattern": "[0-9A-z_]+", + "global_var_pattern": "[A-z][0-9A-z_]+", + "internal_var_pattern": "_[A-z][0-9A-z_]+", + "local_var_pattern": "[A-z][A-z0-9_]+", + "private_var_pattern": "_[0-9A-z_]+", + "public_var_pattern": "[A-z][0-9A-z_]+", + "argument_var_pattern": "[A-z][A-z0-9_]+", + "keyword_pattern": "[A-z][0-9A-z_]+" + } +} diff --git a/ci/checks/style.sh b/ci/checks/style.sh old mode 100644 new mode 100755 index f5ad2d368..9e1570266 --- a/ci/checks/style.sh +++ b/ci/checks/style.sh @@ -3,3 +3,69 @@ ############################# # rapids-cmake Style Tester # ############################# + +# Ignore errors and set path +set +e +PATH=/opt/conda/bin:$PATH +LC_ALL=C.UTF-8 +LANG=C.UTF-8 + +# Activate common conda env +. /opt/conda/etc/profile.d/conda.sh +conda activate rapids + +# Run cmake-format / cmake-lint and get results/return code +CMAKE_FILES=(`find rapids-cmake/ | grep -E "^.*\.cmake?$|^.*/CMakeLists.txt$"`) +CMAKE_FILES+=("CMakeLists.txt") + +CMAKE_FORMATS=() +CMAKE_FORMAT_RETVAL=0 + +CMAKE_LINTS=() +CMAKE_LINT_RETVAL=0 + +for cmake_file in "${CMAKE_FILES[@]}"; do + cmake-format --in-place --first-comment-is-literal --config-files ./cmake-format-rapids-cmake.json ./ci/checks/cmake_config_format.json -- ${cmake_file} + TMP_CMAKE_FORMAT=`git diff --color --exit-code -- ${cmake_file}` + TMP_CMAKE_FORMAT_RETVAL=$? + if [ "$TMP_CMAKE_FORMAT_RETVAL" != "0" ]; then + CMAKE_FORMAT_RETVAL=1 + CMAKE_FORMATS+=("$TMP_CMAKE_FORMAT") + fi + + TMP_CMAKE_LINT=`cmake-lint --config-files ./cmake-format-rapids-cmake.json ./ci/checks/cmake_config_format.json ./ci/checks/cmake_config_lint.json -- ${cmake_file}` + TMP_CMAKE_LINT_RETVAL=$? + if [ "$TMP_CMAKE_LINT_RETVAL" != "0" ]; then + CMAKE_LINT_RETVAL=1 + CMAKE_LINTS+=("$TMP_CMAKE_LINT") + fi +done + +# Output results if failure otherwise show pass +if [ "$CMAKE_FORMAT_RETVAL" != "0" ]; then + echo -e "\n\n>>>> FAILED: cmake format check; begin output\n\n" + for CMAKE_FORMAT in "${CMAKE_FORMATS[@]}"; do + echo -e "$CMAKE_FORMAT" + echo -e "\n" + done + echo -e "\n\n>>>> FAILED: cmake format check; end output\n\n" +else + echo -e "\n\n>>>> PASSED: cmake format check\n\n" +fi + +if [ "$CMAKE_LINT_RETVAL" != "0" ]; then + echo -e "\n\n>>>> FAILED: cmake lint check; begin output\n\n" + for CMAKE_LINT in "${CMAKE_LINTS[@]}"; do + echo -e "$CMAKE_LINT" + echo -e "\n" + done + echo -e "\n\n>>>> FAILED: cmake lint check; end output\n\n" +else + echo -e "\n\n>>>> PASSED: cmake lint check\n\n" +fi + +RETVALS=($CMAKE_FORMAT_RETVAL $CMAKE_LINT_RETVAL) +IFS=$'\n' +RETVAL=`echo "${RETVALS[*]}" | sort -nr | head -n1` + +exit $RETVAL diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh new file mode 100755 index 000000000..33ec31e8f --- /dev/null +++ b/ci/release/update-version.sh @@ -0,0 +1,55 @@ +#!/bin/bash +######################## +# rapids-cmake Version Updater # +######################## + +## Usage +# bash update-version.sh +# where is either `major`, `minor`, `patch` + +set -e + +# Grab argument for release type +RELEASE_TYPE=$1 + +# Get current version and calculate next versions +CURRENT_TAG=`git tag | grep -xE 'v[0-9\.]+' | sort --version-sort | tail -n 1 | tr -d 'v'` +CURRENT_MAJOR=`echo $CURRENT_TAG | awk '{split($0, a, "."); print a[1]}'` +CURRENT_MINOR=`echo $CURRENT_TAG | awk '{split($0, a, "."); print a[2]}'` +CURRENT_PATCH=`echo $CURRENT_TAG | awk '{split($0, a, "."); print a[3]}'` +NEXT_MAJOR=$((CURRENT_MAJOR + 1)) +NEXT_MINOR=$((CURRENT_MINOR + 1)) +NEXT_PATCH=$((CURRENT_PATCH + 1)) +NEXT_FULL_TAG="" +NEXT_SHORT_TAG="" + +# Determine release type +if [ "$RELEASE_TYPE" == "major" ]; then + NEXT_FULL_TAG="${NEXT_MAJOR}.0.0" + NEXT_SHORT_TAG="${NEXT_MAJOR}.0" +elif [ "$RELEASE_TYPE" == "minor" ]; then + NEXT_FULL_TAG="${CURRENT_MAJOR}.${NEXT_MINOR}.0" + NEXT_SHORT_TAG="${CURRENT_MAJOR}.${NEXT_MINOR}" +elif [ "$RELEASE_TYPE" == "patch" ]; then + NEXT_FULL_TAG="${CURRENT_MAJOR}.${CURRENT_MINOR}.${NEXT_PATCH}" + NEXT_SHORT_TAG="${CURRENT_MAJOR}.${CURRENT_MINOR}" +else + echo "Incorrect release type; use 'major', 'minor', or 'patch' as an argument" + exit 1 +fi + +echo "Preparing '$RELEASE_TYPE' release [$CURRENT_TAG -> $NEXT_FULL_TAG]" + +# Inplace sed replace; workaround for Linux and Mac +function sed_runner() { + sed -i.bak ''"$1"'' $2 && rm -f ${2}.bak +} + +sed_runner 's/'" VERSION .*"'/'" VERSION ${NEXT_FULL_TAG}"'/g' CMakeLists.txt + +sed_runner 's/version=.*/version=\"'"${NEXT_FULL_TAG}"'\",/g' python/setup.py + +sed_runner 's/'"PROJECT_NUMBER = .*"'/'"PROJECT_NUMBER = ${NEXT_SHORT_TAG}"'/g' doxygen/Doxyfile + +sed_runner 's/'"version =.*"'/'"version = \"${NEXT_SHORT_TAG}\""'/g' python/docs/conf.py +sed_runner 's/'"release =.*"'/'"release = \"${NEXT_FULL_TAG}\""'/g' python/docs/conf.py diff --git a/rapids-cmake/cmake/build_type.cmake b/rapids-cmake/cmake/build_type.cmake index dbf661d6a..7c91542fa 100644 --- a/rapids-cmake/cmake/build_type.cmake +++ b/rapids-cmake/cmake/build_type.cmake @@ -15,7 +15,6 @@ #============================================================================= include_guard(GLOBAL) - #[=======================================================================[.rst: rapids_cmake_build_type ----------------------- @@ -45,8 +44,9 @@ function(rapids_cmake_build_type default_type) if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) message(VERBOSE "Setting build type to '${default_type}' since none specified.") - set(CMAKE_BUILD_TYPE "${default_type}" CACHE STRING "Choose the type of build." FORCE) + set(CMAKE_BUILD_TYPE "${default_type}" CACHE STRING "Choose the type of build." FORCE) # Set the possible values of build type for cmake-gui - set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" + "RelWithDebInfo") endif() endfunction() diff --git a/rapids-cmake/cmake/make_global.cmake b/rapids-cmake/cmake/make_global.cmake index bd644aea8..b1f337ef9 100644 --- a/rapids-cmake/cmake/make_global.cmake +++ b/rapids-cmake/cmake/make_global.cmake @@ -15,7 +15,6 @@ #============================================================================= include_guard(GLOBAL) - #[=======================================================================[.rst: rapids_cmake_make_global ------------------------ diff --git a/rapids-cmake/cmake/parse_version.cmake b/rapids-cmake/cmake/parse_version.cmake index 0e56044a4..22c2873b1 100644 --- a/rapids-cmake/cmake/parse_version.cmake +++ b/rapids-cmake/cmake/parse_version.cmake @@ -15,7 +15,6 @@ #============================================================================= include_guard(GLOBAL) - #[=======================================================================[.rst: rapids_cmake_parse_version -------------------------- @@ -74,9 +73,8 @@ function(rapids_cmake_parse_version mode version_value out_variable_name) list(LENGTH version_as_list len) - # Extract each component and make sure they aren't - # empty before setting. Enforces the rule that - # a value/character must exist between each `.` + # Extract each component and make sure they aren't empty before setting. Enforces the rule that a + # value/character must exist between each `.` if(mode STREQUAL "MAJOR" AND len GREATER_EQUAL 1) list(GET version_as_list 0 extracted_component) if(NOT extracted_component STREQUAL "") @@ -98,8 +96,7 @@ function(rapids_cmake_parse_version mode version_value out_variable_name) elseif(mode STREQUAL "MAJOR_MINOR" AND len GREATER_EQUAL 2) list(GET version_as_list 0 extracted_major) list(GET version_as_list 1 extracted_minor) - if(NOT extracted_major STREQUAL "" AND - NOT extracted_minor STREQUAL "") + if(NOT extracted_major STREQUAL "" AND NOT extracted_minor STREQUAL "") set(${out_variable_name} "${extracted_major}.${extracted_minor}" PARENT_SCOPE) endif() diff --git a/rapids-cmake/cmake/support_conda_env.cmake b/rapids-cmake/cmake/support_conda_env.cmake index 63a24f0d4..928257c8b 100644 --- a/rapids-cmake/cmake/support_conda_env.cmake +++ b/rapids-cmake/cmake/support_conda_env.cmake @@ -15,7 +15,6 @@ #============================================================================= include_guard(GLOBAL) - #[=======================================================================[.rst: rapids_cmake_support_conda_env ------------------------------ @@ -63,37 +62,39 @@ function(rapids_cmake_support_conda_env target) if("$ENV{CONDA_BUILD}" STREQUAL "1") set(in_conda_build True) elseif(DEFINED ENV{CONDA_PREFIX}) - set(in_conda_prefix True) + set(in_conda_prefix True) endif() if(in_conda_build OR in_conda_prefix) - if (ARGV1 STREQUAL "MODIFY_PREFIX_PATH") - set(modify_prefix_path TRUE ) + if(ARGV1 STREQUAL "MODIFY_PREFIX_PATH") + set(modify_prefix_path TRUE) endif() - add_library(${target} INTERFACE ) - set(prefix_paths ) + add_library(${target} INTERFACE) + set(prefix_paths) if(in_conda_build) - target_include_directories(${target} INTERFACE "$ENV{BUILD_PREFIX}/include" "$ENV{PREFIX}/include") - target_link_directories(${target} INTERFACE "$ENV{BUILD_PREFIX}/lib" "$ENV{PREFIX}/lib") + target_include_directories(${target} INTERFACE "$ENV{BUILD_PREFIX}/include" + "$ENV{PREFIX}/include") + target_link_directories(${target} INTERFACE "$ENV{BUILD_PREFIX}/lib" "$ENV{PREFIX}/lib") - if( modify_prefix_path ) - list(PREPEND CMAKE_PREFIX_PATH "$ENV{BUILD_PREFIX}" "$ENV{PREFIX}") - set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH}" PARENT_SCOPE) - message(VERBOSE "Conda build detected, CMAKE_PREFIX_PATH set to: ${CMAKE_PREFIX_PATH}") - endif() + if(modify_prefix_path) + list(PREPEND CMAKE_PREFIX_PATH "$ENV{BUILD_PREFIX}" "$ENV{PREFIX}") + set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH}" PARENT_SCOPE) + message(VERBOSE "Conda build detected, CMAKE_PREFIX_PATH set to: ${CMAKE_PREFIX_PATH}") + endif() elseif(in_conda_prefix) - target_include_directories(${target} INTERFACE "$ENV{CONDA_PREFIX}/include") - target_link_directories(${target} INTERFACE "$ENV{CONDA_PREFIX}/lib") - - if( modify_prefix_path ) - list(PREPEND CMAKE_PREFIX_PATH "$ENV{CONDA_PREFIX}") - set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH}" PARENT_SCOPE) - message(VERBOSE "Conda environment detected, CMAKE_PREFIX_PATH set to: ${CMAKE_PREFIX_PATH}") - endif() + target_include_directories(${target} INTERFACE "$ENV{CONDA_PREFIX}/include") + target_link_directories(${target} INTERFACE "$ENV{CONDA_PREFIX}/lib") + + if(modify_prefix_path) + list(PREPEND CMAKE_PREFIX_PATH "$ENV{CONDA_PREFIX}") + set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH}" PARENT_SCOPE) + message(VERBOSE + "Conda environment detected, CMAKE_PREFIX_PATH set to: ${CMAKE_PREFIX_PATH}") + endif() endif() endif() endfunction() diff --git a/rapids-cmake/cmake/write_version_file.cmake b/rapids-cmake/cmake/write_version_file.cmake index 078e4c603..64e17c77a 100644 --- a/rapids-cmake/cmake/write_version_file.cmake +++ b/rapids-cmake/cmake/write_version_file.cmake @@ -15,7 +15,6 @@ #============================================================================= include_guard(GLOBAL) - #[=======================================================================[.rst: rapids_cmake_write_version_file ------------------------------- @@ -77,5 +76,6 @@ function(rapids_cmake_write_version_file file_path) set(RAPIDS_WRITE_PATCH 0) endif() - configure_file("${CMAKE_CURRENT_FUNCTION_LIST_DIR}/template/version.hpp.in" "${output_path}" @ONLY) + configure_file("${CMAKE_CURRENT_FUNCTION_LIST_DIR}/template/version.hpp.in" "${output_path}" + @ONLY) endfunction() diff --git a/rapids-cmake/cpm/find.cmake b/rapids-cmake/cpm/find.cmake index 2df447f4f..e65b47c44 100644 --- a/rapids-cmake/cpm/find.cmake +++ b/rapids-cmake/cpm/find.cmake @@ -78,7 +78,7 @@ consistency. List all targets used by your project in `GLOBAL_TARGET`. #]=======================================================================] -function(rapids_cpm_find name version ) +function(rapids_cpm_find name version) list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.cpm.find") set(options CPM_ARGS) set(one_value BUILD_EXPORT_SET INSTALL_EXPORT_SET) @@ -95,13 +95,7 @@ function(rapids_cpm_find name version ) rapids_cmake_make_global(RAPIDS_GLOBAL_TARGETS) endif() - #Propagate up variables that CPMFindPackage provide - set("${name}_SOURCE_DIR" "${${name}_SOURCE_DIR}" PARENT_SCOPE) - set("${name}_BINARY_DIR" "${${name}_BINARY_DIR}" PARENT_SCOPE) - set("${name}_ADDED" "${${name}_ADDED}" PARENT_SCOPE) - - - set(extra_info ) + set(extra_info) if(RAPIDS_GLOBAL_TARGETS) set(extra_info "GLOBAL_TARGETS") list(APPEND extra_info ${RAPIDS_GLOBAL_TARGETS}) @@ -110,9 +104,8 @@ function(rapids_cpm_find name version ) if(RAPIDS_BUILD_EXPORT_SET) include("${rapids-cmake-dir}/export/cpm.cmake") rapids_export_cpm(BUILD ${name} ${RAPIDS_BUILD_EXPORT_SET} - CPM_ARGS NAME ${name} VERSION ${version} ${RAPIDS_UNPARSED_ARGUMENTS} - ${extra_info} - ) + CPM_ARGS NAME ${name} VERSION ${version} ${RAPIDS_UNPARSED_ARGUMENTS} + ${extra_info}) endif() if(RAPIDS_INSTALL_EXPORT_SET) @@ -120,4 +113,9 @@ function(rapids_cpm_find name version ) rapids_export_package(INSTALL ${name} ${RAPIDS_INSTALL_EXPORT_SET} ${extra_info}) endif() + # Propagate up variables that CPMFindPackage provide + set(${name}_SOURCE_DIR "${${name}_SOURCE_DIR}" PARENT_SCOPE) + set(${name}_BINARY_DIR "${${name}_BINARY_DIR}" PARENT_SCOPE) + set(${name}_ADDED "${${name}_ADDED}" PARENT_SCOPE) + endfunction() diff --git a/rapids-cmake/cpm/init.cmake b/rapids-cmake/cpm/init.cmake index bc9ded6ce..7e824b5d4 100644 --- a/rapids-cmake/cpm/init.cmake +++ b/rapids-cmake/cpm/init.cmake @@ -15,7 +15,6 @@ #============================================================================= include_guard(GLOBAL) - #[=======================================================================[.rst: rapids_cpm_init ------------------- @@ -37,7 +36,7 @@ in the build tree of the calling project Must be called before any invocation of :cmake:command:`rapids_cpm_find`. #]=======================================================================] -function(rapids_cpm_init ) +function(rapids_cpm_init) list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.cpm.init") set(CPM_DOWNLOAD_VERSION 7644c3a40fc7889f8dee53ce21e85dc390b883dc) # 0.32.1 @@ -53,10 +52,9 @@ function(rapids_cpm_init ) if(NOT (EXISTS ${CPM_DOWNLOAD_LOCATION})) message(VERBOSE "Downloading CPM.cmake to ${CPM_DOWNLOAD_LOCATION}") - file( - DOWNLOAD - https://raw.githubusercontent.com/cpm-cmake/CPM.cmake/${CPM_DOWNLOAD_VERSION}/cmake/CPM.cmake - ${CPM_DOWNLOAD_LOCATION}) + file(DOWNLOAD + https://raw.githubusercontent.com/cpm-cmake/CPM.cmake/${CPM_DOWNLOAD_VERSION}/cmake/CPM.cmake + ${CPM_DOWNLOAD_LOCATION}) endif() include(${CPM_DOWNLOAD_LOCATION}) diff --git a/rapids-cmake/cuda/detail/detect_architectures.cmake b/rapids-cmake/cuda/detail/detect_architectures.cmake index 114a294ee..2ff4e1cb3 100644 --- a/rapids-cmake/cuda/detail/detect_architectures.cmake +++ b/rapids-cmake/cuda/detail/detect_architectures.cmake @@ -15,23 +15,20 @@ #============================================================================= include_guard(GLOBAL) - # Function uses the CUDA runtime API to query the compute capability of the device, so if a user # doesn't pass any architecture options to CMake we only build the current architecture function(rapids_cuda_detect_architectures possible_archs_var gpu_archs) list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.cuda.detect_architectures") - # Unset this first in case it's set to - # Which can happen inside rapids + # Unset this first in case it's set to Which can happen inside rapids set(CMAKE_CUDA_ARCHITECTURES OFF) set(possible_archs ${${possible_archs_var}}) set(eval_file ${PROJECT_BINARY_DIR}/eval_gpu_archs.cu) set(eval_exe ${PROJECT_BINARY_DIR}/eval_gpu_archs) set(error_file ${PROJECT_BINARY_DIR}/eval_gpu_archs.stderr.log) - file( - WRITE ${eval_file} - " + file(WRITE ${eval_file} + " #include #include #include @@ -64,11 +61,9 @@ int main(int argc, char** argv) { set(__gpu_archs "${possible_archs}") if(DEFINED CMAKE_CUDA_COMPILER) - execute_process( - COMMAND ${CMAKE_CUDA_COMPILER} -std=c++11 -o ${eval_exe} --run ${eval_file} - OUTPUT_VARIABLE __gpu_archs - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_FILE ${error_file}) + execute_process(COMMAND ${CMAKE_CUDA_COMPILER} -std=c++11 -o ${eval_exe} --run ${eval_file} + OUTPUT_VARIABLE __gpu_archs OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_FILE ${error_file}) message(STATUS "Auto detection of gpu-archs: ${__gpu_archs}") endif() diff --git a/rapids-cmake/cuda/detail/invoke_set_all_architectures.cmake b/rapids-cmake/cuda/detail/invoke_set_all_architectures.cmake index 6c896e2dd..a4f905750 100644 --- a/rapids-cmake/cuda/detail/invoke_set_all_architectures.cmake +++ b/rapids-cmake/cuda/detail/invoke_set_all_architectures.cmake @@ -20,7 +20,7 @@ if(DEFINED RAPIDS_PREVIOUS_CMAKE_PROJECT_INCLUDE) include("${RAPIDS_PREVIOUS_CMAKE_PROJECT_INCLUDE}") endif() # -# Used by rapids_cuda_init_architectures to allow the `project()` call to -# invoke the rapids_cuda_set_architectures function after compiler detection +# Used by rapids_cuda_init_architectures to allow the `project()` call to invoke the +# rapids_cuda_set_architectures function after compiler detection # rapids_cuda_set_architectures(ALL) diff --git a/rapids-cmake/cuda/detail/invoke_set_native_architectures.cmake b/rapids-cmake/cuda/detail/invoke_set_native_architectures.cmake index 0ae15bd63..8d39f8024 100644 --- a/rapids-cmake/cuda/detail/invoke_set_native_architectures.cmake +++ b/rapids-cmake/cuda/detail/invoke_set_native_architectures.cmake @@ -20,7 +20,7 @@ if(DEFINED RAPIDS_PREVIOUS_CMAKE_PROJECT_INCLUDE) include("${RAPIDS_PREVIOUS_CMAKE_PROJECT_INCLUDE}") endif() # -# Used by rapids_cuda_init_architectures to allow the `project()` call to -# invoke the rapids_cuda_set_architectures function after compiler detection +# Used by rapids_cuda_init_architectures to allow the `project()` call to invoke the +# rapids_cuda_set_architectures function after compiler detection # rapids_cuda_set_architectures(NATIVE) diff --git a/rapids-cmake/cuda/init_architectures.cmake b/rapids-cmake/cuda/init_architectures.cmake index 160a2718c..3cc237068 100644 --- a/rapids-cmake/cuda/init_architectures.cmake +++ b/rapids-cmake/cuda/init_architectures.cmake @@ -15,7 +15,6 @@ #============================================================================= include_guard(GLOBAL) - #[=======================================================================[.rst: rapids_cuda_init_architectures ------------------------------- @@ -72,19 +71,19 @@ Example on how to properly use :cmake:command:`rapids_cuda_init_architectures`: #]=======================================================================] +# cmake-lint: disable=W0105 function(rapids_cuda_init_architectures project_name) list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.cuda.init_architectures") # If `CMAKE_CUDA_ARCHITECTURES` is not defined, build for all supported architectures. If # `CMAKE_CUDA_ARCHITECTURES` is set to an empty string (""), build for only the current # architecture. If `CMAKE_CUDA_ARCHITECTURES` is specified by the user, use user setting. - # This needs to be run before enabling the CUDA language since RAPIDS supports the magic - # string of "ALL" + # This needs to be run before enabling the CUDA language since RAPIDS supports the magic string of + # "ALL" if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES OR CMAKE_CUDA_ARCHITECTURES STREQUAL "ALL") set(CMAKE_CUDA_ARCHITECTURES OFF PARENT_SCOPE) set(load_file "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/detail/invoke_set_all_architectures.cmake") - elseif(CMAKE_CUDA_ARCHITECTURES STREQUAL "" OR - CMAKE_CUDA_ARCHITECTURES STREQUAL "NATIVE") + elseif(CMAKE_CUDA_ARCHITECTURES STREQUAL "" OR CMAKE_CUDA_ARCHITECTURES STREQUAL "NATIVE") set(CMAKE_CUDA_ARCHITECTURES OFF PARENT_SCOPE) set(load_file "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/detail/invoke_set_native_architectures.cmake") endif() @@ -92,14 +91,13 @@ function(rapids_cuda_init_architectures project_name) if(load_file) include("${CMAKE_CURRENT_FUNCTION_LIST_DIR}/set_architectures.cmake") - # Setup to call to set CMAKE_CUDA_ARCHITECTURES values to occur right after - # the project call + # Setup to call to set CMAKE_CUDA_ARCHITECTURES values to occur right after the project call # https://cmake.org/cmake/help/latest/command/project.html#code-injection # - # If an existing file was specified for loading post `project` we will - # chain include them + # If an existing file was specified for loading post `project` we will chain include them if(DEFINED CMAKE_PROJECT_${project_name}_INCLUDE) - set(RAPIDS_PREVIOUS_CMAKE_PROJECT_INCLUDE "${CMAKE_PROJECT_${project_name}_INCLUDE}" PARENT_SCOPE) + set(RAPIDS_PREVIOUS_CMAKE_PROJECT_INCLUDE "${CMAKE_PROJECT_${project_name}_INCLUDE}" + PARENT_SCOPE) endif() set(CMAKE_PROJECT_${project_name}_INCLUDE "${load_file}" PARENT_SCOPE) endif() diff --git a/rapids-cmake/cuda/init_runtime.cmake b/rapids-cmake/cuda/init_runtime.cmake index 7687e565c..fe2f43c81 100644 --- a/rapids-cmake/cuda/init_runtime.cmake +++ b/rapids-cmake/cuda/init_runtime.cmake @@ -15,7 +15,6 @@ #============================================================================= include_guard(GLOBAL) - #[=======================================================================[.rst: rapids_cuda_init_runtime ------------------------------- @@ -52,4 +51,3 @@ function(rapids_cuda_init_runtime use_static value) endif() endif() endfunction() - diff --git a/rapids-cmake/cuda/set_architectures.cmake b/rapids-cmake/cuda/set_architectures.cmake index 0ad588976..f9484bb2b 100644 --- a/rapids-cmake/cuda/set_architectures.cmake +++ b/rapids-cmake/cuda/set_architectures.cmake @@ -15,7 +15,6 @@ #============================================================================= include_guard(GLOBAL) - #[=======================================================================[.rst: rapids_cuda_set_architectures ------------------------------- @@ -69,9 +68,7 @@ function(rapids_cuda_set_architectures mode) list(REMOVE_ITEM supported_archs "62" "72") endif() - - if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA" AND - CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 11.1.0) + if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA" AND CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 11.1.0) list(REMOVE_ITEM supported_archs "86") endif() diff --git a/rapids-cmake/export/cpm.cmake b/rapids-cmake/export/cpm.cmake index bbbb21306..b0e0f37df 100644 --- a/rapids-cmake/export/cpm.cmake +++ b/rapids-cmake/export/cpm.cmake @@ -63,31 +63,26 @@ function(rapids_export_cpm type name export_set) set(multi_value GLOBAL_TARGETS CPM_ARGS) cmake_parse_arguments(RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) - #Export out the build-dir incase it has build directory find-package support + # Export out the build-dir incase it has build directory find-package support if(type STREQUAL build) set(build_dir "${${name}_BINARY_DIR}") endif() - configure_file( - "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/template/cpm.cmake.in" - "${CMAKE_BINARY_DIR}/rapids-cmake/${export_set}/${type}/${name}.cmake" - @ONLY) + configure_file("${CMAKE_CURRENT_FUNCTION_LIST_DIR}/template/cpm.cmake.in" + "${CMAKE_BINARY_DIR}/rapids-cmake/${export_set}/${type}/${name}.cmake" @ONLY) - if(NOT TARGET rapids_export_${type}_${export_set} ) + if(NOT TARGET rapids_export_${type}_${export_set}) add_library(rapids_export_${type}_${export_set} INTERFACE) endif() - #Record that we need CPM injected into the export set - set_property(TARGET rapids_export_${type}_${export_set} - PROPERTY "REQUIRES_CPM" TRUE) + # Record that we need CPM injected into the export set + set_property(TARGET rapids_export_${type}_${export_set} PROPERTY "REQUIRES_CPM" TRUE) - #Need to record the to `rapids_export_${type}_${export_set}` - set_property(TARGET rapids_export_${type}_${export_set} - APPEND - PROPERTY "PACKAGE_NAMES" "${name}") + # Need to record the to `rapids_export_${type}_${export_set}` + set_property(TARGET rapids_export_${type}_${export_set} APPEND PROPERTY "PACKAGE_NAMES" "${name}") if(RAPIDS_GLOBAL_TARGETS) - #record our targets that need to be marked as global when imported + # record our targets that need to be marked as global when imported target_link_libraries(rapids_export_${type}_${export_set} INTERFACE ${RAPIDS_GLOBAL_TARGETS}) endif() diff --git a/rapids-cmake/export/export.cmake b/rapids-cmake/export/export.cmake index a2ffba08a..00db48f4a 100644 --- a/rapids-cmake/export/export.cmake +++ b/rapids-cmake/export/export.cmake @@ -151,6 +151,7 @@ Example on how to properly use :cmake:command:`rapids_export`: #]=======================================================================] +# cmake-lint: disable=R0912,R0915,W0105 function(rapids_export type project_name) include(GNUInstallDirs) include(CMakePackageConfigHelpers) @@ -169,8 +170,8 @@ function(rapids_export type project_name) set(rapids_version_set ON) if(DEFINED RAPIDS_VERSION AND NOT RAPIDS_VERSION) - # We need to capture `VERSION OFF` so we need to make sure it has - # an off value, and not just undefined + # We need to capture `VERSION OFF` so we need to make sure it has an off value, and not just + # undefined set(rapids_version_set OFF) unset(RAPIDS_VERSION) # unset this so we don't export a version value of `OFF` elseif(NOT DEFINED RAPIDS_VERSION AND NOT DEFINED PROJECT_VERSION) @@ -187,7 +188,7 @@ function(rapids_export type project_name) rapids_cmake_parse_version(PATCH "${RAPIDS_VERSION}" rapdis_orig_patch_version) # Generate an explicit VERSION string without zeroes to work around: - # https://gitlab.kitware.com/cmake/cmake/-/issues/22207 + # https://gitlab.kitware.com/cmake/cmake/-/issues/22207 set(rapids_version_compat SameMajorVersion) if(rapdis_orig_major_version) math(EXPR rapdis_major_version "${rapdis_orig_major_version} + 0" OUTPUT_FORMAT DECIMAL) @@ -216,7 +217,7 @@ function(rapids_export type project_name) set(RAPIDS_PROJECT_FINAL_CODE_BLOCK "${${RAPIDS_FINAL_CODE_BLOCK}}") endif() - #Write configuration and version files + # Write configuration and version files string(TOLOWER ${project_name} project_name) string(TOUPPER ${project_name} project_name_uppercase) if(type STREQUAL "install") @@ -228,15 +229,13 @@ function(rapids_export type project_name) INSTALL_DESTINATION "${install_location}") if(rapids_version_set) - write_basic_package_version_file("${scratch_dir}/${project_name}-config-version.cmake" - VERSION ${rapdis_project_version} - COMPATIBILITY ${rapids_version_compat}) + write_basic_package_version_file( + "${scratch_dir}/${project_name}-config-version.cmake" VERSION ${rapdis_project_version} + COMPATIBILITY ${rapids_version_compat}) endif() - install(EXPORT ${RAPIDS_EXPORT_SET} - FILE ${project_name}-targets.cmake - NAMESPACE ${RAPIDS_NAMESPACE} - DESTINATION "${install_location}") + install(EXPORT ${RAPIDS_EXPORT_SET} FILE ${project_name}-targets.cmake + NAMESPACE ${RAPIDS_NAMESPACE} DESTINATION "${install_location}") if(TARGET rapids_export_install_${RAPIDS_EXPORT_SET}) include("${rapids-cmake-dir}/export/write_dependencies.cmake") @@ -262,15 +261,13 @@ function(rapids_export type project_name) INSTALL_DESTINATION "${install_location}") if(rapids_version_set) - write_basic_package_version_file("${install_location}/${project_name}-config-version.cmake" - VERSION ${rapdis_project_version} - COMPATIBILITY ${rapids_version_compat}) + write_basic_package_version_file( + "${install_location}/${project_name}-config-version.cmake" VERSION ${rapdis_project_version} + COMPATIBILITY ${rapids_version_compat}) endif() - export(EXPORT ${RAPIDS_EXPORT_SET} - NAMESPACE ${RAPIDS_NAMESPACE} - FILE "${install_location}/${project_name}-targets.cmake" - ) + export(EXPORT ${RAPIDS_EXPORT_SET} NAMESPACE ${RAPIDS_NAMESPACE} + FILE "${install_location}/${project_name}-targets.cmake") if(TARGET rapids_export_build_${RAPIDS_EXPORT_SET}) include("${rapids-cmake-dir}/export/write_dependencies.cmake") @@ -281,7 +278,8 @@ function(rapids_export type project_name) if(DEFINED RAPIDS_LANGUAGES) include("${rapids-cmake-dir}/export/write_language.cmake") foreach(lang IN LISTS RAPIDS_LANGUAGES) - rapids_export_write_language(BUILD ${lang} "${install_location}/${project_name}-${lang}-language.cmake") + rapids_export_write_language(BUILD ${lang} + "${install_location}/${project_name}-${lang}-language.cmake") endforeach() endif() diff --git a/rapids-cmake/export/find_package_file.cmake b/rapids-cmake/export/find_package_file.cmake index 46c29b8ef..f6e3c033d 100644 --- a/rapids-cmake/export/find_package_file.cmake +++ b/rapids-cmake/export/find_package_file.cmake @@ -55,15 +55,14 @@ function(rapids_export_find_package_file type file_path export_set) string(TOLOWER ${type} type) - if(NOT TARGET rapids_export_${type}_${export_set} ) + if(NOT TARGET rapids_export_${type}_${export_set}) add_library(rapids_export_${type}_${export_set} INTERFACE) endif() - # Don't remove duplicates here as that cost should only be paid - # Once per export set. So that should occur in `write_dependencies` + # Don't remove duplicates here as that cost should only be paid Once per export set. So that + # should occur in `write_dependencies` - set_property(TARGET rapids_export_${type}_${export_set} - APPEND - PROPERTY "FIND_PACKAGES_TO_INSTALL" "${file_path}") + set_property(TARGET rapids_export_${type}_${export_set} APPEND PROPERTY "FIND_PACKAGES_TO_INSTALL" + "${file_path}") endfunction() diff --git a/rapids-cmake/export/package.cmake b/rapids-cmake/export/package.cmake index cc321b304..5cee21777 100644 --- a/rapids-cmake/export/package.cmake +++ b/rapids-cmake/export/package.cmake @@ -53,21 +53,18 @@ function(rapids_export_package type name export_set) set(multi_value GLOBAL_TARGETS) cmake_parse_arguments(RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) - - if(NOT TARGET rapids_export_${type}_${export_set} ) + if(NOT TARGET rapids_export_${type}_${export_set}) add_library(rapids_export_${type}_${export_set} INTERFACE) endif() - # Don't remove duplicates here as that cost should only be paid - # Once per export set. So that should occur in `write_dependencies` + # Don't remove duplicates here as that cost should only be paid Once per export set. So that + # should occur in `write_dependencies` - #Need to record the to `rapids_export_${type}_${export_set}` - set_property(TARGET rapids_export_${type}_${export_set} - APPEND - PROPERTY "PACKAGE_NAMES" "${name}") + # Need to record the to `rapids_export_${type}_${export_set}` + set_property(TARGET rapids_export_${type}_${export_set} APPEND PROPERTY "PACKAGE_NAMES" "${name}") if(RAPIDS_GLOBAL_TARGETS) - #record our targets that need to be marked as global when imported + # record our targets that need to be marked as global when imported target_link_libraries(rapids_export_${type}_${export_set} INTERFACE ${RAPIDS_GLOBAL_TARGETS}) endif() diff --git a/rapids-cmake/export/write_dependencies.cmake b/rapids-cmake/export/write_dependencies.cmake index c23740ad4..fe9c8a97f 100644 --- a/rapids-cmake/export/write_dependencies.cmake +++ b/rapids-cmake/export/write_dependencies.cmake @@ -50,25 +50,18 @@ function(rapids_export_write_dependencies type export_set file_path) return() endif() - #Determine if we need have any `FindModules` that we - #need to package. - get_property( find_modules - TARGET rapids_export_${type}_${export_set} - PROPERTY "FIND_PACKAGES_TO_INSTALL") + # Determine if we need have any `FindModules` that we need to package. + get_property(find_modules TARGET rapids_export_${type}_${export_set} + PROPERTY "FIND_PACKAGES_TO_INSTALL") list(REMOVE_DUPLICATES find_modules) - #Determine if we need to inject CPM hooks - get_property( uses_cpm - TARGET rapids_export_${type}_${export_set} - PROPERTY "REQUIRES_CPM") + # Determine if we need to inject CPM hooks + get_property(uses_cpm TARGET rapids_export_${type}_${export_set} PROPERTY "REQUIRES_CPM") list(REMOVE_DUPLICATES uses_cpm) - #Collect all `find_dependency` calls. Order is important here - #As this is the order they are recorded which is the implied - #valid search order - get_property( deps - TARGET rapids_export_${type}_${export_set} - PROPERTY "PACKAGE_NAMES") + # Collect all `find_dependency` calls. Order is important here As this is the order they are + # recorded which is the implied valid search order + get_property(deps TARGET rapids_export_${type}_${export_set} PROPERTY "PACKAGE_NAMES") list(REMOVE_DUPLICATES deps) # Do we need a Template header? @@ -79,7 +72,9 @@ function(rapids_export_write_dependencies type export_set file_path) string(APPEND RAPIDS_EXPORT_CONTENTS "rapids_cpm_init()\n\n") if(type STREQUAL build) - string(APPEND RAPIDS_EXPORT_CONTENTS "# re-use our CPM source cache if not set + string(APPEND + RAPIDS_EXPORT_CONTENTS + "# re-use our CPM source cache if not set if(NOT DEFINED CPM_SOURCE_CACHE) set(CPM_SOURCE_CACHE \"@CPM_SOURCE_CACHE@\") set(rapids_clear_cpm_cache true) @@ -91,14 +86,14 @@ endif()\n") cmake_path(GET file_path PARENT_PATH find_module_dest) file(COPY ${find_modules} DESTINATION "${find_module_dest}") - string(APPEND RAPIDS_EXPORT_CONTENTS [=[list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")]=] "\n") + string(APPEND RAPIDS_EXPORT_CONTENTS + [=[list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")]=] "\n") endif() foreach(dep IN LISTS deps) if(EXISTS "${CMAKE_BINARY_DIR}/rapids-cmake/${export_set}/${type}/${dep}.cmake") - #We need inject the contents of this generated file into the file - #we are writing out. That way users can re-locate/install the file and it will - #still work + # We need inject the contents of this generated file into the file we are writing out. That + # way users can re-locate/install the file and it will still work file(READ "${CMAKE_BINARY_DIR}/rapids-cmake/${export_set}/${type}/${dep}.cmake" dep_content) else() set(dep_content "find_dependency(${dep})") @@ -109,15 +104,12 @@ endif()\n") string(APPEND RAPIDS_EXPORT_CONTENTS "\n") # Handle promotion to global targets - get_property( global_targets - TARGET rapids_export_${type}_${export_set} - PROPERTY "INTERFACE_LINK_LIBRARIES") + get_property(global_targets TARGET rapids_export_${type}_${export_set} + PROPERTY "INTERFACE_LINK_LIBRARIES") list(REMOVE_DUPLICATES global_targets) string(APPEND RAPIDS_EXPORT_CONTENTS "set(rapids_global_targets ${global_targets})\n") - configure_file( - "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/template/dependencies.cmake.in" - "${file_path}" - @ONLY) + configure_file("${CMAKE_CURRENT_FUNCTION_LIST_DIR}/template/dependencies.cmake.in" "${file_path}" + @ONLY) endfunction() diff --git a/rapids-cmake/export/write_language.cmake b/rapids-cmake/export/write_language.cmake index 98c920818..7d65fbb6f 100644 --- a/rapids-cmake/export/write_language.cmake +++ b/rapids-cmake/export/write_language.cmake @@ -48,7 +48,7 @@ function(rapids_export_write_language type lang file_path) list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.export.write_language") set(code_to_inject -[=[ + [=[ # Enable the requested language, which is only supported # in the highest directory that 'uses' a language. # We have to presume all directories use a language diff --git a/rapids-cmake/find/generate_module.cmake b/rapids-cmake/find/generate_module.cmake index d7dd8decb..08e97c07b 100644 --- a/rapids-cmake/find/generate_module.cmake +++ b/rapids-cmake/find/generate_module.cmake @@ -118,7 +118,7 @@ function(rapids_find_generate_module name) set(RAPIDS_PKG_NAME ${name}) # Construct any extra suffix search paths - set(RAPIDS_PATH_SEARCH_ARGS ) + set(RAPIDS_PATH_SEARCH_ARGS) if(RAPIDS_INCLUDE_SUFFIXES) string(APPEND RAPIDS_PATH_SEARCH_ARGS "PATH_SUFFIXES ${RAPIDS_INCLUDE_SUFFIXES}") endif() @@ -127,8 +127,7 @@ function(rapids_find_generate_module name) if(DEFINED RAPIDS_LIBRARY_NAMES) set(RAPIDS_HEADER_ONLY FALSE) - # Construct the release and debug library names - # handling version number suffixes + # Construct the release and debug library names handling version number suffixes set(RAPIDS_PKG_LIB_NAMES ${RAPIDS_LIBRARY_NAMES}) set(RAPIDS_PKG_LIB_DEBUG_NAMES ${RAPIDS_LIBRARY_NAMES}) list(TRANSFORM RAPIDS_PKG_LIB_DEBUG_NAMES APPEND "d") @@ -138,17 +137,17 @@ function(rapids_find_generate_module name) list(TRANSFORM RAPIDS_PKG_LIB_NAMES APPEND ".${RAPIDS_VERSION}" OUTPUT_VARIABLE lib_version2) list(PREPEND RAPIDS_PKG_LIB_NAMES ${lib_version1} ${lib_version2}) - list(TRANSFORM RAPIDS_PKG_LIB_DEBUG_NAMES APPEND "${RAPIDS_VERSION}" OUTPUT_VARIABLE lib_version1) - list(TRANSFORM RAPIDS_PKG_LIB_DEBUG_NAMES APPEND ".${RAPIDS_VERSION}" OUTPUT_VARIABLE lib_version2) + list(TRANSFORM RAPIDS_PKG_LIB_DEBUG_NAMES APPEND "${RAPIDS_VERSION}" OUTPUT_VARIABLE + lib_version1) + list(TRANSFORM RAPIDS_PKG_LIB_DEBUG_NAMES APPEND ".${RAPIDS_VERSION}" OUTPUT_VARIABLE + lib_version2) list(PREPEND RAPIDS_PKG_LIB_DEBUG_NAMES ${lib_version1} ${lib_version2}) endif() endif() # Need to generate the module - configure_file( - "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/template/find_module.cmake.in" - "${CMAKE_BINARY_DIR}/cmake/find_modules/Find${name}.cmake" - @ONLY) + configure_file("${CMAKE_CURRENT_FUNCTION_LIST_DIR}/template/find_module.cmake.in" + "${CMAKE_BINARY_DIR}/cmake/find_modules/Find${name}.cmake" @ONLY) # Need to add our generated modules to CMAKE_MODULE_PATH! if(NOT "${CMAKE_BINARY_DIR}/rapids-cmake/find_modules/" IN_LIST CMAKE_MODULE_PATH) @@ -159,16 +158,16 @@ function(rapids_find_generate_module name) # Record what export sets this module is part of if(RAPIDS_BUILD_EXPORT_SET) include("${rapids-cmake-dir}/export/find_package_file.cmake") - rapids_export_find_package_file(BUILD "${CMAKE_BINARY_DIR}/cmake/find_modules/Find${name}.cmake" - ${RAPIDS_BUILD_EXPORT_SET} - ) + rapids_export_find_package_file(BUILD + "${CMAKE_BINARY_DIR}/cmake/find_modules/Find${name}.cmake" + ${RAPIDS_BUILD_EXPORT_SET}) endif() if(RAPIDS_INSTALL_EXPORT_SET) include("${rapids-cmake-dir}/export/find_package_file.cmake") - rapids_export_find_package_file(INSTALL "${CMAKE_BINARY_DIR}/cmake/find_modules/Find${name}.cmake" - ${RAPIDS_INSTALL_EXPORT_SET} - ) + rapids_export_find_package_file(INSTALL + "${CMAKE_BINARY_DIR}/cmake/find_modules/Find${name}.cmake" + ${RAPIDS_INSTALL_EXPORT_SET}) endif() endfunction() diff --git a/rapids-cmake/find/package.cmake b/rapids-cmake/find/package.cmake index f868b4de5..2f15e9187 100644 --- a/rapids-cmake/find/package.cmake +++ b/rapids-cmake/find/package.cmake @@ -86,11 +86,11 @@ function(rapids_find_package name) rapids_cmake_make_global(RAPIDS_GLOBAL_TARGETS) endif() - #Only record the export requirements if the package was found - #This allows us to handle implicit OPTIONAL find packages + # Only record the export requirements if the package was found This allows us to handle implicit + # OPTIONAL find packages if(${${name}_FOUND}) - set(extra_info ) + set(extra_info) if(RAPIDS_GLOBAL_TARGETS) set(extra_info "GLOBAL_TARGETS") list(APPEND extra_info ${RAPIDS_GLOBAL_TARGETS})