diff --git a/.gersemirc b/.gersemirc new file mode 100644 index 00000000..ab6c51a4 --- /dev/null +++ b/.gersemirc @@ -0,0 +1,2 @@ +indent: 2 +line_length: 100 diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index cbe081c3..db271809 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -45,3 +45,30 @@ jobs: node_type: "cpu4" script: "ci/build_docs.sh" sha: ${{ inputs.sha }} + wheel-build-gersemi-rapids-cmake: + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@main + with: + build_type: ${{ inputs.build_type || 'branch' }} + branch: ${{ inputs.branch }} + sha: ${{ inputs.sha }} + date: ${{ inputs.date }} + script: ci/build_wheel_gersemi_rapids_cmake.sh + package-name: gersemi-rapids-cmake + package-type: python + pure-wheel: true + append-cuda-suffix: false + # This selects "ARCH=amd64 + the earliest supported Python + CUDA". + matrix_filter: map(select(.ARCH == "amd64")) | min_by([(.PY_VER|split(".")|map(tonumber)), (.CUDA_VER|split(".")|map(tonumber))]) | [.] + wheel-publish-gersemi-rapids-cmake: + needs: wheel-build-gersemi-rapids-cmake + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@main + with: + build_type: ${{ inputs.build_type || 'branch' }} + branch: ${{ inputs.branch }} + sha: ${{ inputs.sha }} + date: ${{ inputs.date }} + package-name: gersemi-rapids-cmake + package-type: python + publish_to_pypi: true diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 74ee10ea..9ed9dd21 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -15,6 +15,8 @@ jobs: - checks - conda-cpp-tests - docs-build + - wheel-build-gersemi-rapids-cmake + - wheel-tests-gersemi-rapids-cmake - telemetry-setup secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@main @@ -50,6 +52,28 @@ jobs: arch: "amd64" container_image: "rapidsai/ci-conda:26.04-latest" script: "ci/build_docs.sh" + wheel-build-gersemi-rapids-cmake: + needs: telemetry-setup + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@main + with: + build_type: pull-request + script: ci/build_wheel_gersemi_rapids_cmake.sh + package-name: gersemi-rapids-cmake + package-type: python + pure-wheel: true + append-cuda-suffix: false + # This selects "ARCH=amd64 + the earliest supported Python + CUDA". + matrix_filter: map(select(.ARCH == "amd64")) | min_by([(.PY_VER|split(".")|map(tonumber)), (.CUDA_VER|split(".")|map(tonumber))]) | [.] + wheel-tests-gersemi-rapids-cmake: + needs: wheel-build-gersemi-rapids-cmake + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@main + with: + build_type: pull-request + script: ci/test_wheel_gersemi_rapids_cmake.sh + # This selects "ARCH=amd64 + the earliest supported Python + CUDA". + matrix_filter: map(select(.ARCH == "amd64")) | min_by([(.PY_VER|split(".")|map(tonumber)), (.CUDA_VER|split(".")|map(tonumber))]) | [.] telemetry-summarize: # This job must use a self-hosted runner to record telemetry traces. runs-on: linux-amd64-cpu4 diff --git a/.gitignore b/.gitignore index e0e414ed..be8d650d 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,29 @@ docs/_build # vim *.sw[a-z] + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4051fe1e..d60dec61 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 repos: @@ -18,6 +18,27 @@ repos: - id: check-json - id: pretty-format-json args: ["--autofix", "--no-sort-keys"] + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.14.8 + hooks: + - id: ruff-check + args: [--fix] + exclude: | + (?x) + ^docs/conf[.]py$ + - id: ruff-format + exclude: | + (?x) + ^docs/conf[.]py$ + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.19.0 + hooks: + - id: mypy + additional_dependencies: + - gersemi + exclude: | + (?x) + ^docs/conf[.]py$ - repo: https://github.com/pre-commit/mirrors-clang-format rev: v20.1.4 hooks: @@ -39,19 +60,28 @@ repos: hooks: - id: rapids-dependency-file-generator args: ["--clean", "--warn-all", "--strict"] + - repo: https://github.com/rapidsai/pre-commit-hooks + rev: v1.2.1 + hooks: + - id: verify-copyright + args: [--fix, --spdx] + files: | + (?x) + [.](cmake|cpp|cu|cuh|h|hpp|sh|pxd|py|pyx)$| + CMakeLists[.]txt$| + meta[.]yaml$| + ^testing/export/write_language-multiple-nested-enables/A/B/static[.]not_cu$| + dependencies[.]yaml$| + pyproject[.]toml$| + ^[.]pre-commit-config[.]yaml$| + [.]stubs$ + exclude: | + (?x) + ^python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/ + - id: verify-codeowners + args: [--fix, --project-prefix=rapids, --no-cpp, --no-python] - repo: local hooks: - - id: cmake-format - name: cmake-format - entry: ./ci/checks/run-cmake-format.sh cmake-format - language: python - types: [cmake] - # Note that pre-commit autoupdate does not update the versions - # of dependencies, so we'll have to update this manually. - additional_dependencies: - - cmakelang==0.6.13 - verbose: true - require_serial: true - id: cmake-lint name: cmake-lint entry: ./ci/checks/run-cmake-format.sh cmake-lint @@ -67,22 +97,36 @@ repos: (?x)^( ^testing/.*$ ) - - repo: https://github.com/rapidsai/pre-commit-hooks - rev: v1.2.1 - hooks: - - id: verify-copyright - args: [--fix, --spdx] + - id: regenerate-stubs + name: regenerate-stubs + entry: python3 ci/regenerate_stubs.py + language: python + types: [cmake] + additional_dependencies: + - &gersemi gersemi==0.25.1 + pass_filenames: false + - id: gersemi-rapids-cmake + name: gersemi-rapids-cmake + entry: ci/checks/gersemi.sh -i --warnings-as-errors --extensions rapids_cmake_detail -- + language: python + types: [cmake] files: | (?x) - [.](cmake|cpp|cu|cuh|h|hpp|sh|pxd|py|pyx)$| - CMakeLists[.]txt$| - meta[.]yaml$| - ^testing/export/write_language-multiple-nested-enables/A/B/static[.]not_cu$| - dependencies[.]yaml$| - pyproject[.]toml$| - ^[.]pre-commit-config[.]yaml$ - - id: verify-codeowners - args: [--fix, --project-prefix=rapids, --no-cpp, --no-python] + ^rapids-cmake/ + additional_dependencies: + - *gersemi + require_serial: true + - id: gersemi-testing + name: gersemi-testing + entry: ci/checks/gersemi.sh -i --warnings-as-errors --extensions rapids_cmake_detail --definitions testing/ -- + language: python + types: [cmake] + files: | + (?x) + ^testing/ + additional_dependencies: + - *gersemi + require_serial: true - repo: https://github.com/shellcheck-py/shellcheck-py rev: v0.10.0.1 hooks: diff --git a/ci/build_wheel_gersemi_rapids_cmake.sh b/ci/build_wheel_gersemi_rapids_cmake.sh new file mode 100755 index 00000000..c8369e24 --- /dev/null +++ b/ci/build_wheel_gersemi_rapids_cmake.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 + +set -euo pipefail + +source rapids-init-pip + +rapids-logger "Generating build requirements" + +rapids-dependency-file-generator \ + --output requirements \ + --file-key "py_build_gersemi_rapids_cmake" \ + --matrix "" \ +| tee /tmp/requirements-build.txt + +rapids-logger "Installing build requirements" +rapids-pip-retry install \ + -v \ + --prefer-binary \ + -r /tmp/requirements-build.txt + +rapids-generate-version > ./VERSION +rapids-generate-version > ./python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/VERSION + +cd ./python/gersemi-rapids-cmake + +rapids-logger "Building 'gersemi-rapids-cmake' wheel" +rapids-telemetry-record build-gersemi-rapids-cmake.log rapids-pip-retry wheel \ + -w dist \ + -v \ + --no-deps \ + --disable-pip-version-check \ + . + +cp dist/* "${RAPIDS_WHEEL_BLD_OUTPUT_DIR}" + +rapids-logger "validate packages with 'pydistcheck'" +pydistcheck \ + --inspect \ + "$(echo "${RAPIDS_WHEEL_BLD_OUTPUT_DIR}"/*.whl)" + +rapids-logger "validate packages with 'twine'" +twine check \ + --strict \ + "$(echo "${RAPIDS_WHEEL_BLD_OUTPUT_DIR}"/*.whl)" diff --git a/ci/checks/gersemi.sh b/ci/checks/gersemi.sh new file mode 100755 index 00000000..be187cc0 --- /dev/null +++ b/ci/checks/gersemi.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 + +# It's not possible for pre-commit to install a local Python package, so +# manually add it to the PYTHONPATH instead. + +set -euo pipefail + +PYTHONPATH="$(dirname "$0")/../../python/gersemi-rapids-cmake:${PYTHONPATH:-}" gersemi "${@}" diff --git a/ci/regenerate_stubs.py b/ci/regenerate_stubs.py new file mode 100644 index 00000000..b92c072f --- /dev/null +++ b/ci/regenerate_stubs.py @@ -0,0 +1,114 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import os.path +import re +from pathlib import Path +from textwrap import dedent + +from gersemi.runner import find_custom_command_definitions_in_file + + +FILE_LINE_RE: re.Pattern[str] = re.compile( + r"^(?P.*):(?P\d+):(?P\d+)$" +) +SPDX_RE: re.Pattern[str] = re.compile( + r"(?:^|\n)(?P" + r"# SPDX-FileCopyrightText: [^\n]*\n" + r"# SPDX-License-Identifier: [^\n]*" + r")(?:\n|$)" +) + +root_path = Path(__file__).parent / ".." +rapids_cmake_path = root_path / "rapids-cmake" +generated_stubs_path = ( + root_path + / "python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids" + / "rapids-cmake/generated" +) + +exit_code = 0 + +# Write stub files +for base_dir, _, files in os.walk(rapids_cmake_path): + for file in files: + if file.endswith(".cmake"): + filename = Path(base_dir) / file + relative_filename = filename.relative_to(rapids_cmake_path) + with open(filename) as f: + contents = f.read() + + definitions = find_custom_command_definitions_in_file(filename) + + stubs_filename = generated_stubs_path / ( + str(relative_filename)[: -len(".cmake")] + ".stubs" + ) + if definitions: + os.makedirs( + generated_stubs_path / relative_filename.parent, + exist_ok=True, + ) + with open(stubs_filename, "a+") as f: + f.seek(0) + old_contents = f.read() + f.seek(0) + f.truncate() + + if spdx_match := SPDX_RE.search(contents): + f.write(f"{spdx_match.group('spdx')}\n") + f.write( + "# Automatically generated by ci/regenerate_stubs.py. " + "DO NOT EDIT!\n" + ) + + for definition in definitions.values(): + ((entry, file_line),) = definition + name_token, (args, keywords), _ = entry + + file_line_match = FILE_LINE_RE.search(file_line) + assert file_line_match + assert ( + Path(file_line_match.group("file")).relative_to( + rapids_cmake_path + ) + == relative_filename + ) + + f.write( + dedent(f""" + # Generated from rapids-cmake/{relative_filename}:{file_line_match.group("line")}:{file_line_match.group("column")} + function({name_token.value}{"".join([f" {arg}" for arg in args])}) + set(options "{";".join(keywords.options)}") + set(one_value "{";".join(keywords.one_value_keywords)}") + set(multi_value "{";".join(keywords.multi_value_keywords)}") + cmake_parse_arguments(_RAPIDS "${{options}}" "${{one_value}}" "${{multi_value}}" ${{ARGN}}) + endfunction() + """) # noqa: E501 + ) + + f.seek(0) + if f.read() != old_contents: + exit_code = 1 + + else: + try: + os.remove(stubs_filename) + except FileNotFoundError: + pass + else: + exit_code = 1 + +# Clean up stale stub files +for base_dir, _, files in os.walk(generated_stubs_path): + for file in files: + if file.endswith(".stubs"): + filename = Path(base_dir) / file + relative_filename = filename.relative_to(generated_stubs_path) + if not os.path.exists( + rapids_cmake_path + / (str(relative_filename)[: -len(".stubs")] + ".cmake") + ): + os.remove(filename) + exit_code = 1 + +exit(exit_code) diff --git a/ci/test_wheel_gersemi_rapids_cmake.sh b/ci/test_wheel_gersemi_rapids_cmake.sh new file mode 100755 index 00000000..416cb246 --- /dev/null +++ b/ci/test_wheel_gersemi_rapids_cmake.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 + +set -euo pipefail + +source rapids-init-pip + +# Download the gersemi-rapids-cmake wheel built in the previous step +WHEELHOUSE=$(rapids-download-from-github "$(RAPIDS_PY_WHEEL_NAME=gersemi-rapids-cmake rapids-package-name "wheel_python" rapids-cmake --pure)") + +rapids-logger "Install gersemi-rapids-cmake and its basic dependencies in a virtual environment" + +python -m venv env +. env/bin/activate +rapids-pip-retry install \ + -v \ + "$(echo "${WHEELHOUSE}/gersemi_rapids_cmake"*.whl)" + +rapids-logger "Test a correctly formatted file" + +gersemi -c --diff --line-length 80 --indent 2 --extensions rapids_cmake -- - < tuple[str, ...]: + return tuple( + kw + for kw in keywords + if kw + not in { + *definition["options"], + *definition["one_value_keywords"], + *definition["multi_value_keywords"], + } + ) + + +def _combine_keywords( + definition: "Mapping[str, Any]", called_definition: "Mapping[str, Any]" +) -> "Mapping[str, Any]": + return { + **definition, + "options": ( + *definition["options"], + *_filter_existing_keywords(definition, called_definition["options"]), + ), + "one_value_keywords": ( + *definition["one_value_keywords"], + *_filter_existing_keywords( + definition, called_definition["one_value_keywords"] + ), + ), + "multi_value_keywords": ( + *definition["multi_value_keywords"], + *_filter_existing_keywords( + definition, called_definition["multi_value_keywords"] + ), + ), + } + + +def apply_patches(command_definitions: "Mapping[str, Any]") -> "Mapping[str, Any]": + CPMAddPackage = _combine_keywords( + command_definitions["cpmaddpackage"], builtin_commands["FetchContent_Declare"] + ) + CPMFindPackage = _combine_keywords( + command_definitions["cpmfindpackage"], builtin_commands["FetchContent_Declare"] + ) + + return { + **command_definitions, + "cpmaddpackage": CPMAddPackage, + "cpmfindpackage": CPMFindPackage, + "rapids_cpm_find": { + **command_definitions["rapids_cpm_find"], + "options": tuple( + kw + for kw in command_definitions["rapids_cpm_find"]["options"] + if kw != "CPM_ARGS" + ), + "one_value_keywords": tuple( + kw + for kw in command_definitions["rapids_cpm_find"]["one_value_keywords"] + if kw != "SOURCE_SUBDIR" + ), + "multi_value_keywords": ( + *command_definitions["rapids_cpm_find"]["multi_value_keywords"], + "CPM_ARGS", + ), + "sections": { + "CPM_ARGS": CPMAddPackage, + }, + }, + "rapids_export_cpm": { + **command_definitions["rapids_export_cpm"], + "sections": { + "CPM_ARGS": CPMAddPackage, + }, + }, + } + + +__all__ = ["apply_patches"] diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cmake/build_type.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cmake/build_type.stubs new file mode 100644 index 00000000..ba584ba3 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cmake/build_type.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cmake/build_type.cmake:34:10 +function(rapids_cmake_build_type default_type) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cmake/detail/policy.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cmake/detail/policy.stubs new file mode 100644 index 00000000..ad228f6b --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cmake/detail/policy.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cmake/detail/policy.cmake:22:10 +function(rapids_cmake_policy) + set(options "") + set(one_value "DEPRECATED_IN;REMOVED_IN;MESSAGE") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cmake/download_with_retry.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cmake/download_with_retry.stubs new file mode 100644 index 00000000..276d1a94 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cmake/download_with_retry.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cmake/download_with_retry.cmake:41:10 +function(rapids_cmake_download_with_retry url output_file sha256) + set(options "") + set(one_value "MAX_RETRIES;RETRY_DELAY") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cmake/install_lib_dir.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cmake/install_lib_dir.stubs new file mode 100644 index 00000000..a5ec946d --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cmake/install_lib_dir.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cmake/install_lib_dir.cmake:35:10 +function(rapids_cmake_install_lib_dir out_variable_name) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cmake/make_global.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cmake/make_global.stubs new file mode 100644 index 00000000..9395cbbc --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cmake/make_global.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cmake/make_global.cmake:39:10 +function(rapids_cmake_make_global target_var) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cmake/parse_version.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cmake/parse_version.stubs new file mode 100644 index 00000000..e88b3bdb --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cmake/parse_version.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cmake/parse_version.cmake:58:10 +function(rapids_cmake_parse_version mode version_value out_variable_name) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cmake/support_conda_env.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cmake/support_conda_env.stubs new file mode 100644 index 00000000..f05b4732 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cmake/support_conda_env.stubs @@ -0,0 +1,35 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cmake/support_conda_env.cmake:89:11 +function(modify_cmake_prefix_path_global) + set(options "") + set(one_value "") + set(multi_value "PATHS") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() + +# Generated from rapids-cmake/cmake/support_conda_env.cmake:106:11 +function(modify_cmake_prefix_path_envvar) + set(options "") + set(one_value "") + set(multi_value "PATHS") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() + +# Generated from rapids-cmake/cmake/support_conda_env.cmake:119:11 +function(modify_cmake_prefix_path) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() + +# Generated from rapids-cmake/cmake/support_conda_env.cmake:73:10 +function(rapids_cmake_support_conda_env target) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cmake/write_git_revision_file.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cmake/write_git_revision_file.stubs new file mode 100644 index 00000000..ba84ca81 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cmake/write_git_revision_file.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cmake/write_git_revision_file.cmake:68:10 +function(rapids_cmake_write_git_revision_file target file_path) + set(options "") + set(one_value "PREFIX") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cmake/write_version_file.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cmake/write_version_file.stubs new file mode 100644 index 00000000..6defae39 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cmake/write_version_file.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cmake/write_version_file.cmake:48:10 +function(rapids_cmake_write_version_file file_path) + set(options "") + set(one_value "PREFIX") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/bs_thread_pool.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/bs_thread_pool.stubs new file mode 100644 index 00000000..b895490b --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/bs_thread_pool.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cpm/bs_thread_pool.cmake:43:10 +function(rapids_cpm_bs_thread_pool) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/cccl.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/cccl.stubs new file mode 100644 index 00000000..2f97366c --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/cccl.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cpm/cccl.cmake:58:10 +function(rapids_cpm_cccl) + set(options "ENABLE_UNSTABLE") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/cuco.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/cuco.stubs new file mode 100644 index 00000000..9d8fa415 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/cuco.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cpm/cuco.cmake:42:10 +function(rapids_cpm_cuco) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/convert_patch_json.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/convert_patch_json.stubs new file mode 100644 index 00000000..c928c5e4 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/convert_patch_json.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cpm/detail/convert_patch_json.cmake:25:10 +function(rapids_cpm_convert_patch_json) + set(options "") + set(one_value "FROM_JSON_TO_FILE;FROM_FILE_TO_JSON;FILE_VAR;PACKAGE_NAME;INDEX") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/display_patch_status.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/display_patch_status.stubs new file mode 100644 index 00000000..30a50a7e --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/display_patch_status.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cpm/detail/display_patch_status.cmake:22:10 +function(rapids_cpm_display_patch_status package_name) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/download.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/download.stubs new file mode 100644 index 00000000..48c05738 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/download.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cpm/detail/download.cmake:42:10 +function(rapids_cpm_download) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/download_proprietary_binary.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/download_proprietary_binary.stubs new file mode 100644 index 00000000..339b4ef3 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/download_proprietary_binary.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cpm/detail/download_proprietary_binary.cmake:19:10 +function(rapids_cpm_download_proprietary_binary package_name url) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/generate_patch_command.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/generate_patch_command.stubs new file mode 100644 index 00000000..50a53676 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/generate_patch_command.stubs @@ -0,0 +1,19 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cpm/detail/generate_patch_command.cmake:62:12 +function(generate_patch_command_json_get_value json_data_ name) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() + +# Generated from rapids-cmake/cpm/detail/generate_patch_command.cmake:23:10 +function(rapids_cpm_generate_patch_command package_name version patch_command build_patch_only) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/get_default_json.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/get_default_json.stubs new file mode 100644 index 00000000..be2f24af --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/get_default_json.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cpm/detail/get_default_json.cmake:18:10 +function(get_default_json package_name output_variable) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/get_override_json.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/get_override_json.stubs new file mode 100644 index 00000000..9c0b1eab --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/get_override_json.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cpm/detail/get_override_json.cmake:18:10 +function(get_override_json package_name output_variable) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/get_proprietary_binary_url.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/get_proprietary_binary_url.stubs new file mode 100644 index 00000000..60bf9a89 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/get_proprietary_binary_url.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cpm/detail/get_proprietary_binary_url.cmake:23:10 +function(rapids_cpm_get_proprietary_binary_url package_name version url_var) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/load_preset_versions.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/load_preset_versions.stubs new file mode 100644 index 00000000..b0fb2146 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/load_preset_versions.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cpm/detail/load_preset_versions.cmake:25:10 +function(rapids_cpm_load_preset_versions) + set(options "") + set(one_value "PRESET_FILE") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/package_details.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/package_details.stubs new file mode 100644 index 00000000..38dbe3bb --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/package_details.stubs @@ -0,0 +1,27 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cpm/detail/package_details.cmake:31:3 +function(rapids_cpm_package_details package_name version_var url_var tag_var shallow_var exclude_from_all_var) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() + +# Generated from rapids-cmake/cpm/detail/package_details.cmake:91:12 +function(package_details_json_get_value name) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() + +# Generated from rapids-cmake/cpm/detail/package_details.cmake:71:3 +function(rapids_cpm_package_details_internal package_name version_var url_var tag_var subdir_var shallow_var exclude_from_all_var) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/package_info.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/package_info.stubs new file mode 100644 index 00000000..36a07841 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/package_info.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cpm/detail/package_info.cmake:29:10 +function(rapids_cpm_package_info package_name) + set(options "FOR_FETCH_CONTENT") + set(one_value "VERSION_VAR;FIND_VAR;CPM_VAR;TO_INSTALL_VAR;BUILD_EXPORT_SET;INSTALL_EXPORT_SET") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/pinning_write_file.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/pinning_write_file.stubs new file mode 100644 index 00000000..318966cd --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/detail/pinning_write_file.stubs @@ -0,0 +1,51 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cpm/detail/pinning_write_file.cmake:36:10 +function(rapids_cpm_pinning_extract_source_git_info package git_url_var git_sha_var) + set(options "") + set(one_value "REQUESTED_GIT_TAG") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() + +# Generated from rapids-cmake/cpm/detail/pinning_write_file.cmake:116:10 +function(rapids_cpm_pinning_extract_source_subdir package_name source_subdir_var) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() + +# Generated from rapids-cmake/cpm/detail/pinning_write_file.cmake:158:10 +function(rapids_cpm_pinning_transform_patches package_name patches_array_var output_var) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() + +# Generated from rapids-cmake/cpm/detail/pinning_write_file.cmake:228:10 +function(rapids_cpm_pinning_create_and_set_member package_name json_var key value) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() + +# Generated from rapids-cmake/cpm/detail/pinning_write_file.cmake:271:10 +function(rapids_cpm_pinning_add_json_entry package_name json_var) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() + +# Generated from rapids-cmake/cpm/detail/pinning_write_file.cmake:366:10 +function(rapids_cpm_pinning_write_file) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/find.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/find.stubs new file mode 100644 index 00000000..db044b9b --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/find.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cpm/find.cmake:143:10 +function(rapids_cpm_find name version) + set(options "CPM_ARGS;BUILD_PATCH_ONLY") + set(one_value "BUILD_EXPORT_SET;INSTALL_EXPORT_SET;SOURCE_SUBDIR") + set(multi_value "COMPONENTS;GLOBAL_TARGETS") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/gbench.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/gbench.stubs new file mode 100644 index 00000000..36b576dd --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/gbench.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cpm/gbench.cmake:48:10 +function(rapids_cpm_gbench) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/generate_pinned_versions.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/generate_pinned_versions.stubs new file mode 100644 index 00000000..735a8984 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/generate_pinned_versions.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cpm/generate_pinned_versions.cmake:66:10 +function(rapids_cpm_generate_pinned_versions) + set(options "") + set(one_value "OUTPUT") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/gtest.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/gtest.stubs new file mode 100644 index 00000000..e9f030a3 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/gtest.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cpm/gtest.cmake:49:10 +function(rapids_cpm_gtest) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/init.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/init.stubs new file mode 100644 index 00000000..1850f974 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/init.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cpm/init.cmake:96:10 +function(rapids_cpm_init) + set(options "GENERATE_PINNED_VERSIONS") + set(one_value "CUSTOM_DEFAULT_VERSION_FILE;OVERRIDE") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/nvbench.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/nvbench.stubs new file mode 100644 index 00000000..fe750ed8 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/nvbench.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cpm/nvbench.cmake:55:10 +function(rapids_cpm_nvbench) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/nvcomp.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/nvcomp.stubs new file mode 100644 index 00000000..c2e3442c --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/nvcomp.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cpm/nvcomp.cmake:62:10 +function(rapids_cpm_nvcomp) + set(options "") + set(one_value "USE_PROPRIETARY_BINARY") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/nvtx3.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/nvtx3.stubs new file mode 100644 index 00000000..b0c3278f --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/nvtx3.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cpm/nvtx3.cmake:42:10 +function(rapids_cpm_nvtx3) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/package_override.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/package_override.stubs new file mode 100644 index 00000000..aa26acac --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/package_override.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cpm/package_override.cmake:67:10 +function(rapids_cpm_package_override _rapids_override_filepath) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/rapids_logger.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/rapids_logger.stubs new file mode 100644 index 00000000..cc5fbf4e --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/rapids_logger.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cpm/rapids_logger.cmake:34:10 +function(rapids_cpm_rapids_logger) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/rmm.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/rmm.stubs new file mode 100644 index 00000000..4fea98e0 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cpm/rmm.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cpm/rmm.cmake:44:10 +function(rapids_cpm_rmm) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cuda/detail/detect_architectures.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cuda/detail/detect_architectures.stubs new file mode 100644 index 00000000..8a0bffdd --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cuda/detail/detect_architectures.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cuda/detail/detect_architectures.cmake:11:10 +function(rapids_cuda_detect_architectures possible_archs_var gpu_archs) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cuda/enable_fatbin_compression.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cuda/enable_fatbin_compression.stubs new file mode 100644 index 00000000..550a2359 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cuda/enable_fatbin_compression.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cuda/enable_fatbin_compression.cmake:70:10 +function(rapids_cuda_enable_fatbin_compression) + set(options "") + set(one_value "TARGET;TUNE_FOR;VARIABLE") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cuda/init_architectures.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cuda/init_architectures.stubs new file mode 100644 index 00000000..f7fe4651 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cuda/init_architectures.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cuda/init_architectures.cmake:61:10 +function(rapids_cuda_init_architectures project_name) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cuda/init_runtime.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cuda/init_runtime.stubs new file mode 100644 index 00000000..1048aab9 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cuda/init_runtime.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cuda/init_runtime.cmake:34:10 +function(rapids_cuda_init_runtime use_static value) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cuda/set_architectures.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cuda/set_architectures.stubs new file mode 100644 index 00000000..69a2ac8b --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cuda/set_architectures.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cuda/set_architectures.cmake:47:10 +function(rapids_cuda_set_architectures mode) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cuda/set_runtime.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cuda/set_runtime.stubs new file mode 100644 index 00000000..52389ba6 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cuda/set_runtime.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cuda/set_runtime.cmake:45:10 +function(rapids_cuda_set_runtime target use_static value) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cython-core/add_rpath_entries.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cython-core/add_rpath_entries.stubs new file mode 100644 index 00000000..068fc395 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cython-core/add_rpath_entries.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cython-core/add_rpath_entries.cmake:45:10 +function(rapids_cython_add_rpath_entries) + set(options "") + set(one_value "ROOT_DIRECTORY;TARGET") + set(multi_value "PATHS") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cython-core/create_modules.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cython-core/create_modules.stubs new file mode 100644 index 00000000..56fc5f27 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cython-core/create_modules.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cython-core/create_modules.cmake:81:10 +function(rapids_cython_create_modules) + set(options "CXX") + set(one_value "INSTALL_DIR;MODULE_PREFIX;COMPONENT") + set(multi_value "SOURCE_FILES;LINKED_LIBRARIES;ASSOCIATED_TARGETS") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cython-core/detail/verify_init.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cython-core/detail/verify_init.stubs new file mode 100644 index 00000000..bef71208 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cython-core/detail/verify_init.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cython-core/detail/verify_init.cmake:23:10 +function(rapids_cython_verify_init) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cython-core/find_prefix_paths.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cython-core/find_prefix_paths.stubs new file mode 100644 index 00000000..29d6c2d8 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cython-core/find_prefix_paths.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cython-core/find_prefix_paths.cmake:29:10 +function(rapids_cython_find_prefix_paths python_executable paths_var) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cython-core/init.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cython-core/init.stubs new file mode 100644 index 00000000..67268bca --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/cython-core/init.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/cython-core/init.cmake:32:7 +function(rapids_cython_init) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/export/cpm.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/export/cpm.stubs new file mode 100644 index 00000000..a45c2e77 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/export/cpm.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/export/cpm.cmake:48:10 +function(rapids_export_cpm type name export_set) + set(options "") + set(one_value "EXPORT_SET") + set(multi_value "GLOBAL_TARGETS;CPM_ARGS") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/export/detail/component.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/export/detail/component.stubs new file mode 100644 index 00000000..ba87dcfe --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/export/detail/component.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/export/detail/component.cmake:30:3 +function(rapids_export_component type project_name component_name export_set unique_name namespace) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/export/detail/parse_version.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/export/detail/parse_version.stubs new file mode 100644 index 00000000..87bec741 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/export/detail/parse_version.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/export/detail/parse_version.cmake:10:10 +function(rapids_export_parse_version rapids_version orig_prefix ver_value) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/export/detail/post_find_package_code.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/export/detail/post_find_package_code.stubs new file mode 100644 index 00000000..f356d961 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/export/detail/post_find_package_code.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/export/detail/post_find_package_code.cmake:51:10 +function(rapids_export_post_find_package_code type name code) + set(options "") + set(one_value "EXPORT_SET;CONDITION") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/export/export.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/export/export.stubs new file mode 100644 index 00000000..cf529a82 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/export/export.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/export/export.cmake:184:10 +function(rapids_export type project_name) + set(options "") + set(one_value "EXPORT_SET;VERSION;NAMESPACE;DOCUMENTATION;FINAL_CODE_BLOCK") + set(multi_value "GLOBAL_TARGETS;COMPONENTS;COMPONENTS_EXPORT_SET;LANGUAGES") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/export/find_package_file.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/export/find_package_file.stubs new file mode 100644 index 00000000..28c11e17 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/export/find_package_file.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/export/find_package_file.cmake:54:10 +function(rapids_export_find_package_file type file_path) + set(options "") + set(one_value "EXPORT_SET;CONDITION") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/export/find_package_root.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/export/find_package_root.stubs new file mode 100644 index 00000000..7d0d3e4b --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/export/find_package_root.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/export/find_package_root.cmake:51:10 +function(rapids_export_find_package_root type name dir_path) + set(options "") + set(one_value "EXPORT_SET;CONDITION") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/export/package.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/export/package.stubs new file mode 100644 index 00000000..58f0585d --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/export/package.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/export/package.cmake:54:10 +function(rapids_export_package type name export_set) + set(options "") + set(one_value "EXPORT_SET;VERSION") + set(multi_value "GLOBAL_TARGETS;COMPONENTS") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/export/write_dependencies.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/export/write_dependencies.stubs new file mode 100644 index 00000000..b1577606 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/export/write_dependencies.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/export/write_dependencies.cmake:37:10 +function(rapids_export_write_dependencies type export_set file_path) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/export/write_language.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/export/write_language.stubs new file mode 100644 index 00000000..031c15fb --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/export/write_language.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/export/write_language.cmake:40:10 +function(rapids_export_write_language type lang file_path) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/find/generate_module.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/find/generate_module.stubs new file mode 100644 index 00000000..1b84bcde --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/find/generate_module.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/find/generate_module.cmake:136:10 +function(rapids_find_generate_module name) + set(options "NO_CONFIG") + set(one_value "VERSION;BUILD_EXPORT_SET;INSTALL_EXPORT_SET;INITIAL_CODE_BLOCK;FINAL_CODE_BLOCK") + set(multi_value "HEADER_NAMES;LIBRARY_NAMES;INCLUDE_SUFFIXES") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/find/package.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/find/package.stubs new file mode 100644 index 00000000..70b19d22 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/find/package.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/find/package.cmake:99:7 +function(rapids_find_package name) + set(options "FIND_ARGS") + set(one_value "BUILD_EXPORT_SET;INSTALL_EXPORT_SET") + set(multi_value "COMPONENTS;GLOBAL_TARGETS") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/test/add.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/test/add.stubs new file mode 100644 index 00000000..cdf11297 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/test/add.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/test/add.cmake:60:10 +function(rapids_test_add) + set(options "") + set(one_value "NAME;WORKING_DIRECTORY;GPUS;PERCENT;INSTALL_COMPONENT_SET;INSTALL_TARGET") + set(multi_value "COMMAND") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/test/detail/generate_installed_CTestTestfile.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/test/detail/generate_installed_CTestTestfile.stubs new file mode 100644 index 00000000..250c820d --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/test/detail/generate_installed_CTestTestfile.stubs @@ -0,0 +1,35 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/test/detail/generate_installed_CTestTestfile.cmake:36:10 +function(convert_paths_to_install_dir prop_var) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() + +# Generated from rapids-cmake/test/detail/generate_installed_CTestTestfile.cmake:70:10 +function(find_and_convert_paths_from_var_list prop_var) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() + +# Generated from rapids-cmake/test/detail/generate_installed_CTestTestfile.cmake:218:10 +function(extract_install_info) + set(options "file(INSTALL") + set(one_value "DESTINATION;TYPE") + set(multi_value "FILES") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() + +# Generated from rapids-cmake/test/detail/generate_installed_CTestTestfile.cmake:255:10 +function(determine_install_location_of_all_targets) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/test/detail/record_install.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/test/detail/record_install.stubs new file mode 100644 index 00000000..35b25e93 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/test/detail/record_install.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/test/detail/record_install.cmake:23:10 +function(rapids_test_record_install) + set(options "") + set(one_value "TARGET;COMPONENT") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/test/detail/record_test_component.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/test/detail/record_test_component.stubs new file mode 100644 index 00000000..98b84e55 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/test/detail/record_test_component.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/test/detail/record_test_component.cmake:22:10 +function(rapids_test_record_test_component) + set(options "") + set(one_value "NAME;COMPONENT") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/test/generate_resource_spec.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/test/generate_resource_spec.stubs new file mode 100644 index 00000000..66da18da --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/test/generate_resource_spec.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/test/generate_resource_spec.cmake:37:10 +function(rapids_test_generate_resource_spec DESTINATION filepath) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/test/gpu_requirements.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/test/gpu_requirements.stubs new file mode 100644 index 00000000..c39d2923 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/test/gpu_requirements.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/test/gpu_requirements.cmake:48:10 +function(rapids_test_gpu_requirements test_name) + set(options "") + set(one_value "GPUS;PERCENT") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/test/init.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/test/init.stubs new file mode 100644 index 00000000..b593248a --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/test/init.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/test/init.cmake:45:10 +function(rapids_test_init) + set(options "") + set(one_value "") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/test/install_relocatable.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/test/install_relocatable.stubs new file mode 100644 index 00000000..fa820a42 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-cmake/generated/test/install_relocatable.stubs @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 +# Automatically generated by ci/regenerate_stubs.py. DO NOT EDIT! + +# Generated from rapids-cmake/test/install_relocatable.cmake:47:10 +function(rapids_test_install_relocatable) + set(options "INCLUDE_IN_ALL") + set(one_value "INSTALL_COMPONENT_SET;DESTINATION") + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-logger.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-logger.stubs new file mode 100644 index 00000000..ef1956a6 --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/rapids/rapids-logger.stubs @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +function(create_logger_macros macro_prefix default_logger header_dir) +endfunction() diff --git a/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/thirdparty/cpm.stubs b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/thirdparty/cpm.stubs new file mode 100644 index 00000000..71478e5b --- /dev/null +++ b/python/gersemi-rapids-cmake/gersemi_rapids_cmake_detail/stubs/thirdparty/cpm.stubs @@ -0,0 +1,48 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +function(CPMAddPackage) + set(options) + set(one_value + NAME + FORCE + VERSION + GIT_TAG + DOWNLOAD_ONLY + GITHUB_REPOSITORY + GITLAB_REPOSITORY + SOURCE_DIR + FIND_PACKAGE_ARGUMENTS + NO_CACHE + SYSTEM + GIT_SHALLOW + EXCLUDE_FROM_ALL + SOURCE_SUBDIR + CUSTOM_CACHE_KEY + ) + set(multi_value + URL + OPTIONS + DOWNLOAD_COMMAND + PATCHES + ) + cmake_parse_arguments(_CPM "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() + +function(CPMFindPackage) + set(options) + set(one_value + NAME + VERSION + GIT_TAG + FIND_PACKAGE_ARGUMENTS + ) + set(multi_value) + cmake_parse_arguments(_CPM "${options}" "${one_value}" "${multi_value}" ${ARGN}) +endfunction() + +function(cpm_check_if_package_already_added CPM_ARGS_NAME CPM_ARGS_VERSION) +endfunction() + +macro(cpm_export_variables name) +endmacro() diff --git a/python/gersemi-rapids-cmake/pyproject.toml b/python/gersemi-rapids-cmake/pyproject.toml new file mode 100644 index 00000000..6f5ad343 --- /dev/null +++ b/python/gersemi-rapids-cmake/pyproject.toml @@ -0,0 +1,23 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +[project] +name = "gersemi-rapids-cmake" +description = "Gersemi extensions for rapids-cmake" +readme = { file = "README.md", content-type = "text/markdown" } +dynamic = ["version"] +dependencies = [ + "gersemi==0.25.1", +] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. + +[build-system] +build-backend = "setuptools.build_meta" +requires = [ + "setuptools", +] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. + +[tool.setuptools] +packages = ["gersemi_rapids_cmake", "gersemi_rapids_cmake_detail"] + +[tool.setuptools.dynamic] +version = { file = "gersemi_rapids_cmake_detail/VERSION" } diff --git a/rapids-cmake/cmake/build_type.cmake b/rapids-cmake/cmake/build_type.cmake index 6aff3631..b0c35620 100644 --- a/rapids-cmake/cmake/build_type.cmake +++ b/rapids-cmake/cmake/build_type.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -38,7 +38,9 @@ function(rapids_cmake_build_type default_type) 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 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/detail/compute_git_info.cmake b/rapids-cmake/cmake/detail/compute_git_info.cmake index 02dbb90a..422525b8 100644 --- a/rapids-cmake/cmake/detail/compute_git_info.cmake +++ b/rapids-cmake/cmake/detail/compute_git_info.cmake @@ -1,27 +1,30 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= if(GIT_EXECUTABLE AND EXISTS "${GIT_EXECUTABLE}") - execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse HEAD - WORKING_DIRECTORY ${WORKING_DIRECTORY} - ERROR_QUIET - OUTPUT_VARIABLE _RAPIDS_WRITE_SHA1 - OUTPUT_STRIP_TRAILING_WHITESPACE # need to strip off any newline + execute_process( + COMMAND ${GIT_EXECUTABLE} rev-parse HEAD + WORKING_DIRECTORY ${WORKING_DIRECTORY} + ERROR_QUIET + OUTPUT_VARIABLE _RAPIDS_WRITE_SHA1 + OUTPUT_STRIP_TRAILING_WHITESPACE # need to strip off any newline ) - execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD - WORKING_DIRECTORY ${WORKING_DIRECTORY} - ERROR_QUIET - OUTPUT_VARIABLE _RAPIDS_WRITE_BRANCH - OUTPUT_STRIP_TRAILING_WHITESPACE # need to strip off any newline + execute_process( + COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD + WORKING_DIRECTORY ${WORKING_DIRECTORY} + ERROR_QUIET + OUTPUT_VARIABLE _RAPIDS_WRITE_BRANCH + OUTPUT_STRIP_TRAILING_WHITESPACE # need to strip off any newline ) - execute_process(COMMAND ${GIT_EXECUTABLE} describe --tag --dirty --always - WORKING_DIRECTORY ${WORKING_DIRECTORY} - ERROR_QUIET - OUTPUT_VARIABLE _RAPIDS_WRITE_VERSION - OUTPUT_STRIP_TRAILING_WHITESPACE # need to strip off any newline + execute_process( + COMMAND ${GIT_EXECUTABLE} describe --tag --dirty --always + WORKING_DIRECTORY ${WORKING_DIRECTORY} + ERROR_QUIET + OUTPUT_VARIABLE _RAPIDS_WRITE_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE # need to strip off any newline ) endif() diff --git a/rapids-cmake/cmake/detail/policy.cmake b/rapids-cmake/cmake/detail/policy.cmake index 2364caf8..86ec7b1b 100644 --- a/rapids-cmake/cmake/detail/policy.cmake +++ b/rapids-cmake/cmake/detail/policy.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -29,8 +29,9 @@ function(rapids_cmake_policy) include("${rapids-cmake-dir}/rapids-version.cmake") endif() set(_RAPIDS_POLICY_CALLERS_VERSION ${rapids-cmake-version}) - set(policy_context_text - "rapids-cmake policy [deprecated=${_RAPIDS_POLICY_DEPRECATED_IN} removed=${_RAPIDS_POLICY_REMOVED_IN}]:" + set( + policy_context_text + "rapids-cmake policy [deprecated=${_RAPIDS_POLICY_DEPRECATED_IN} removed=${_RAPIDS_POLICY_REMOVED_IN}]:" ) set(policy_mode DEPRECATION) if(_RAPIDS_POLICY_CALLERS_VERSION VERSION_GREATER_EQUAL ${_RAPIDS_POLICY_REMOVED_IN}) @@ -39,10 +40,10 @@ function(rapids_cmake_policy) set(policy_upgrade_text "") if(_RAPIDS_POLICY_CALLERS_VERSION VERSION_LESS ${_RAPIDS_POLICY_DEPRECATED_IN}) - set(policy_upgrade_text - "You are currently requesting rapids-cmake ${_RAPIDS_POLICY_CALLERS_VERSION} please upgrade to ${_RAPIDS_POLICY_DEPRECATED_IN}." + set( + policy_upgrade_text + "You are currently requesting rapids-cmake ${_RAPIDS_POLICY_CALLERS_VERSION} please upgrade to ${_RAPIDS_POLICY_DEPRECATED_IN}." ) endif() message(${policy_mode} "${policy_context_text} ${_RAPIDS_POLICY_MESSAGE} ${policy_upgrade_text}") - endfunction() diff --git a/rapids-cmake/cmake/download_with_retry.cmake b/rapids-cmake/cmake/download_with_retry.cmake index bbc616b8..69993a53 100644 --- a/rapids-cmake/cmake/download_with_retry.cmake +++ b/rapids-cmake/cmake/download_with_retry.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -60,7 +60,9 @@ function(rapids_cmake_download_with_retry url output_file sha256) while(NOT download_success AND current_retry LESS ${_RAPIDS_MAX_RETRIES}) if(current_retry GREATER 0) - message(STATUS "Retrying download (attempt ${current_retry} of ${_RAPIDS_MAX_RETRIES}) after ${_RAPIDS_RETRY_DELAY} seconds..." + message( + STATUS + "Retrying download (attempt ${current_retry} of ${_RAPIDS_MAX_RETRIES}) after ${_RAPIDS_RETRY_DELAY} seconds..." ) execute_process(COMMAND ${CMAKE_COMMAND} -E sleep ${_RAPIDS_RETRY_DELAY}) endif() @@ -78,7 +80,9 @@ function(rapids_cmake_download_with_retry url output_file sha256) if(downloaded_sha256 STREQUAL "${sha256}") set(download_success TRUE) else() - message(WARNING "Downloaded file SHA256 checksum mismatch. Expected: ${sha256}, Got: ${downloaded_sha256}" + message( + WARNING + "Downloaded file SHA256 checksum mismatch. Expected: ${sha256}, Got: ${downloaded_sha256}" ) file(REMOVE "${output_file}") endif() @@ -89,7 +93,9 @@ function(rapids_cmake_download_with_retry url output_file sha256) if(current_retry LESS ${_RAPIDS_MAX_RETRIES}) message(WARNING "Failed to download file. Will retry. Download log:\n${download_log}") else() - message(FATAL_ERROR "Failed to download file after ${_RAPIDS_MAX_RETRIES} attempts. Download log:\n${download_log}" + message( + FATAL_ERROR + "Failed to download file after ${_RAPIDS_MAX_RETRIES} attempts. Download log:\n${download_log}" ) endif() endif() diff --git a/rapids-cmake/cmake/install_lib_dir.cmake b/rapids-cmake/cmake/install_lib_dir.cmake index c8eeb152..f8b6fe27 100644 --- a/rapids-cmake/cmake/install_lib_dir.cmake +++ b/rapids-cmake/cmake/install_lib_dir.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -66,5 +66,4 @@ function(rapids_cmake_install_lib_dir out_variable_name) endif() set(${out_variable_name} ${computed_path} PARENT_SCOPE) - endfunction() diff --git a/rapids-cmake/cmake/parse_version.cmake b/rapids-cmake/cmake/parse_version.cmake index 2fea6ccb..8fa47d30 100644 --- a/rapids-cmake/cmake/parse_version.cmake +++ b/rapids-cmake/cmake/parse_version.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -71,25 +71,21 @@ function(rapids_cmake_parse_version mode version_value out_variable_name) if(NOT extracted_component STREQUAL "") set(${out_variable_name} ${extracted_component} PARENT_SCOPE) endif() - elseif(mode STREQUAL "MINOR" AND len GREATER_EQUAL 2) list(GET version_as_list 1 extracted_component) if(NOT extracted_component STREQUAL "") set(${out_variable_name} ${extracted_component} PARENT_SCOPE) endif() - elseif(mode STREQUAL "PATCH" AND len GREATER_EQUAL 3) list(GET version_as_list 2 extracted_component) if(NOT extracted_component STREQUAL "") set(${out_variable_name} ${extracted_component} PARENT_SCOPE) endif() - 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 "") set(${out_variable_name} "${extracted_major}.${extracted_minor}" PARENT_SCOPE) endif() - endif() endfunction() diff --git a/rapids-cmake/cmake/support_conda_env.cmake b/rapids-cmake/cmake/support_conda_env.cmake index ea0c0ad2..3b79976b 100644 --- a/rapids-cmake/cmake/support_conda_env.cmake +++ b/rapids-cmake/cmake/support_conda_env.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -85,7 +85,6 @@ function(rapids_cmake_support_conda_env target) endif() if(in_conda_build OR in_conda_prefix) - # comment needed here due to cmake-lint bug macro(modify_cmake_prefix_path_global) cmake_parse_arguments(_RAPIDS "" "" "PATHS" ${ARGN}) @@ -146,29 +145,41 @@ function(rapids_cmake_support_conda_env target) set(targetsDir "targets/sbsa-linux") endif() - target_include_directories(${target} SYSTEM INTERFACE "$ENV{PREFIX}/include" - "$ENV{BUILD_PREFIX}/include") + target_include_directories( + ${target} + SYSTEM + INTERFACE "$ENV{PREFIX}/include" "$ENV{BUILD_PREFIX}/include" + ) target_link_directories(${target} INTERFACE "$ENV{PREFIX}/lib" "$ENV{BUILD_PREFIX}/lib") - if(DEFINED CMAKE_SHARED_LIBRARY_RPATH_LINK_CUDA_FLAG - OR DEFINED CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG) + if( + DEFINED CMAKE_SHARED_LIBRARY_RPATH_LINK_CUDA_FLAG + OR DEFINED CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG + ) if(DEFINED targetsDir) - target_link_options(${target} INTERFACE - "$" + target_link_options( + ${target} + INTERFACE "$" ) endif() - target_link_options(${target} INTERFACE - "$") - target_link_options(${target} INTERFACE - "$") + target_link_options( + ${target} + INTERFACE "$" + ) + target_link_options( + ${target} + INTERFACE "$" + ) endif() # For built binaries (like libraries), remap environment absolute paths (`$PREFIX/`) to # paths relative to the environment `$PREFIX` (``). - target_compile_options(${target} - INTERFACE "$<$:-ffile-prefix-map=$ENV{PREFIX}/=''>" - "$<$:-ffile-prefix-map=$ENV{PREFIX}/=''>" - "$<$:-Xcompiler=-ffile-prefix-map=$ENV{PREFIX}/=''>" + target_compile_options( + ${target} + INTERFACE + "$<$:-ffile-prefix-map=$ENV{PREFIX}/=''>" + "$<$:-ffile-prefix-map=$ENV{PREFIX}/=''>" + "$<$:-Xcompiler=-ffile-prefix-map=$ENV{PREFIX}/=''>" ) if(modify_prefix_path) @@ -179,14 +190,17 @@ function(rapids_cmake_support_conda_env target) endif() modify_cmake_prefix_path(PATHS ${prefix_paths}) endif() - elseif(in_conda_prefix) target_include_directories(${target} SYSTEM INTERFACE "$ENV{CONDA_PREFIX}/include") target_link_directories(${target} INTERFACE "$ENV{CONDA_PREFIX}/lib") - if(DEFINED CMAKE_SHARED_LIBRARY_RPATH_LINK_CUDA_FLAG - OR DEFINED CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG) - target_link_options(${target} INTERFACE - "$") + if( + DEFINED CMAKE_SHARED_LIBRARY_RPATH_LINK_CUDA_FLAG + OR DEFINED CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG + ) + target_link_options( + ${target} + INTERFACE "$" + ) endif() if(modify_prefix_path) diff --git a/rapids-cmake/cmake/write_git_revision_file.cmake b/rapids-cmake/cmake/write_git_revision_file.cmake index 9bcba8bb..4da1ecdb 100644 --- a/rapids-cmake/cmake/write_git_revision_file.cmake +++ b/rapids-cmake/cmake/write_git_revision_file.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -87,16 +87,19 @@ function(rapids_cmake_write_git_revision_file target file_path) # Find Git find_package(Git QUIET) - add_custom_target(${target}_compute_git_info ALL - BYPRODUCTS "${file_path}" - COMMENT "Generate git revision file for ${target}" - COMMAND ${CMAKE_COMMAND} -DWORKING_DIRECTORY=${CMAKE_CURRENT_SOURCE_DIR} - -DGIT_EXECUTABLE=${GIT_EXECUTABLE} - -D_RAPIDS_GIT_PREFIX=${_RAPIDS_PREFIX} - -DTEMPLATE_FILE=${CMAKE_CURRENT_FUNCTION_LIST_DIR}/template/git_revision.h.in - -DFILE_TO_WRITE=${file_path} -P - ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/detail/compute_git_info.cmake - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + add_custom_target( + ${target}_compute_git_info + ALL + BYPRODUCTS "${file_path}" + COMMENT "Generate git revision file for ${target}" + COMMAND + ${CMAKE_COMMAND} -DWORKING_DIRECTORY=${CMAKE_CURRENT_SOURCE_DIR} + -DGIT_EXECUTABLE=${GIT_EXECUTABLE} -D_RAPIDS_GIT_PREFIX=${_RAPIDS_PREFIX} + -DTEMPLATE_FILE=${CMAKE_CURRENT_FUNCTION_LIST_DIR}/template/git_revision.h.in + -DFILE_TO_WRITE=${file_path} -P + ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/detail/compute_git_info.cmake + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + ) # Generate a target that depends on compute_git_info This is what other targets will use to get # the build path and makes sure that we have correct parallel builds @@ -105,5 +108,4 @@ function(rapids_cmake_write_git_revision_file target file_path) cmake_path(GET file_path PARENT_PATH file_path_dir) target_include_directories(${target} INTERFACE "$") - endfunction() diff --git a/rapids-cmake/cpm/bs_thread_pool.cmake b/rapids-cmake/cpm/bs_thread_pool.cmake index 978837ed..62fd80f2 100644 --- a/rapids-cmake/cpm/bs_thread_pool.cmake +++ b/rapids-cmake/cpm/bs_thread_pool.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -44,12 +44,23 @@ function(rapids_cpm_bs_thread_pool) list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.cpm.bs_thread_pool") include("${rapids-cmake-dir}/cpm/detail/package_info.cmake") - rapids_cpm_package_info(bs_thread_pool ${ARGN} VERSION_VAR version FIND_VAR find_args CPM_VAR - cpm_find_info TO_INSTALL_VAR to_install) + rapids_cpm_package_info( + bs_thread_pool + ${ARGN} + VERSION_VAR version + FIND_VAR find_args + CPM_VAR cpm_find_info + TO_INSTALL_VAR to_install + ) include("${rapids-cmake-dir}/cpm/find.cmake") - rapids_cpm_find(bs_thread_pool ${version} ${find_args} GLOBAL_TARGETS rapids_bs_thread_pool - CPM_ARGS ${cpm_find_info} DOWNLOAD_ONLY ON) + rapids_cpm_find( + bs_thread_pool + ${version} + ${find_args} + GLOBAL_TARGETS rapids_bs_thread_pool + CPM_ARGS ${cpm_find_info} DOWNLOAD_ONLY ON + ) include("${rapids-cmake-dir}/cpm/detail/display_patch_status.cmake") rapids_cpm_display_patch_status(bs_thread_pool) @@ -63,9 +74,12 @@ function(rapids_cpm_bs_thread_pool) if(bs_thread_pool_ADDED) if(NOT TARGET rapids_bs_thread_pool) add_library(rapids_bs_thread_pool INTERFACE) - target_include_directories(rapids_bs_thread_pool - INTERFACE "$" - "$") + target_include_directories( + rapids_bs_thread_pool + INTERFACE + "$" + "$" + ) target_compile_definitions(rapids_bs_thread_pool INTERFACE "BS_THREAD_POOL_ENABLE_PAUSE=1") target_compile_features(rapids_bs_thread_pool INTERFACE cxx_std_17 cuda_std_17) set_property(TARGET rapids_bs_thread_pool PROPERTY EXPORT_NAME thread_pool) @@ -73,25 +87,37 @@ function(rapids_cpm_bs_thread_pool) endif() if(_RAPIDS_BUILD_EXPORT_SET) include("${rapids-cmake-dir}/export/export.cmake") - rapids_export(BUILD bs_thread_pool - VERSION ${version} - EXPORT_SET bs_thread_pool-targets - GLOBAL_TARGETS thread_pool - NAMESPACE BS::) + rapids_export( + BUILD + bs_thread_pool + VERSION ${version} + EXPORT_SET bs_thread_pool-targets + GLOBAL_TARGETS thread_pool + NAMESPACE BS:: + ) include("${rapids-cmake-dir}/export/find_package_root.cmake") - rapids_export_find_package_root(BUILD bs_thread_pool [=[${CMAKE_CURRENT_LIST_DIR}]=] - EXPORT_SET ${_RAPIDS_BUILD_EXPORT_SET}) + rapids_export_find_package_root( + BUILD + bs_thread_pool + [=[${CMAKE_CURRENT_LIST_DIR}]=] + EXPORT_SET ${_RAPIDS_BUILD_EXPORT_SET} + ) endif() if(to_install) include(GNUInstallDirs) - install(DIRECTORY "${bs_thread_pool_SOURCE_DIR}/include/" - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") + install( + DIRECTORY "${bs_thread_pool_SOURCE_DIR}/include/" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + ) include("${rapids-cmake-dir}/export/export.cmake") - rapids_export(INSTALL bs_thread_pool - VERSION ${version} - EXPORT_SET bs_thread_pool-targets - GLOBAL_TARGETS thread_pool - NAMESPACE BS::) + rapids_export( + INSTALL + bs_thread_pool + VERSION ${version} + EXPORT_SET bs_thread_pool-targets + GLOBAL_TARGETS thread_pool + NAMESPACE BS:: + ) endif() endif() diff --git a/rapids-cmake/cpm/cccl.cmake b/rapids-cmake/cpm/cccl.cmake index a4853690..ef4279ec 100644 --- a/rapids-cmake/cpm/cccl.cmake +++ b/rapids-cmake/cpm/cccl.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -64,8 +64,14 @@ function(rapids_cpm_cccl) cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) include("${rapids-cmake-dir}/cpm/detail/package_info.cmake") - rapids_cpm_package_info(CCCL ${_RAPIDS_UNPARSED_ARGUMENTS} VERSION_VAR version FIND_VAR find_args - CPM_VAR cpm_find_info TO_INSTALL_VAR to_install) + rapids_cpm_package_info( + CCCL + ${_RAPIDS_UNPARSED_ARGUMENTS} + VERSION_VAR version + FIND_VAR find_args + CPM_VAR cpm_find_info + TO_INSTALL_VAR to_install + ) if(_RAPIDS_ENABLE_UNSTABLE) list(APPEND cpm_find_info OPTIONS "CCCL_ENABLE_UNSTABLE ON") @@ -79,8 +85,12 @@ function(rapids_cpm_cccl) # We don't specify `CCCL_ENABLE_INSTALL_RULES` as a `rapids_cpm_find` argument so that it isn't # propagated to users of the build export file which would cause them to also install parts of # CCCL by mistake ( and in a wrong directory ) - get_property(rapids_cccl_install_rules_already_called GLOBAL - PROPERTY rapids_cmake_cccl_install_rules SET) + get_property( + rapids_cccl_install_rules_already_called + GLOBAL + PROPERTY rapids_cmake_cccl_install_rules + SET + ) if(NOT rapids_cccl_install_rules_already_called) set(CCCL_ENABLE_INSTALL_RULES ON) set(CUB_ENABLE_INSTALL_RULES ON) @@ -96,9 +106,13 @@ function(rapids_cpm_cccl) set(CCCL_TOPLEVEL_PROJECT OFF) include("${rapids-cmake-dir}/cpm/find.cmake") - rapids_cpm_find(CCCL ${version} ${find_args} GLOBAL_TARGETS CCCL CCCL::CCCL CCCL::CUB - CCCL::libcudacxx CCCL::cudax - CPM_ARGS FIND_PACKAGE_ARGUMENTS EXACT ${cpm_find_info}) + rapids_cpm_find( + CCCL + ${version} + ${find_args} + GLOBAL_TARGETS CCCL CCCL::CCCL CCCL::CUB CCCL::libcudacxx CCCL::cudax + CPM_ARGS FIND_PACKAGE_ARGUMENTS EXACT ${cpm_find_info} + ) include("${rapids-cmake-dir}/cpm/detail/display_patch_status.cmake") rapids_cpm_display_patch_status(CCCL) @@ -106,11 +120,19 @@ function(rapids_cpm_cccl) if(CCCL_SOURCE_DIR) # Store where CMake can find the cccl-config.cmake include("${rapids-cmake-dir}/export/find_package_root.cmake") - rapids_export_find_package_root(BUILD CCCL "${CCCL_SOURCE_DIR}/lib/cmake/cccl" - EXPORT_SET ${_RAPIDS_BUILD_EXPORT_SET}) - rapids_export_find_package_root(INSTALL CCCL - [=[${CMAKE_CURRENT_LIST_DIR}/../../rapids/cmake/cccl]=] - EXPORT_SET ${_RAPIDS_INSTALL_EXPORT_SET} CONDITION to_install) + rapids_export_find_package_root( + BUILD + CCCL + "${CCCL_SOURCE_DIR}/lib/cmake/cccl" + EXPORT_SET ${_RAPIDS_BUILD_EXPORT_SET} + ) + rapids_export_find_package_root( + INSTALL + CCCL + [=[${CMAKE_CURRENT_LIST_DIR}/../../rapids/cmake/cccl]=] + EXPORT_SET ${_RAPIDS_INSTALL_EXPORT_SET} + CONDITION to_install + ) endif() if(TARGET CCCL::CCCL) @@ -119,19 +141,30 @@ function(rapids_cpm_cccl) target_compile_definitions(CCCL::CCCL INTERFACE THRUST_DISABLE_ABI_NAMESPACE) target_compile_definitions(CCCL::CCCL INTERFACE THRUST_IGNORE_ABI_NAMESPACE_ERROR) target_compile_definitions(CCCL::CCCL INTERFACE CCCL_DISABLE_PDL) - set(post_find_code - [=[ + set( + post_find_code + [=[ target_compile_definitions(CCCL::CCCL INTERFACE CUB_DISABLE_NAMESPACE_MAGIC) target_compile_definitions(CCCL::CCCL INTERFACE CUB_IGNORE_NAMESPACE_MAGIC_ERROR) target_compile_definitions(CCCL::CCCL INTERFACE THRUST_DISABLE_ABI_NAMESPACE) target_compile_definitions(CCCL::CCCL INTERFACE THRUST_IGNORE_ABI_NAMESPACE_ERROR) target_compile_definitions(CCCL::CCCL INTERFACE CCCL_DISABLE_PDL) - ]=]) + ]=] + ) include("${rapids-cmake-dir}/export/detail/post_find_package_code.cmake") - rapids_export_post_find_package_code(BUILD CCCL "${post_find_code}" EXPORT_SET - ${_RAPIDS_BUILD_EXPORT_SET}) - rapids_export_post_find_package_code(INSTALL CCCL "${post_find_code}" EXPORT_SET - ${_RAPIDS_INSTALL_EXPORT_SET} CONDITION to_install) + rapids_export_post_find_package_code( + BUILD + CCCL + "${post_find_code}" + EXPORT_SET ${_RAPIDS_BUILD_EXPORT_SET} + ) + rapids_export_post_find_package_code( + INSTALL + CCCL + "${post_find_code}" + EXPORT_SET ${_RAPIDS_INSTALL_EXPORT_SET} + CONDITION to_install + ) endif() # Propagate up variables that CPMFindPackage provides @@ -139,5 +172,4 @@ function(rapids_cpm_cccl) set(CCCL_BINARY_DIR "${CCCL_BINARY_DIR}" PARENT_SCOPE) set(CCCL_ADDED "${CCCL_ADDED}" PARENT_SCOPE) set(CCCL_VERSION ${version} PARENT_SCOPE) - endfunction() diff --git a/rapids-cmake/cpm/cuco.cmake b/rapids-cmake/cpm/cuco.cmake index 2c81c935..ec5009fd 100644 --- a/rapids-cmake/cpm/cuco.cmake +++ b/rapids-cmake/cpm/cuco.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -43,13 +43,29 @@ function(rapids_cpm_cuco) list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.cpm.cuco") include("${rapids-cmake-dir}/cpm/detail/package_info.cmake") - rapids_cpm_package_info(cuco ${ARGN} VERSION_VAR version FIND_VAR find_args CPM_VAR cpm_find_info - TO_INSTALL_VAR to_install) + rapids_cpm_package_info( + cuco + ${ARGN} + VERSION_VAR version + FIND_VAR find_args + CPM_VAR cpm_find_info + TO_INSTALL_VAR to_install + ) include("${rapids-cmake-dir}/cpm/find.cmake") - rapids_cpm_find(cuco ${version} ${find_args} GLOBAL_TARGETS cuco::cuco CPM_ARGS ${cpm_find_info} - OPTIONS "BUILD_TESTS OFF" "BUILD_BENCHMARKS OFF" "BUILD_EXAMPLES OFF" - "INSTALL_CUCO ${to_install}") + rapids_cpm_find( + cuco + ${version} + ${find_args} + GLOBAL_TARGETS cuco::cuco + CPM_ARGS + ${cpm_find_info} + OPTIONS + "BUILD_TESTS OFF" + "BUILD_BENCHMARKS OFF" + "BUILD_EXAMPLES OFF" + "INSTALL_CUCO ${to_install}" + ) include("${rapids-cmake-dir}/cpm/detail/display_patch_status.cmake") rapids_cpm_display_patch_status(cuco) @@ -59,5 +75,4 @@ function(rapids_cpm_cuco) set(cuco_BINARY_DIR "${cuco_BINARY_DIR}" PARENT_SCOPE) set(cuco_ADDED "${cuco_ADDED}" PARENT_SCOPE) set(cuco_VERSION ${version} PARENT_SCOPE) - endfunction() diff --git a/rapids-cmake/cpm/detail/convert_patch_json.cmake b/rapids-cmake/cpm/detail/convert_patch_json.cmake index b4cf472d..c1609d40 100644 --- a/rapids-cmake/cpm/detail/convert_patch_json.cmake +++ b/rapids-cmake/cpm/detail/convert_patch_json.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -26,7 +26,14 @@ function(rapids_cpm_convert_patch_json) list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.cpm.conver_path_json") set(options) - set(one_value FROM_JSON_TO_FILE FROM_FILE_TO_JSON FILE_VAR PACKAGE_NAME INDEX) + set( + one_value + FROM_JSON_TO_FILE + FROM_FILE_TO_JSON + FILE_VAR + PACKAGE_NAME + INDEX + ) set(multi_value) cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) @@ -41,8 +48,9 @@ function(rapids_cpm_convert_patch_json) string(JSON json_content GET "${json}" "content") # Figure out the file path - set(file - "${CMAKE_BINARY_DIR}/rapids-cmake/patches/${_RAPIDS_PACKAGE_NAME}/embedded_patch_${_RAPIDS_INDEX}.${type}" + set( + file + "${CMAKE_BINARY_DIR}/rapids-cmake/patches/${_RAPIDS_PACKAGE_NAME}/embedded_patch_${_RAPIDS_INDEX}.${type}" ) # Transform from a list of strings to a single file @@ -78,16 +86,17 @@ function(rapids_cpm_convert_patch_json) string(JSON inline_patch SET "${inline_patch}" ${content_length} "\"${line}\"") endforeach() - set(json_content - [=[{ + set( + json_content + [=[{ "type" : "", "content" : [] - }]=]) + }]=] + ) string(JSON json_content SET "${json_content}" "type" "\"${patch_ext}\"") string(JSON json_content SET "${json_content}" "content" "${inline_patch}") set(${_RAPIDS_FROM_FILE_TO_JSON} "${json_content}" PARENT_SCOPE) else() message(FATAL_ERROR "rapids_cpm_convert_patch_json unsupported mode: ${mode}") endif() - endfunction() diff --git a/rapids-cmake/cpm/detail/display_patch_status.cmake b/rapids-cmake/cpm/detail/display_patch_status.cmake index 1d66171f..2f46307d 100644 --- a/rapids-cmake/cpm/detail/display_patch_status.cmake +++ b/rapids-cmake/cpm/detail/display_patch_status.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -36,6 +36,5 @@ function(rapids_cpm_display_patch_status package_name) file(READ "${err_file}" contents) message(FATAL_ERROR "${contents}") endif() - endif() endfunction() diff --git a/rapids-cmake/cpm/detail/download.cmake b/rapids-cmake/cpm/detail/download.cmake index cb32b7a2..2fce49a0 100644 --- a/rapids-cmake/cpm/detail/download.cmake +++ b/rapids-cmake/cpm/detail/download.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -57,16 +57,13 @@ function(rapids_cpm_download) # Also support the rapids-cmake download location ( cmake/ vs cpm/ ) set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake") endif() - elseif(DEFINED ENV{CPM_SOURCE_CACHE}) - # default to the same location that cpm computes set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") if(EXISTS "$ENV{CPM_SOURCE_CACHE}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake") # Also support the rapids-cmake download location ( cmake/ vs cpm/ ) set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake") endif() - else() set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake") endif() @@ -79,7 +76,9 @@ function(rapids_cpm_download) endif() rapids_cmake_download_with_retry( https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake - ${CPM_DOWNLOAD_LOCATION} ${CPM_DOWNLOAD_SHA256_HASH}) + ${CPM_DOWNLOAD_LOCATION} + ${CPM_DOWNLOAD_SHA256_HASH} + ) endif() include(${CPM_DOWNLOAD_LOCATION}) @@ -89,5 +88,4 @@ function(rapids_cpm_download) # Push up the modified CMAKE_MODULE_PATh to allow `find_package` calls to find packages that CPM # already added. set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" PARENT_SCOPE) - endfunction() diff --git a/rapids-cmake/cpm/detail/generate_patch_command.cmake b/rapids-cmake/cpm/detail/generate_patch_command.cmake index 87066081..9f894dd8 100644 --- a/rapids-cmake/cpm/detail/generate_patch_command.cmake +++ b/rapids-cmake/cpm/detail/generate_patch_command.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -33,12 +33,19 @@ function(rapids_cpm_generate_patch_command package_name version patch_command bu string(TOLOWER "${package_name}" normalized_pkg_name) get_property(json_path GLOBAL PROPERTY rapids_cpm_${normalized_pkg_name}_json_file) - get_property(override_json_path GLOBAL - PROPERTY rapids_cpm_${normalized_pkg_name}_override_json_file) + get_property( + override_json_path + GLOBAL + PROPERTY rapids_cpm_${normalized_pkg_name}_override_json_file + ) string(JSON json_data ERROR_VARIABLE no_default_patch GET "${json_data}" patches) - string(JSON override_json_data ERROR_VARIABLE no_override_patch GET "${override_json_data}" - patches) + string( + JSON override_json_data + ERROR_VARIABLE no_override_patch + GET "${override_json_data}" + patches + ) if(no_default_patch AND no_override_patch) return() # no patches endif() @@ -52,7 +59,7 @@ function(rapids_cpm_generate_patch_command package_name version patch_command bu cmake_path(GET json_path PARENT_PATH current_json_dir) # Parse required fields - function(rapids_cpm_json_get_value json_data_ name) + function(generate_patch_command_json_get_value json_data_ name) string(JSON value ERROR_VARIABLE have_error GET "${json_data_}" ${name}) if(NOT have_error) set(${name} ${value} PARENT_SCOPE) @@ -77,20 +84,24 @@ function(rapids_cpm_generate_patch_command package_name version patch_command bu math(EXPR patch_count "${patch_count} - 1") foreach(index RANGE ${patch_count}) string(JSON patch_data GET "${json_data}" ${index}) - rapids_cpm_json_get_value(${patch_data} fixed_in) + generate_patch_command_json_get_value(${patch_data} fixed_in) if(NOT fixed_in OR version VERSION_LESS fixed_in) set(build) - rapids_cpm_json_get_value(${patch_data} file) - rapids_cpm_json_get_value(${patch_data} inline_patch) - rapids_cpm_json_get_value(${patch_data} issue) - rapids_cpm_json_get_value(${patch_data} build) + generate_patch_command_json_get_value(${patch_data} file) + generate_patch_command_json_get_value(${patch_data} inline_patch) + generate_patch_command_json_get_value(${patch_data} issue) + generate_patch_command_json_get_value(${patch_data} build) # Convert any embedded patch to a file. if(inline_patch) include("${rapids-cmake-dir}/cpm/detail/convert_patch_json.cmake") - rapids_cpm_convert_patch_json(FROM_JSON_TO_FILE inline_patch FILE_VAR file PACKAGE_NAME - ${package_name} INDEX ${index}) + rapids_cpm_convert_patch_json( + FROM_JSON_TO_FILE inline_patch + FILE_VAR file + PACKAGE_NAME ${package_name} + INDEX ${index} + ) endif() if(NOT build) @@ -107,7 +118,7 @@ function(rapids_cpm_generate_patch_command package_name version patch_command bu list(APPEND patch_issues_to_ref "${issue}") set(required FALSE) - rapids_cpm_json_get_value(${patch_data} required) + generate_patch_command_json_get_value(${patch_data} required) list(APPEND patch_required_to_apply "${required}") endif() unset(file) @@ -122,8 +133,11 @@ function(rapids_cpm_generate_patch_command package_name version patch_command bu set(err_file "${CMAKE_BINARY_DIR}/rapids-cmake/patches/${package_name}/err") if(patch_files_to_run) string(TIMESTAMP current_year "%Y" UTC) - configure_file(${rapids-cmake-dir}/cpm/patches/command_template.cmake.in "${patch_script}" - @ONLY) + configure_file( + ${rapids-cmake-dir}/cpm/patches/command_template.cmake.in + "${patch_script}" + @ONLY + ) set(${patch_command} PATCH_COMMAND ${CMAKE_COMMAND} -P ${patch_script} PARENT_SCOPE) else() # remove any old patch / log files that exist and are no longer needed due to a change in the diff --git a/rapids-cmake/cpm/detail/get_proprietary_binary_url.cmake b/rapids-cmake/cpm/detail/get_proprietary_binary_url.cmake index 0b25dc72..024b480d 100644 --- a/rapids-cmake/cpm/detail/get_proprietary_binary_url.cmake +++ b/rapids-cmake/cpm/detail/get_proprietary_binary_url.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -33,16 +33,27 @@ function(rapids_cpm_get_proprietary_binary_url package_name version url_var) set(key "${CMAKE_SYSTEM_PROCESSOR}-${CMAKE_SYSTEM_NAME}") string(TOLOWER ${key} key) if(override_json_data) - string(JSON proprietary_binary ERROR_VARIABLE have_error GET "${override_json_data}" - "proprietary_binary" "${key}") + string( + JSON proprietary_binary + ERROR_VARIABLE have_error + GET "${override_json_data}" + "proprietary_binary" + "${key}" + ) else() - string(JSON proprietary_binary ERROR_VARIABLE have_error GET "${json_data}" - "proprietary_binary" "${key}") + string( + JSON proprietary_binary + ERROR_VARIABLE have_error + GET "${json_data}" + "proprietary_binary" + "${key}" + ) endif() if(have_error) - message(VERBOSE - "${package_name} requested usage of a proprietary_binary but none exist for ${CMAKE_SYSTEM_PROCESSOR}" + message( + VERBOSE + "${package_name} requested usage of a proprietary_binary but none exist for ${CMAKE_SYSTEM_PROCESSOR}" ) return() endif() @@ -56,12 +67,21 @@ function(rapids_cpm_get_proprietary_binary_url package_name version url_var) set(cuda-toolkit-version-major ${CUDAToolkit_VERSION_MAJOR}) # See if we have a CUDA Toolkit version mapping entry and load it as needed - string(JSON cuda-toolkit-version-mapping ERROR_VARIABLE have_error_mapping GET - "${override_json_data}" "proprietary_binary_cuda_version_mapping" - "${cuda-toolkit-version-major}") + string( + JSON cuda-toolkit-version-mapping + ERROR_VARIABLE have_error_mapping + GET "${override_json_data}" + "proprietary_binary_cuda_version_mapping" + "${cuda-toolkit-version-major}" + ) if(have_error_mapping) - string(JSON cuda-toolkit-version-mapping ERROR_VARIABLE have_error_mapping GET "${json_data}" - "proprietary_binary_cuda_version_mapping" "${cuda-toolkit-version-major}") + string( + JSON cuda-toolkit-version-mapping + ERROR_VARIABLE have_error_mapping + GET "${json_data}" + "proprietary_binary_cuda_version_mapping" + "${cuda-toolkit-version-major}" + ) endif() endif() diff --git a/rapids-cmake/cpm/detail/load_preset_versions.cmake b/rapids-cmake/cpm/detail/load_preset_versions.cmake index 26f6fe86..5078233c 100644 --- a/rapids-cmake/cpm/detail/load_preset_versions.cmake +++ b/rapids-cmake/cpm/detail/load_preset_versions.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -28,8 +28,13 @@ function(rapids_cpm_load_preset_versions) set(_rapids_options) set(_rapids_one_value PRESET_FILE) set(_rapids_multi_value) - cmake_parse_arguments(_RAPIDS "${_rapids_options}" "${_rapids_one_value}" - "${_rapids_multi_value}" ${ARGN}) + cmake_parse_arguments( + _RAPIDS + "${_rapids_options}" + "${_rapids_one_value}" + "${_rapids_multi_value}" + ${ARGN} + ) set(_rapids_preset_version_file "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../versions.json") if(_RAPIDS_PRESET_FILE) @@ -40,13 +45,19 @@ function(rapids_cpm_load_preset_versions) endif() if(NOT EXISTS "${_rapids_preset_version_file}") - message(FATAL_ERROR "rapids_cpm can't load '${_rapids_preset_version_file}' to find package version information, verify it exists" + message( + FATAL_ERROR + "rapids_cpm can't load '${_rapids_preset_version_file}' to find package version information, verify it exists" ) endif() # Check if we have been loaded before, if so early terminate - get_property(already_loaded GLOBAL PROPERTY rapids_cpm_load_presets_${_rapids_preset_version_file} - SET) + get_property( + already_loaded + GLOBAL + PROPERTY rapids_cpm_load_presets_${_rapids_preset_version_file} + SET + ) if(already_loaded) return() endif() @@ -72,14 +83,17 @@ function(rapids_cpm_load_preset_versions) get_property(already_exists GLOBAL PROPERTY rapids_cpm_${normalized_pkg_name}_json SET) if(already_exists) # Warn that we have duplicate entries in the default json file - message(AUTHOR_WARNING "RAPIDS-CMake has detected two entries for ${package_name} in ${_rapids_preset_version_file}. Please ensure a single entry as all names are cased insensitive" + message( + AUTHOR_WARNING + "RAPIDS-CMake has detected two entries for ${package_name} in ${_rapids_preset_version_file}. Please ensure a single entry as all names are cased insensitive" ) else() set_property(GLOBAL PROPERTY rapids_cpm_${normalized_pkg_name}_json "${data}") - set_property(GLOBAL PROPERTY rapids_cpm_${normalized_pkg_name}_json_file - "${_rapids_preset_version_file}") + set_property( + GLOBAL + PROPERTY rapids_cpm_${normalized_pkg_name}_json_file "${_rapids_preset_version_file}" + ) set_property(GLOBAL PROPERTY rapids_cpm_${normalized_pkg_name}_proper_name "${package_name}") endif() endforeach() - endfunction() diff --git a/rapids-cmake/cpm/detail/package_details.cmake b/rapids-cmake/cpm/detail/package_details.cmake index f97eb98a..04dcd292 100644 --- a/rapids-cmake/cpm/detail/package_details.cmake +++ b/rapids-cmake/cpm/detail/package_details.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -27,18 +27,34 @@ Result Variables #]=======================================================================] # cmake-lint: disable=R0913 -function(rapids_cpm_package_details package_name version_var url_var tag_var shallow_var - exclude_from_all_var) +function( + rapids_cpm_package_details + package_name + version_var + url_var + tag_var + shallow_var + exclude_from_all_var +) list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.cpm.rapids_cpm_package_details") include("${rapids-cmake-dir}/cmake/detail/policy.cmake") - rapids_cmake_policy(DEPRECATED_IN 25.10 - REMOVED_IN 26.02 - MESSAGE [=[`rapids_cpm_package_details` is deprecated. Please use `rapids_cpm_package_info` instead.]=] + rapids_cmake_policy( + DEPRECATED_IN 25.10 + REMOVED_IN 26.02 + MESSAGE + [=[`rapids_cpm_package_details` is deprecated. Please use `rapids_cpm_package_info` instead.]=] ) - rapids_cpm_package_details_internal(${package_name} ${version_var} ${url_var} ${tag_var} - src_subdir ${shallow_var} ${exclude_from_all_var}) + rapids_cpm_package_details_internal( + ${package_name} + ${version_var} + ${url_var} + ${tag_var} + src_subdir + ${shallow_var} + ${exclude_from_all_var} + ) set(${version_var} ${${version_var}} PARENT_SCOPE) set(${url_var} ${${url_var}} PARENT_SCOPE) set(${tag_var} ${${tag_var}} PARENT_SCOPE) @@ -48,12 +64,19 @@ function(rapids_cpm_package_details package_name version_var url_var tag_var sha set(rapids_cmake_always_download ${rapids_cmake_always_download} PARENT_SCOPE) set(CPM_DOWNLOAD_ALL ${CPM_DOWNLOAD_ALL} PARENT_SCOPE) endif() - endfunction() # cmake-lint: disable=R0913,R0915 -function(rapids_cpm_package_details_internal package_name version_var url_var tag_var subdir_var - shallow_var exclude_from_all_var) +function( + rapids_cpm_package_details_internal + package_name + version_var + url_var + tag_var + subdir_var + shallow_var + exclude_from_all_var +) list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.cpm.rapids_cpm_package_details_internal") include("${rapids-cmake-dir}/cpm/detail/load_preset_versions.cmake") @@ -65,7 +88,7 @@ function(rapids_cpm_package_details_internal package_name version_var url_var ta get_override_json(${package_name} override_json_data) # Parse required fields - function(rapids_cpm_json_get_value name) + function(package_details_json_get_value name) string(JSON value ERROR_VARIABLE have_error GET "${override_json_data}" ${name}) if(have_error) string(JSON value ERROR_VARIABLE have_error GET "${json_data}" ${name}) @@ -76,16 +99,18 @@ function(rapids_cpm_package_details_internal package_name version_var url_var ta endif() endfunction() - rapids_cpm_json_get_value(version) - rapids_cpm_json_get_value(git_url) - rapids_cpm_json_get_value(git_tag) + package_details_json_get_value(version) + package_details_json_get_value(git_url) + package_details_json_get_value(git_tag) # Only do validation if we have an entry if(json_data OR override_json_data) # Validate that we have the required fields foreach(var IN ITEMS version git_url git_tag) if(NOT ${var}) - message(FATAL_ERROR "rapids_cmake can't parse '${package_name}' json entry, it is missing a `${var}` entry" + message( + FATAL_ERROR + "rapids_cmake can't parse '${package_name}' json entry, it is missing a `${var}` entry" ) endif() endforeach() @@ -103,13 +128,13 @@ function(rapids_cpm_package_details_internal package_name version_var url_var ta # Parse optional fields, set the variable to the 'default' value first set(git_shallow ON) - rapids_cpm_json_get_value(git_shallow) + package_details_json_get_value(git_shallow) unset(source_subdir) - rapids_cpm_json_get_value(source_subdir) + package_details_json_get_value(source_subdir) set(exclude_from_all OFF) - rapids_cpm_json_get_value(exclude_from_all) + package_details_json_get_value(exclude_from_all) # Ensure that always_download is not set by default so that the if(DEFINED always_download) check # below works as expected in the default case. @@ -120,13 +145,16 @@ function(rapids_cpm_package_details_internal package_name version_var url_var ta # and that the git url / git tag have been modified. We also need to make sure that when using # an override that it isn't disabled due to `CPM__SOURCE` string(TOLOWER "${package_name}" normalized_pkg_name) - get_property(override_ignored GLOBAL - PROPERTY rapids_cpm_${normalized_pkg_name}_override_ignored) + get_property( + override_ignored + GLOBAL + PROPERTY rapids_cpm_${normalized_pkg_name}_override_ignored + ) if(NOT (override_ignored OR DEFINED CPM_${package_name}_SOURCE)) set(always_download ON) endif() endif() - rapids_cpm_json_get_value(always_download) + package_details_json_get_value(always_download) # Evaluate any magic placeholders in the version or tag components including the # `rapids-cmake-version` and `rapids-cmake-checkout-tag` values @@ -148,5 +176,4 @@ function(rapids_cpm_package_details_internal package_name version_var url_var ta set(rapids_cmake_always_download ${always_download} PARENT_SCOPE) set(CPM_DOWNLOAD_ALL ${always_download} PARENT_SCOPE) endif() - endfunction() diff --git a/rapids-cmake/cpm/detail/package_info.cmake b/rapids-cmake/cpm/detail/package_info.cmake index 77f0088a..dfb963b0 100644 --- a/rapids-cmake/cpm/detail/package_info.cmake +++ b/rapids-cmake/cpm/detail/package_info.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -30,20 +30,39 @@ function(rapids_cpm_package_info package_name) list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.cpm.rapids_cpm_package_info") set(options FOR_FETCH_CONTENT) - set(one_value VERSION_VAR FIND_VAR CPM_VAR TO_INSTALL_VAR BUILD_EXPORT_SET INSTALL_EXPORT_SET) + set( + one_value + VERSION_VAR + FIND_VAR + CPM_VAR + TO_INSTALL_VAR + BUILD_EXPORT_SET + INSTALL_EXPORT_SET + ) set(multi_value) cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) # Get all the package details include("${rapids-cmake-dir}/cpm/detail/package_details.cmake") - rapids_cpm_package_details_internal(${package_name} _rapids_version _rapids_url _rapids_tag - _rapids_src_subdir _rapids_shallow _rapids_exclude_from_all) + rapids_cpm_package_details_internal( + ${package_name} + _rapids_version + _rapids_url + _rapids_tag + _rapids_src_subdir + _rapids_shallow + _rapids_exclude_from_all + ) # Compute all the patch related details if(_RAPIDS_CPM_VAR OR _RAPIDS_FIND_VAR) include("${rapids-cmake-dir}/cpm/detail/generate_patch_command.cmake") - rapids_cpm_generate_patch_command(${package_name} ${_rapids_version} patch_command - build_patch_only) + rapids_cpm_generate_patch_command( + ${package_name} + ${_rapids_version} + patch_command + build_patch_only + ) # The find info is the input unparsed args plus `build_patch_only` set(_rapids_find_content ${_RAPIDS_UNPARSED_ARGUMENTS} ${build_patch_only}) @@ -57,8 +76,13 @@ function(rapids_cpm_package_info package_name) set(_rapids_cpm_content "GIT_REPOSITORY" "${_rapids_url}" "GIT_TAG" "${_rapids_tag}") if(NOT _RAPIDS_FOR_FETCH_CONTENT) - list(APPEND _rapids_cpm_content "GIT_SHALLOW" "${_rapids_shallow}" "EXCLUDE_FROM_ALL" - "${_rapids_exclude_from_all}") + list( + APPEND _rapids_cpm_content + "GIT_SHALLOW" + "${_rapids_shallow}" + "EXCLUDE_FROM_ALL" + "${_rapids_exclude_from_all}" + ) endif() if(patch_command) list(APPEND _rapids_cpm_content "${patch_command}") @@ -91,5 +115,4 @@ function(rapids_cpm_package_info package_name) set(rapids_cmake_always_download ${rapids_cmake_always_download} PARENT_SCOPE) set(CPM_DOWNLOAD_ALL ${CPM_DOWNLOAD_ALL} PARENT_SCOPE) endif() - endfunction() diff --git a/rapids-cmake/cpm/detail/pinning_write_file.cmake b/rapids-cmake/cpm/detail/pinning_write_file.cmake index 847f9670..814e3d9c 100644 --- a/rapids-cmake/cpm/detail/pinning_write_file.cmake +++ b/rapids-cmake/cpm/detail/pinning_write_file.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -40,22 +40,25 @@ function(rapids_cpm_pinning_extract_source_git_info package git_url_var git_sha_ set(_RAPIDS_URL) set(_RAPIDS_SHA) if(EXISTS "${source_dir}") - execute_process(COMMAND ${GIT_EXECUTABLE} ls-remote --get-url - WORKING_DIRECTORY ${source_dir} - ERROR_QUIET - OUTPUT_VARIABLE _RAPIDS_URL - OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process( + COMMAND ${GIT_EXECUTABLE} ls-remote --get-url + WORKING_DIRECTORY ${source_dir} + ERROR_QUIET + OUTPUT_VARIABLE _RAPIDS_URL + OUTPUT_STRIP_TRAILING_WHITESPACE + ) # Need to handle when we have applied N patch sets to the git repo and therefore the latest # commit is just local # # Find all commits on our branch back to the common parent ( what we cloned ) # - execute_process(COMMAND ${GIT_EXECUTABLE} show-branch --current --sha1-name - ${_RAPIDS_REQUESTED_GIT_TAG} - WORKING_DIRECTORY ${source_dir} - ERROR_QUIET - OUTPUT_VARIABLE _rapids_commit_stack - OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process( + COMMAND ${GIT_EXECUTABLE} show-branch --current --sha1-name ${_RAPIDS_REQUESTED_GIT_TAG} + WORKING_DIRECTORY ${source_dir} + ERROR_QUIET + OUTPUT_VARIABLE _rapids_commit_stack + OUTPUT_STRIP_TRAILING_WHITESPACE + ) # The last entry in the output that has "* [" is our commit # # Find that line and convert the `* [short-sha1] Commit Message` to a list that is ` * @@ -71,11 +74,13 @@ function(rapids_cpm_pinning_extract_source_git_info package git_url_var git_sha_ endif() # Convert from the short sha1 ( could be keyword `HEAD` ) to a full SHA1 - execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse ${short_sha} - WORKING_DIRECTORY ${source_dir} - ERROR_QUIET - OUTPUT_VARIABLE _RAPIDS_SHA - OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process( + COMMAND ${GIT_EXECUTABLE} rev-parse ${short_sha} + WORKING_DIRECTORY ${source_dir} + ERROR_QUIET + OUTPUT_VARIABLE _RAPIDS_SHA + OUTPUT_STRIP_TRAILING_WHITESPACE + ) endif() # Only set the provided variables if we extracted the information if(_RAPIDS_URL) @@ -84,7 +89,6 @@ function(rapids_cpm_pinning_extract_source_git_info package git_url_var git_sha_ if(_RAPIDS_SHA) set(${git_sha_var} "${_RAPIDS_SHA}" PARENT_SCOPE) endif() - endfunction() #[=======================================================================[.rst: @@ -122,8 +126,11 @@ function(rapids_cpm_pinning_extract_source_subdir package_name source_subdir_var if(NOT DEFINED relative_subdir) FetchContent_GetProperties(${package_name} SOURCE_DIR stored_src_dir) if(DEFINED stored_src_dir AND NOT stored_src_dir STREQUAL ${package_name}_SOURCE_DIR) - cmake_path(RELATIVE_PATH stored_src_dir BASE_DIRECTORY "${${package_name}_SOURCE_DIR}" - OUTPUT_VARIABLE relative_subdir) + cmake_path( + RELATIVE_PATH stored_src_dir + BASE_DIRECTORY "${${package_name}_SOURCE_DIR}" + OUTPUT_VARIABLE relative_subdir + ) endif() endif() @@ -149,14 +156,12 @@ Parameters: #]=======================================================================] # cmake-lint: disable=E1120 function(rapids_cpm_pinning_transform_patches package_name patches_array_var output_var) - include("${rapids-cmake-dir}/cpm/detail/convert_patch_json.cmake") # We need to get the `files` key and transform it set(json_data "${${patches_array_var}}") string(JSON patch_count LENGTH "${json_data}") if(patch_count GREATER_EQUAL 1) - # Setup state so that we can eval `current_json_dir` placeholder string(TOLOWER "${package_name}" normalized_pkg_name) get_property(json_path GLOBAL PROPERTY rapids_cpm_${normalized_pkg_name}_override_json_file) @@ -182,8 +187,13 @@ function(rapids_cpm_pinning_transform_patches package_name patches_array_var out # Remove the the file entry and replace it with the correct inline json format string(JSON patch_data ERROR_VARIABLE have_error REMOVE "${patch_data}" file) set(json_key "inline_patch") - string(JSON patch_data ERROR_VARIABLE have_error SET "${patch_data}" "${json_key}" - "${as_json}") + string( + JSON patch_data + ERROR_VARIABLE have_error + SET "${patch_data}" + "${json_key}" + "${as_json}" + ) string(JSON json_data SET "${json_data}" ${index} "${patch_data}") endif() endforeach() @@ -216,7 +226,6 @@ Parameters: #]=======================================================================] function(rapids_cpm_pinning_create_and_set_member package_name json_var key value) - if(key MATCHES "patches") # Transform inplace the value to only have inline patches rapids_cpm_pinning_transform_patches(${package_name} value value) @@ -260,7 +269,6 @@ Parameters: #]=======================================================================] # cmake-lint: disable=R0915,E1120 function(rapids_cpm_pinning_add_json_entry package_name json_var) - # Make sure variables from the callers scope doesn't break us unset(git_url) unset(git_sha) @@ -293,7 +301,9 @@ function(rapids_cpm_pinning_add_json_entry package_name json_var) string(CONFIGURE [=["source_subdir": "${source_subdir}",]=] subdir_string) endif() # We start with a default template, and only add members that don't exist - string(CONFIGURE [=[{ + string( + CONFIGURE + [=[{ "version": "${CPM_PACKAGE_${package_name}_VERSION}", ${url_string} ${sha_string} @@ -301,7 +311,8 @@ function(rapids_cpm_pinning_add_json_entry package_name json_var) "git_shallow": false, "always_download": true }]=] - pinned_json_entry) + pinned_json_entry + ) set(override_exclusion_list "") set(json_exclusion_list "") @@ -327,8 +338,12 @@ function(rapids_cpm_pinning_add_json_entry package_name json_var) string(JSON existing_value ERROR_VARIABLE dont_have GET "${pinned_json_entry}" ${member}) if(dont_have AND (NOT member IN_LIST exclusions)) string(JSON value GET "${data}" ${member}) - rapids_cpm_pinning_create_and_set_member(${package_name} pinned_json_entry ${member} - ${value}) + rapids_cpm_pinning_create_and_set_member( + ${package_name} + pinned_json_entry + ${member} + ${value} + ) endif() endforeach() endforeach() @@ -349,15 +364,16 @@ This pinned versions.json file will be written to all output files provided to :cmake:command:`rapids_cpm_generate_pinned_versions`. #]=======================================================================] function(rapids_cpm_pinning_write_file) - find_package(Git QUIET REQUIRED) - set(_rapids_json - [=[ + set( + _rapids_json + [=[ { "root": { "packages": { -]=]) +]=] + ) # initial pass to remove any packages that aren't checked out by source or an existing json entry. # @@ -395,11 +411,17 @@ function(rapids_cpm_pinning_write_file) endif() rapids_cpm_pinning_add_json_entry(${package} _rapids_entry) if(not_last_package) - string(APPEND _rapids_entry [=[, -]=]) + string( + APPEND _rapids_entry + [=[, +]=] + ) else() - string(APPEND _rapids_entry [=[ -]=]) + string( + APPEND _rapids_entry + [=[ +]=] + ) endif() string(APPEND _rapids_json "${_rapids_entry}") endforeach() @@ -419,11 +441,14 @@ function(rapids_cpm_pinning_write_file) # Setup status string to developer. set(message_extra_info) if(ignored_packages) - set(message_extra_info - "The following packages resolved to system installed versions: ${ignored_packages}. If you need those pinned to an explicit version please set `CPM_DOWNLOAD_ALL` and re-generate." + set( + message_extra_info + "The following packages resolved to system installed versions: ${ignored_packages}. If you need those pinned to an explicit version please set `CPM_DOWNLOAD_ALL` and re-generate." ) endif() - message(STATUS "rapids_cpm_generate_pinned_versions wrote version information. ${message_extra_info}" + message( + STATUS + "rapids_cpm_generate_pinned_versions wrote version information. ${message_extra_info}" ) endfunction() diff --git a/rapids-cmake/cpm/find.cmake b/rapids-cmake/cpm/find.cmake index 1a3cfa16..cec75602 100644 --- a/rapids-cmake/cpm/find.cmake +++ b/rapids-cmake/cpm/find.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2020-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -174,8 +174,11 @@ function(rapids_cpm_find name version) if(_RAPIDS_COMPONENTS) # We need to pass the set of components as a space separated string and not a list string(REPLACE ";" " " _RAPIDS_COMPONENTS "${_RAPIDS_COMPONENTS}") - list(APPEND _RAPIDS_UNPARSED_ARGUMENTS "FIND_PACKAGE_ARGUMENTS" - "COMPONENTS ${_RAPIDS_COMPONENTS}") + list( + APPEND _RAPIDS_UNPARSED_ARGUMENTS + "FIND_PACKAGE_ARGUMENTS" + "COMPONENTS ${_RAPIDS_COMPONENTS}" + ) endif() if(_RAPIDS_SOURCE_SUBDIR) @@ -189,13 +192,15 @@ function(rapids_cpm_find name version) if(package_needs_to_be_added) # Any non-build patch command triggers CPMAddPackage. if(CPM_${name}_SOURCE OR has_non_build_patch) - message(DEBUG - "rapids.cpm.rapids_find: CPMAddPackage(NAME ${name} VERSION ${version} ${_RAPIDS_UNPARSED_ARGUMENTS})" + message( + DEBUG + "rapids.cpm.rapids_find: CPMAddPackage(NAME ${name} VERSION ${version} ${_RAPIDS_UNPARSED_ARGUMENTS})" ) CPMAddPackage(NAME ${name} VERSION ${version} ${_RAPIDS_UNPARSED_ARGUMENTS}) else() - message(DEBUG - "rapids.cpm.rapids_find CPMFindPackage(NAME ${name} VERSION ${version} ${_RAPIDS_UNPARSED_ARGUMENTS})" + message( + DEBUG + "rapids.cpm.rapids_find CPMFindPackage(NAME ${name} VERSION ${version} ${_RAPIDS_UNPARSED_ARGUMENTS})" ) CPMFindPackage(NAME ${name} VERSION ${version} ${_RAPIDS_UNPARSED_ARGUMENTS}) endif() @@ -217,9 +222,12 @@ 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} - ${_rapids_extra_info}) + rapids_export_cpm( + BUILD + ${name} + ${_RAPIDS_BUILD_EXPORT_SET} + CPM_ARGS NAME ${name} VERSION ${version} ${_RAPIDS_UNPARSED_ARGUMENTS} ${_rapids_extra_info} + ) endif() if(_RAPIDS_INSTALL_EXPORT_SET) @@ -228,13 +236,17 @@ function(rapids_cpm_find name version) if(_RAPIDS_COMPONENTS) list(APPEND _rapids_extra_info "COMPONENTS" ${_RAPIDS_COMPONENTS}) endif() - rapids_export_package(INSTALL ${name} ${_RAPIDS_INSTALL_EXPORT_SET} VERSION ${version} - ${_rapids_extra_info}) + rapids_export_package( + INSTALL + ${name} + ${_RAPIDS_INSTALL_EXPORT_SET} + VERSION ${version} + ${_rapids_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/gbench.cmake b/rapids-cmake/cpm/gbench.cmake index e80bb284..8f1f2bb8 100644 --- a/rapids-cmake/cpm/gbench.cmake +++ b/rapids-cmake/cpm/gbench.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -55,19 +55,33 @@ function(rapids_cpm_gbench) endif() include("${rapids-cmake-dir}/cpm/detail/package_info.cmake") - rapids_cpm_package_info(benchmark ${ARGN} VERSION_VAR version FIND_VAR find_args CPM_VAR - cpm_find_info TO_INSTALL_VAR to_install) + rapids_cpm_package_info( + benchmark + ${ARGN} + VERSION_VAR version + FIND_VAR find_args + CPM_VAR cpm_find_info + TO_INSTALL_VAR to_install + ) include("${rapids-cmake-dir}/cmake/install_lib_dir.cmake") rapids_cmake_install_lib_dir(lib_dir) include("${rapids-cmake-dir}/cpm/find.cmake") - rapids_cpm_find(benchmark ${version} ${find_args} - GLOBAL_TARGETS benchmark::benchmark benchmark::benchmark_main - CPM_ARGS ${cpm_find_info} - OPTIONS "BENCHMARK_ENABLE_GTEST_TESTS OFF" "BENCHMARK_ENABLE_TESTING OFF" - "BENCHMARK_ENABLE_INSTALL ${to_install}" - "CMAKE_INSTALL_LIBDIR ${lib_dir}" "BUILD_SHARED_LIBS ${build_shared}") + rapids_cpm_find( + benchmark + ${version} + ${find_args} + GLOBAL_TARGETS benchmark::benchmark benchmark::benchmark_main + CPM_ARGS + ${cpm_find_info} + OPTIONS + "BENCHMARK_ENABLE_GTEST_TESTS OFF" + "BENCHMARK_ENABLE_TESTING OFF" + "BENCHMARK_ENABLE_INSTALL ${to_install}" + "CMAKE_INSTALL_LIBDIR ${lib_dir}" + "BUILD_SHARED_LIBS ${build_shared}" + ) include("${rapids-cmake-dir}/cpm/detail/display_patch_status.cmake") rapids_cpm_display_patch_status(benchmark) diff --git a/rapids-cmake/cpm/generate_pinned_versions.cmake b/rapids-cmake/cpm/generate_pinned_versions.cmake index 3cb6e6da..2c8890dd 100644 --- a/rapids-cmake/cpm/generate_pinned_versions.cmake +++ b/rapids-cmake/cpm/generate_pinned_versions.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -69,8 +69,13 @@ function(rapids_cpm_generate_pinned_versions) set(_rapids_options) set(_rapids_one_value OUTPUT) set(_rapids_multi_value) - cmake_parse_arguments(_RAPIDS "${_rapids_options}" "${_rapids_one_value}" - "${_rapids_multi_value}" ${ARGN}) + cmake_parse_arguments( + _RAPIDS + "${_rapids_options}" + "${_rapids_one_value}" + "${_rapids_multi_value}" + ${ARGN} + ) if(NOT _RAPIDS_OUTPUT) message(FATAL_ERROR "rapids_cpm_generate_pinned_versions requires an `OUTPUT` argument") @@ -90,9 +95,11 @@ function(rapids_cpm_generate_pinned_versions) # execution so we get all CPM packages added. Plus we can compute the paths once, and write out # `N` times if needed set(root_dir "${${CMAKE_PROJECT_NAME}_SOURCE_DIR}") - cmake_language(DEFER DIRECTORY ${root_dir} ID rapids_cpm_generate_pinned_versions CALL include - "${rapids-cmake-dir}/cpm/detail/pinning_root_dir_hook.cmake") + cmake_language( + DEFER DIRECTORY ${root_dir} ID rapids_cpm_generate_pinned_versions + CALL include + "${rapids-cmake-dir}/cpm/detail/pinning_root_dir_hook.cmake" + ) set_property(GLOBAL PROPERTY rapids_cpm_generate_pin_hook "ON") endif() - endfunction() diff --git a/rapids-cmake/cpm/gtest.cmake b/rapids-cmake/cpm/gtest.cmake index 9205bc3d..7c840b9d 100644 --- a/rapids-cmake/cpm/gtest.cmake +++ b/rapids-cmake/cpm/gtest.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -56,15 +56,29 @@ function(rapids_cpm_gtest) endif() include("${rapids-cmake-dir}/cpm/detail/package_info.cmake") - rapids_cpm_package_info(GTest ${ARGN} VERSION_VAR version FIND_VAR find_args CPM_VAR - cpm_find_info TO_INSTALL_VAR to_install) + rapids_cpm_package_info( + GTest + ${ARGN} + VERSION_VAR version + FIND_VAR find_args + CPM_VAR cpm_find_info + TO_INSTALL_VAR to_install + ) include("${rapids-cmake-dir}/cpm/find.cmake") - rapids_cpm_find(GTest ${version} ${find_args} - GLOBAL_TARGETS GTest::gtest GTest::gmock GTest::gtest_main GTest::gmock_main - CPM_ARGS FIND_PACKAGE_ARGUMENTS "EXACT" ${cpm_find_info} - OPTIONS "INSTALL_GTEST ${to_install}" "CMAKE_POSITION_INDEPENDENT_CODE ON" - "BUILD_SHARED_LIBS ${build_shared}") + rapids_cpm_find( + GTest + ${version} + ${find_args} + GLOBAL_TARGETS GTest::gtest GTest::gmock GTest::gtest_main GTest::gmock_main + CPM_ARGS + FIND_PACKAGE_ARGUMENTS "EXACT" + ${cpm_find_info} + OPTIONS + "INSTALL_GTEST ${to_install}" + "CMAKE_POSITION_INDEPENDENT_CODE ON" + "BUILD_SHARED_LIBS ${build_shared}" + ) include("${rapids-cmake-dir}/cpm/detail/display_patch_status.cmake") rapids_cpm_display_patch_status(GTest) @@ -76,8 +90,11 @@ function(rapids_cpm_gtest) set(GTest_VERSION ${version} PARENT_SCOPE) if(TARGET GTest::gtest AND NOT TARGET GTest::gmock) - message(WARNING "The GTest package found doesn't provide gmock. If you run into 'GTest::gmock target not found' issues you need to use a different version of GTest.The easiest way is to request building GTest from source by adding the following to the cmake invocation: - '-DCPM_DOWNLOAD_GTest=ON'") + message( + WARNING + "The GTest package found doesn't provide gmock. If you run into 'GTest::gmock target not found' issues you need to use a different version of GTest.The easiest way is to request building GTest from source by adding the following to the cmake invocation: + '-DCPM_DOWNLOAD_GTest=ON'" + ) endif() if(NOT TARGET GTest::gtest AND TARGET gtest) diff --git a/rapids-cmake/cpm/init.cmake b/rapids-cmake/cpm/init.cmake index 50a9a35a..fa92e731 100644 --- a/rapids-cmake/cpm/init.cmake +++ b/rapids-cmake/cpm/init.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -99,8 +99,13 @@ function(rapids_cpm_init) set(_rapids_options GENERATE_PINNED_VERSIONS) set(_rapids_one_value CUSTOM_DEFAULT_VERSION_FILE OVERRIDE) set(_rapids_multi_value) - cmake_parse_arguments(_RAPIDS "${_rapids_options}" "${_rapids_one_value}" - "${_rapids_multi_value}" ${ARGN}) + cmake_parse_arguments( + _RAPIDS + "${_rapids_options}" + "${_rapids_one_value}" + "${_rapids_multi_value}" + ${ARGN} + ) include("${rapids-cmake-dir}/cpm/detail/load_preset_versions.cmake") @@ -121,7 +126,8 @@ function(rapids_cpm_init) if(_RAPIDS_GENERATE_PINNED_VERSIONS) include("${rapids-cmake-dir}/cpm/generate_pinned_versions.cmake") rapids_cpm_generate_pinned_versions( - OUTPUT "${CMAKE_BINARY_DIR}/rapids-cmake/pinned_versions.json") + OUTPUT "${CMAKE_BINARY_DIR}/rapids-cmake/pinned_versions.json" + ) endif() if(DEFINED RAPIDS_CMAKE_CPM_PINNED_VERSIONS_FILE) diff --git a/rapids-cmake/cpm/nvbench.cmake b/rapids-cmake/cpm/nvbench.cmake index 37392d61..db9de9f7 100644 --- a/rapids-cmake/cpm/nvbench.cmake +++ b/rapids-cmake/cpm/nvbench.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -63,8 +63,14 @@ function(rapids_cpm_nvbench) endif() include("${rapids-cmake-dir}/cpm/detail/package_info.cmake") - rapids_cpm_package_info(nvbench ${ARGN} VERSION_VAR version FIND_VAR find_args CPM_VAR - cpm_find_info TO_INSTALL_VAR to_install) + rapids_cpm_package_info( + nvbench + ${ARGN} + VERSION_VAR version + FIND_VAR find_args + CPM_VAR cpm_find_info + TO_INSTALL_VAR to_install + ) # CUDA::nvml is an optional package and might not be installed ( aka conda ) find_package(CUDAToolkit REQUIRED) @@ -74,15 +80,21 @@ function(rapids_cpm_nvbench) endif() include("${rapids-cmake-dir}/cpm/find.cmake") - rapids_cpm_find(nvbench ${version} ${find_args} - GLOBAL_TARGETS nvbench::nvbench nvbench::main - CPM_ARGS ${cpm_find_info} - OPTIONS "NVBench_ENABLE_NVML ${nvbench_with_nvml}" - "NVBench_ENABLE_CUPTI OFF" - "NVBench_ENABLE_EXAMPLES OFF" - "NVBench_ENABLE_TESTING OFF" - "NVBench_ENABLE_INSTALL_RULES ${to_install}" - "BUILD_SHARED_LIBS ${build_shared}") + rapids_cpm_find( + nvbench + ${version} + ${find_args} + GLOBAL_TARGETS nvbench::nvbench nvbench::main + CPM_ARGS + ${cpm_find_info} + OPTIONS + "NVBench_ENABLE_NVML ${nvbench_with_nvml}" + "NVBench_ENABLE_CUPTI OFF" + "NVBench_ENABLE_EXAMPLES OFF" + "NVBench_ENABLE_TESTING OFF" + "NVBench_ENABLE_INSTALL_RULES ${to_install}" + "BUILD_SHARED_LIBS ${build_shared}" + ) include("${rapids-cmake-dir}/cpm/detail/display_patch_status.cmake") rapids_cpm_display_patch_status(nvbench) diff --git a/rapids-cmake/cpm/nvcomp.cmake b/rapids-cmake/cpm/nvcomp.cmake index 4c34d826..8abcb3c9 100644 --- a/rapids-cmake/cpm/nvcomp.cmake +++ b/rapids-cmake/cpm/nvcomp.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -68,14 +68,25 @@ function(rapids_cpm_nvcomp) cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) include("${rapids-cmake-dir}/cpm/detail/package_info.cmake") - rapids_cpm_package_info(nvcomp ${_RAPIDS_UNPARSED_ARGUMENTS} VERSION_VAR version FIND_VAR - find_args CPM_VAR cpm_find_info TO_INSTALL_VAR to_install) + rapids_cpm_package_info( + nvcomp + ${_RAPIDS_UNPARSED_ARGUMENTS} + VERSION_VAR version + FIND_VAR find_args + CPM_VAR cpm_find_info + TO_INSTALL_VAR to_install + ) # first search locally if `rapids_cmake_always_download` is false if(NOT rapids_cmake_always_download) include("${rapids-cmake-dir}/find/package.cmake") - rapids_find_package(nvcomp ${version} GLOBAL_TARGETS nvcomp::nvcomp ${_RAPIDS_EXPORT_ARGUMENTS} - FIND_ARGS QUIET) + rapids_find_package( + nvcomp + ${version} + GLOBAL_TARGETS nvcomp::nvcomp ${_RAPIDS_EXPORT_ARGUMENTS} + FIND_ARGS + QUIET + ) if(nvcomp_FOUND) # report where nvcomp was found message(STATUS "Found nvcomp: ${nvcomp_DIR} (found version ${nvcomp_VERSION})") @@ -104,7 +115,9 @@ function(rapids_cpm_nvcomp) cmake_path(GET lib_dir PARENT_PATH lib_dir_parent) cmake_path(GET CMAKE_INSTALL_INCLUDEDIR PARENT_PATH include_dir_parent) if(NOT lib_dir_parent STREQUAL include_dir_parent) - message(FATAL_ERROR "CMAKE_INSTALL_INCLUDEDIR and CMAKE_INSTALL_LIBDIR must share parent directory" + message( + FATAL_ERROR + "CMAKE_INSTALL_INCLUDEDIR and CMAKE_INSTALL_LIBDIR must share parent directory" ) endif() @@ -112,19 +125,26 @@ function(rapids_cpm_nvcomp) # nvcomp-release-targets.cmake. Guarded in an EXISTS check so we only try to do this on the # first configuration pass cmake_path(GET lib_dir FILENAME lib_dir_name) - set(nvcomp_list_of_target_files - "nvcomp-targets-common-release.cmake" - "nvcomp-targets-common.cmake" - "nvcomp-targets-dynamic-release.cmake" - "nvcomp-targets-dynamic.cmake" - "nvcomp-targets-release.cmake" - "nvcomp-targets-static-release.cmake" - "nvcomp-targets-static.cmake") + set( + nvcomp_list_of_target_files + "nvcomp-targets-common-release.cmake" + "nvcomp-targets-common.cmake" + "nvcomp-targets-dynamic-release.cmake" + "nvcomp-targets-dynamic.cmake" + "nvcomp-targets-release.cmake" + "nvcomp-targets-static-release.cmake" + "nvcomp-targets-static.cmake" + ) foreach(filename IN LISTS nvcomp_list_of_target_files) if(EXISTS "${nvcomp_ROOT}/lib/cmake/nvcomp/${filename}") file(READ "${nvcomp_ROOT}/lib/cmake/nvcomp/${filename}" FILE_CONTENTS) - string(REPLACE "\$\{_IMPORT_PREFIX\}/lib/" "\$\{_IMPORT_PREFIX\}/${lib_dir_name}/" - FILE_CONTENTS ${FILE_CONTENTS}) + string( + REPLACE + "\$\{_IMPORT_PREFIX\}/lib/" + "\$\{_IMPORT_PREFIX\}/${lib_dir_name}/" + FILE_CONTENTS + ${FILE_CONTENTS} + ) file(WRITE "${nvcomp_ROOT}/lib/cmake/nvcomp/${filename}" ${FILE_CONTENTS}) endif() endforeach() @@ -138,8 +158,12 @@ function(rapids_cpm_nvcomp) # nvcomp_DIR value set(nvcomp_proprietary_root "${nvcomp_ROOT}") cmake_path(NORMAL_PATH nvcomp_proprietary_root) - set(rapids_cpm_nvcomp_proprietary_root "${nvcomp_proprietary_root}" - CACHE INTERNAL "nvcomp proprietary root dir location") + set( + rapids_cpm_nvcomp_proprietary_root + "${nvcomp_proprietary_root}" + CACHE INTERNAL + "nvcomp proprietary root dir location" + ) # Enforce that we need to find the local download of nvcomp and nothing else when we have a # proprietary binary enabled. @@ -158,16 +182,28 @@ function(rapids_cpm_nvcomp) endif() include("${rapids-cmake-dir}/cpm/find.cmake") - rapids_cpm_find(nvcomp ${version} ${find_args} GLOBAL_TARGETS nvcomp::nvcomp - CPM_ARGS ${cpm_find_info} OPTIONS "BUILD_STATIC ON" "BUILD_TESTS OFF" - "BUILD_BENCHMARKS OFF" "BUILD_EXAMPLES OFF") + rapids_cpm_find( + nvcomp + ${version} + ${find_args} + GLOBAL_TARGETS nvcomp::nvcomp + CPM_ARGS + ${cpm_find_info} + OPTIONS "BUILD_STATIC ON" "BUILD_TESTS OFF" "BUILD_BENCHMARKS OFF" "BUILD_EXAMPLES OFF" + ) include("${rapids-cmake-dir}/cpm/detail/display_patch_status.cmake") rapids_cpm_display_patch_status(nvcomp) # provide consistent targets between a found nvcomp and one building from source - set(nvcomp_possible_target_names nvcomp nvcomp_cpu nvcomp_cpu_static nvcomp_device_static - nvcomp_static) + set( + nvcomp_possible_target_names + nvcomp + nvcomp_cpu + nvcomp_cpu_static + nvcomp_device_static + nvcomp_static + ) foreach(name IN LISTS nvcomp_possible_target_names) if(NOT TARGET nvcomp::${name} AND TARGET ${name}) add_library(nvcomp::${name} ALIAS ${name}) @@ -189,8 +225,10 @@ function(rapids_cpm_nvcomp) include(GNUInstallDirs) install(DIRECTORY "${nvcomp_ROOT}/${lib_dir}/" DESTINATION "${lib_dir}") - install(DIRECTORY "${nvcomp_ROOT}/${CMAKE_INSTALL_INCLUDEDIR}/" - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") + install( + DIRECTORY "${nvcomp_ROOT}/${CMAKE_INSTALL_INCLUDEDIR}/" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + ) # place the license information in the location that conda uses install(FILES "${nvcomp_ROOT}/NOTICE" DESTINATION info/ RENAME NVCOMP_NOTICE) install(FILES "${nvcomp_ROOT}/LICENSE" DESTINATION info/ RENAME NVCOMP_LICENSE) @@ -198,8 +236,11 @@ function(rapids_cpm_nvcomp) # point our consumers to where they can find the pre-built version include("${rapids-cmake-dir}/export/find_package_root.cmake") - rapids_export_find_package_root(BUILD nvcomp "${nvcomp_ROOT}" - EXPORT_SET ${_RAPIDS_BUILD_EXPORT_SET} - CONDITION nvcomp_proprietary_binary) - + rapids_export_find_package_root( + BUILD + nvcomp + "${nvcomp_ROOT}" + EXPORT_SET ${_RAPIDS_BUILD_EXPORT_SET} + CONDITION nvcomp_proprietary_binary + ) endfunction() diff --git a/rapids-cmake/cpm/nvtx3.cmake b/rapids-cmake/cpm/nvtx3.cmake index 96bbb3cc..f34dd0be 100644 --- a/rapids-cmake/cpm/nvtx3.cmake +++ b/rapids-cmake/cpm/nvtx3.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -43,15 +43,23 @@ function(rapids_cpm_nvtx3) list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.cpm.nvtx3") include("${rapids-cmake-dir}/cpm/detail/package_info.cmake") - rapids_cpm_package_info(nvtx3 ${ARGN} VERSION_VAR version FIND_VAR find_args CPM_VAR - cpm_find_info TO_INSTALL_VAR to_install) + rapids_cpm_package_info( + nvtx3 + ${ARGN} + VERSION_VAR version + FIND_VAR find_args + CPM_VAR cpm_find_info + TO_INSTALL_VAR to_install + ) include("${rapids-cmake-dir}/cpm/find.cmake") - rapids_cpm_find(nvtx3 ${version} ${find_args} - GLOBAL_TARGETS nvtx3-c nvtx3-cpp - CPM_ARGS ${cpm_find_info} - EXCLUDE_FROM_ALL ${exclude} - OPTIONS "NVTX3_INSTALL ON") + rapids_cpm_find( + nvtx3 + ${version} + ${find_args} + GLOBAL_TARGETS nvtx3-c nvtx3-cpp + CPM_ARGS ${cpm_find_info} EXCLUDE_FROM_ALL ${exclude} OPTIONS "NVTX3_INSTALL ON" + ) include("${rapids-cmake-dir}/cpm/detail/display_patch_status.cmake") rapids_cpm_display_patch_status(nvtx3) @@ -61,5 +69,4 @@ function(rapids_cpm_nvtx3) set(nvtx3_BINARY_DIR "${nvtx3_BINARY_DIR}" PARENT_SCOPE) set(nvtx3_ADDED "${nvtx3_ADDED}" PARENT_SCOPE) set(nvtx3_VERSION ${version} PARENT_SCOPE) - endfunction() diff --git a/rapids-cmake/cpm/package_override.cmake b/rapids-cmake/cpm/package_override.cmake index fa6b012d..3d6152ef 100644 --- a/rapids-cmake/cpm/package_override.cmake +++ b/rapids-cmake/cpm/package_override.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -68,7 +68,9 @@ function(rapids_cpm_package_override _rapids_override_filepath) list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.cpm.rapids_cpm_package_override") if(NOT EXISTS "${_rapids_override_filepath}") - message(FATAL_ERROR "rapids_cpm_package_override can't load '${_rapids_override_filepath}', verify it exists" + message( + FATAL_ERROR + "rapids_cpm_package_override can't load '${_rapids_override_filepath}', verify it exists" ) endif() file(READ "${_rapids_override_filepath}" json_data) @@ -84,8 +86,12 @@ function(rapids_cpm_package_override _rapids_override_filepath) foreach(index RANGE ${package_count}) string(JSON package_name MEMBER "${json_data}" packages ${index}) string(TOLOWER "${package_name}" normalized_pkg_name) - get_property(override_exists GLOBAL PROPERTY rapids_cpm_${normalized_pkg_name}_override_json - SET) + get_property( + override_exists + GLOBAL + PROPERTY rapids_cpm_${normalized_pkg_name}_override_json + SET + ) if(override_exists) # Early terminate if this project already has an override continue() @@ -93,10 +99,15 @@ function(rapids_cpm_package_override _rapids_override_filepath) # Warn if our name all lower case matches a default package, but our case sensitive names # doesn't ( ABC vs abc ) - get_property(package_proper_name GLOBAL - PROPERTY rapids_cpm_${normalized_pkg_name}_proper_name) + get_property( + package_proper_name + GLOBAL + PROPERTY rapids_cpm_${normalized_pkg_name}_proper_name + ) if(package_proper_name AND NOT package_proper_name STREQUAL package_name) - message(AUTHOR_WARNING "RAPIDS-CMake is assuming the override ${package_name} is meant for the ${package_proper_name} package. For correctness please use the correctly cased name" + message( + AUTHOR_WARNING + "RAPIDS-CMake is assuming the override ${package_name} is meant for the ${package_proper_name} package. For correctness please use the correctly cased name" ) endif() if(NOT package_proper_name) @@ -111,8 +122,10 @@ function(rapids_cpm_package_override _rapids_override_filepath) # even when not in use string(JSON data GET "${json_data}" packages "${package_name}") set_property(GLOBAL PROPERTY rapids_cpm_${normalized_pkg_name}_override_json "${data}") - set_property(GLOBAL PROPERTY rapids_cpm_${normalized_pkg_name}_override_json_file - "${_rapids_override_filepath}") + set_property( + GLOBAL + PROPERTY rapids_cpm_${normalized_pkg_name}_override_json_file "${_rapids_override_filepath}" + ) if(DEFINED CPM_${package_name}_SOURCE) set_property(GLOBAL PROPERTY rapids_cpm_${normalized_pkg_name}_override_ignored "ON") @@ -125,8 +138,9 @@ function(rapids_cpm_package_override _rapids_override_filepath) include("${rapids-cmake-dir}/cpm/detail/package_info.cmake") rapids_cpm_package_info(${package_name} FOR_FETCH_CONTENT CPM_VAR cpm_find_info) - message(DEBUG - "rapids.cpm.rapids_cpm_package_override: FetchContent_Declare(${package_proper_name} ${cpm_find_info}) " + message( + DEBUG + "rapids.cpm.rapids_cpm_package_override: FetchContent_Declare(${package_proper_name} ${cpm_find_info}) " ) FetchContent_Declare(${package_proper_name} ${cpm_find_info}) unset(package_proper_name) diff --git a/rapids-cmake/cpm/rapids_logger.cmake b/rapids-cmake/cpm/rapids_logger.cmake index 5a496898..fb3d0037 100644 --- a/rapids-cmake/cpm/rapids_logger.cmake +++ b/rapids-cmake/cpm/rapids_logger.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -35,15 +35,25 @@ function(rapids_cpm_rapids_logger) list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.cpm.rapids_logger") include("${rapids-cmake-dir}/cpm/detail/package_info.cmake") - rapids_cpm_package_info(rapids_logger ${ARGN} VERSION_VAR version FIND_VAR find_args CPM_VAR - cpm_find_info TO_INSTALL_VAR to_install) + rapids_cpm_package_info( + rapids_logger + ${ARGN} + VERSION_VAR version + FIND_VAR find_args + CPM_VAR cpm_find_info + TO_INSTALL_VAR to_install + ) include("${rapids-cmake-dir}/cpm/detail/generate_patch_command.cmake") rapids_cpm_generate_patch_command(rapids_logger ${version} patch_command build_patch_only) include("${rapids-cmake-dir}/cpm/find.cmake") - rapids_cpm_find(rapids_logger ${version} ${find_args} CPM_ARGS ${cpm_find_info} - OPTIONS "BUILD_TESTS OFF") + rapids_cpm_find( + rapids_logger + ${version} + ${find_args} + CPM_ARGS ${cpm_find_info} OPTIONS "BUILD_TESTS OFF" + ) include("${rapids-cmake-dir}/cpm/detail/display_patch_status.cmake") rapids_cpm_display_patch_status(logger) diff --git a/rapids-cmake/cpm/rmm.cmake b/rapids-cmake/cpm/rmm.cmake index 5f623965..49b427d6 100644 --- a/rapids-cmake/cpm/rmm.cmake +++ b/rapids-cmake/cpm/rmm.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -45,13 +45,23 @@ function(rapids_cpm_rmm) list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.cpm.rmm") include("${rapids-cmake-dir}/cpm/detail/package_info.cmake") - rapids_cpm_package_info(rmm ${ARGN} VERSION_VAR version FIND_VAR find_args CPM_VAR cpm_find_info - TO_INSTALL_VAR to_install) + rapids_cpm_package_info( + rmm + ${ARGN} + VERSION_VAR version + FIND_VAR find_args + CPM_VAR cpm_find_info + TO_INSTALL_VAR to_install + ) include("${rapids-cmake-dir}/cpm/find.cmake") - rapids_cpm_find(rmm ${version} ${find_args} GLOBAL_TARGETS rmm::rmm rmm::rmm_logger - rmm::rmm_logger_impl - CPM_ARGS ${cpm_find_info} OPTIONS "BUILD_TESTS OFF" "BUILD_BENCHMARKS OFF") + rapids_cpm_find( + rmm + ${version} + ${find_args} + GLOBAL_TARGETS rmm::rmm rmm::rmm_logger rmm::rmm_logger_impl + CPM_ARGS ${cpm_find_info} OPTIONS "BUILD_TESTS OFF" "BUILD_BENCHMARKS OFF" + ) include("${rapids-cmake-dir}/cpm/detail/display_patch_status.cmake") rapids_cpm_display_patch_status(rmm) diff --git a/rapids-cmake/cuda/detail/detect_architectures.cmake b/rapids-cmake/cuda/detail/detect_architectures.cmake index 6cd227f6..2d192763 100644 --- a/rapids-cmake/cuda/detail/detect_architectures.cmake +++ b/rapids-cmake/cuda/detail/detect_architectures.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -24,8 +24,9 @@ function(rapids_cuda_detect_architectures possible_archs_var gpu_archs) endif() if(NOT EXISTS "${eval_exe}") - file(WRITE ${eval_file} - " + file( + WRITE ${eval_file} + " #include #include #include @@ -61,19 +62,25 @@ int main(int argc, char** argv) printf(\"\\n\"); return 0; } - ") - execute_process(COMMAND ${CMAKE_CUDA_COMPILER} -std=c++17 -o "${eval_exe}" "${eval_file}" - ERROR_FILE "${error_file}") + " + ) + execute_process( + COMMAND ${CMAKE_CUDA_COMPILER} -std=c++17 -o "${eval_exe}" "${eval_file}" + ERROR_FILE "${error_file}" + ) endif() if(EXISTS "${eval_exe}") - execute_process(COMMAND "${eval_exe}" OUTPUT_VARIABLE __gpu_archs - OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_FILE "${error_file}") + execute_process( + COMMAND "${eval_exe}" + OUTPUT_VARIABLE __gpu_archs + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_FILE "${error_file}" + ) message(STATUS "Using auto detection of gpu-archs: ${__gpu_archs}") else() message(STATUS "Failed auto detection of gpu-archs. Falling back to using ${__gpu_archs}.") endif() set(${gpu_archs} ${__gpu_archs} PARENT_SCOPE) - endfunction() diff --git a/rapids-cmake/cuda/enable_fatbin_compression.cmake b/rapids-cmake/cuda/enable_fatbin_compression.cmake index dd6c14f5..f3d259e0 100644 --- a/rapids-cmake/cuda/enable_fatbin_compression.cmake +++ b/rapids-cmake/cuda/enable_fatbin_compression.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -71,8 +71,9 @@ function(rapids_cuda_enable_fatbin_compression) list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.cuda.enable_fatbin_compression") if(NOT CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA") - message(VERBOSE - "rapids_cuda_enable_fatbin_compression call ignored due to CUDA language not being enabled" + message( + VERBOSE + "rapids_cuda_enable_fatbin_compression call ignored due to CUDA language not being enabled" ) return() endif() @@ -83,7 +84,9 @@ function(rapids_cuda_enable_fatbin_compression) cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) if(NOT _RAPIDS_TARGET AND NOT _RAPIDS_VARIABLE) - message(FATAL_ERROR "rapids_cuda_enable_fatbin_compression requires either the `TARGET` or `VARIABLE` option be provided" + message( + FATAL_ERROR + "rapids_cuda_enable_fatbin_compression requires either the `TARGET` or `VARIABLE` option be provided" ) endif() @@ -91,8 +94,10 @@ function(rapids_cuda_enable_fatbin_compression) set(_rapids_cuda_flags "-Xfatbin=-compress-all") # CUDA 12.X logic - if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 12.0.0 AND CMAKE_CUDA_COMPILER_VERSION - VERSION_LESS 13.0.0) + if( + CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 12.0.0 + AND CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 13.0.0 + ) set(balanced_flag --compress-mode=balance) set(rapids_flag) set(runtime_perf_flag --compress-mode=speed) @@ -104,8 +109,10 @@ function(rapids_cuda_enable_fatbin_compression) endif() # CUDA 13.X logic - if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0.0 AND CMAKE_CUDA_COMPILER_VERSION - VERSION_LESS 14.0.0) + if( + CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0.0 + AND CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 14.0.0 + ) set(balanced_flag --compress-mode=balance) set(rapids_flag --compress-mode=size) set(runtime_perf_flag --compress-mode=speed) @@ -119,7 +126,9 @@ function(rapids_cuda_enable_fatbin_compression) # rapids flag variable can be empty list(APPEND _rapids_cuda_flags "${${_rapids_tune_for_lower}_flag}") else() - message(FATAL_ERROR "rapids_cuda_enable_fatbin_compression `TUNE_FOR` option was provided an unsupported value of ${_RAPIDS_TUNE_FOR}" + message( + FATAL_ERROR + "rapids_cuda_enable_fatbin_compression `TUNE_FOR` option was provided an unsupported value of ${_RAPIDS_TUNE_FOR}" ) endif() @@ -134,8 +143,10 @@ function(rapids_cuda_enable_fatbin_compression) add_library(${_RAPIDS_TARGET} INTERFACE) set(usage_requirement "INTERFACE") endif() - target_compile_options(${_RAPIDS_TARGET} ${usage_requirement} - "$<$:${_rapids_cuda_flags}>") + target_compile_options( + ${_RAPIDS_TARGET} + ${usage_requirement} + "$<$:${_rapids_cuda_flags}>" + ) endif() - endfunction() diff --git a/rapids-cmake/cuda/init_architectures.cmake b/rapids-cmake/cuda/init_architectures.cmake index f9b8594a..3e63ae13 100644 --- a/rapids-cmake/cuda/init_architectures.cmake +++ b/rapids-cmake/cuda/init_architectures.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -69,8 +69,10 @@ function(rapids_cuda_init_architectures project_name) if(CMAKE_CUDA_ARCHITECTURES STREQUAL "RAPIDS" OR CMAKE_CUDA_ARCHITECTURES STREQUAL "NATIVE") set(cuda_arch_mode "${CMAKE_CUDA_ARCHITECTURES}") endif() - elseif(DEFINED ENV{CUDAARCHS} AND ("$ENV{CUDAARCHS}" STREQUAL "RAPIDS" OR "$ENV{CUDAARCHS}" - STREQUAL "NATIVE")) + elseif( + DEFINED ENV{CUDAARCHS} + AND ("$ENV{CUDAARCHS}" STREQUAL "RAPIDS" OR "$ENV{CUDAARCHS}" STREQUAL "NATIVE") + ) set(cuda_arch_mode "$ENV{CUDAARCHS}") elseif(NOT (DEFINED ENV{CUDAARCHS} OR DEFINED CMAKE_CUDA_ARCHITECTURES)) set(cuda_arch_mode "RAPIDS") @@ -95,10 +97,12 @@ function(rapids_cuda_init_architectures project_name) # # 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() - endfunction() diff --git a/rapids-cmake/cuda/init_runtime.cmake b/rapids-cmake/cuda/init_runtime.cmake index a04db0e8..964e77a3 100644 --- a/rapids-cmake/cuda/init_runtime.cmake +++ b/rapids-cmake/cuda/init_runtime.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -50,5 +50,4 @@ function(rapids_cuda_init_runtime use_static value) set(CUDA_USE_STATIC_CUDA_RUNTIME OFF PARENT_SCOPE) endif() endif() - endfunction() diff --git a/rapids-cmake/cuda/set_architectures.cmake b/rapids-cmake/cuda/set_architectures.cmake index d2eeea5e..757830af 100644 --- a/rapids-cmake/cuda/set_architectures.cmake +++ b/rapids-cmake/cuda/set_architectures.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -48,14 +48,39 @@ function(rapids_cuda_set_architectures mode) list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.cuda.set_architectures") if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA") - if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0.0) - set(supported_archs "75-real" "80-real" "86-real" "90a-real" "100f-real" "120a-real" "120") + set( + supported_archs + "75-real" + "80-real" + "86-real" + "90a-real" + "100f-real" + "120a-real" + "120" + ) elseif(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 12.9.0) - set(supported_archs "70-real" "75-real" "80-real" "86-real" "90a-real" "100f-real" - "120a-real" "120") + set( + supported_archs + "70-real" + "75-real" + "80-real" + "86-real" + "90a-real" + "100f-real" + "120a-real" + "120" + ) else() - set(supported_archs "70-real" "75-real" "80-real" "86-real" "90a-real" "90-virtual") + set( + supported_archs + "70-real" + "75-real" + "80-real" + "86-real" + "90a-real" + "90-virtual" + ) if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 12.8.0) list(REMOVE_ITEM supported_archs "90-virtual") list(APPEND supported_archs "100-real" "120a-real" "120-virtual") @@ -64,8 +89,10 @@ function(rapids_cuda_set_architectures mode) # For the CUDA 12.X.0 series we want to silence warnings when compiling for arch 70 when # compiling for RAPIDS architectures. - if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 12.8.0 AND CMAKE_CUDA_COMPILER_VERSION - VERSION_LESS 13.0.0) + if( + CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 12.8.0 + AND CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 13.0.0 + ) string(APPEND CMAKE_CUDA_FLAGS " -Wno-deprecated-gpu-targets") endif() endif() @@ -84,7 +111,9 @@ function(rapids_cuda_set_architectures mode) endif() if(NOT cached_value STREQUAL CMAKE_CUDA_ARCHITECTURES) string(REPLACE ";" "\n " _cuda_architectures_pretty "${CMAKE_CUDA_ARCHITECTURES}") - message(STATUS "Project ${PROJECT_NAME} is building for CUDA architectures:\n ${_cuda_architectures_pretty}" + message( + STATUS + "Project ${PROJECT_NAME} is building for CUDA architectures:\n ${_cuda_architectures_pretty}" ) endif() @@ -96,5 +125,4 @@ function(rapids_cuda_set_architectures mode) # Set as a local variable to maintain comp set(CMAKE_CUDA_ARCHITECTURES ${CMAKE_CUDA_ARCHITECTURES} PARENT_SCOPE) set(CMAKE_CUDA_FLAGS ${CMAKE_CUDA_FLAGS} PARENT_SCOPE) - endfunction() diff --git a/rapids-cmake/cuda/set_runtime.cmake b/rapids-cmake/cuda/set_runtime.cmake index d063aaff..63b0f2e8 100644 --- a/rapids-cmake/cuda/set_runtime.cmake +++ b/rapids-cmake/cuda/set_runtime.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -59,5 +59,4 @@ function(rapids_cuda_set_runtime target use_static value) set_target_properties(${target} PROPERTIES CUDA_RUNTIME_LIBRARY Shared) target_link_libraries(${target} ${mode} $) endif() - endfunction() diff --git a/rapids-cmake/cython-core/create_modules.cmake b/rapids-cmake/cython-core/create_modules.cmake index bde5d18a..8c1d0bd4 100644 --- a/rapids-cmake/cython-core/create_modules.cmake +++ b/rapids-cmake/cython-core/create_modules.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -87,8 +87,13 @@ function(rapids_cython_create_modules) set(_rapids_cython_options CXX) set(_rapids_cython_one_value INSTALL_DIR MODULE_PREFIX COMPONENT) set(_rapids_cython_multi_value SOURCE_FILES LINKED_LIBRARIES ASSOCIATED_TARGETS) - cmake_parse_arguments(_RAPIDS_CYTHON "${_rapids_cython_options}" "${_rapids_cython_one_value}" - "${_rapids_cython_multi_value}" ${ARGN}) + cmake_parse_arguments( + _RAPIDS_CYTHON + "${_rapids_cython_options}" + "${_rapids_cython_one_value}" + "${_rapids_cython_multi_value}" + ${ARGN} + ) set(_ext ".c") set(_language_flag "") @@ -117,21 +122,33 @@ function(rapids_cython_create_modules) # Generate C++ from Cython and create a library for the resulting extension module to compile. # TODO: Probably want to generalize this to a helper function for invoking Cython. string(REPLACE " " ";" CYTHON_FLAGS_LIST "${CYTHON_FLAGS}") - add_custom_command(OUTPUT ${cpp_filename} - DEPENDS ${cython_filename} - VERBATIM - COMMAND "${CYTHON}" ARGS ${_language_flag} -3 ${CYTHON_FLAGS_LIST} - "${CMAKE_CURRENT_SOURCE_DIR}/${cython_filename}" --output-file - "${CMAKE_CURRENT_BINARY_DIR}/${cpp_filename}" --depfile - DEPFILE ${depfile} - COMMENT "Transpiling ${cython_filename} to ${cpp_filename}") + add_custom_command( + OUTPUT ${cpp_filename} + DEPENDS ${cython_filename} + VERBATIM + COMMAND "${CYTHON}" + ARGS + ${_language_flag} -3 ${CYTHON_FLAGS_LIST} "${CMAKE_CURRENT_SOURCE_DIR}/${cython_filename}" + --output-file "${CMAKE_CURRENT_BINARY_DIR}/${cpp_filename}" --depfile + DEPFILE ${depfile} + COMMENT "Transpiling ${cython_filename} to ${cpp_filename}" + ) if(NOT "${SKBUILD_SABI_VERSION}" STREQUAL "") - python_add_library(${cython_module} MODULE "${CMAKE_CURRENT_BINARY_DIR}/${cpp_filename}" - WITH_SOABI USE_SABI ${SKBUILD_SABI_VERSION}) + python_add_library( + ${cython_module} + MODULE + "${CMAKE_CURRENT_BINARY_DIR}/${cpp_filename}" + WITH_SOABI + USE_SABI ${SKBUILD_SABI_VERSION} + ) else() - python_add_library(${cython_module} MODULE "${CMAKE_CURRENT_BINARY_DIR}/${cpp_filename}" - WITH_SOABI) + python_add_library( + ${cython_module} + MODULE + "${CMAKE_CURRENT_BINARY_DIR}/${cpp_filename}" + WITH_SOABI + ) endif() # The final library name must match the original filename and must ignore the prefix. @@ -145,8 +162,11 @@ function(rapids_cython_create_modules) # Compute the install directory relative to the source and rely on installs being relative to # the CMAKE_PREFIX_PATH for e.g. editable installs. if(NOT DEFINED _RAPIDS_CYTHON_INSTALL_DIR) - cmake_path(RELATIVE_PATH CMAKE_CURRENT_SOURCE_DIR BASE_DIRECTORY "${PROJECT_SOURCE_DIR}" - OUTPUT_VARIABLE _RAPIDS_CYTHON_INSTALL_DIR) + cmake_path( + RELATIVE_PATH CMAKE_CURRENT_SOURCE_DIR + BASE_DIRECTORY "${PROJECT_SOURCE_DIR}" + OUTPUT_VARIABLE _RAPIDS_CYTHON_INSTALL_DIR + ) endif() set(component_arg) if(DEFINED _RAPIDS_CYTHON_COMPONENT) @@ -164,8 +184,11 @@ function(rapids_cython_create_modules) # Store any provided associated targets in a global list foreach(associated_target IN LISTS _RAPIDS_CYTHON_ASSOCIATED_TARGETS) - set_property(GLOBAL PROPERTY "rapids_cython_associations_${associated_target}" - "${cython_module}" APPEND) + set_property( + GLOBAL + PROPERTY "rapids_cython_associations_${associated_target}" "${cython_module}" + APPEND + ) endforeach() list(APPEND CREATED_TARGETS "${cython_module}") diff --git a/rapids-cmake/cython-core/find_prefix_paths.cmake b/rapids-cmake/cython-core/find_prefix_paths.cmake index e3df3606..f7f1b4d9 100644 --- a/rapids-cmake/cython-core/find_prefix_paths.cmake +++ b/rapids-cmake/cython-core/find_prefix_paths.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -29,8 +29,9 @@ Find all paths that should be added to CMAKE_PREFIX_PATH according to Python ent function(rapids_cython_find_prefix_paths python_executable paths_var) list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.cython.init") - set(_get_entry_points - [=[ + set( + _get_entry_points + [=[ import os from importlib.metadata import entry_points from importlib.resources import files @@ -45,11 +46,15 @@ for ep in entry_points(group="cmake.prefix"): paths.append(os.fspath(p)) print(";".join(paths)) -]=]) +]=] + ) # Execute the Python at configure time and capture output - execute_process(COMMAND ${python_executable} -c "${_get_entry_points}" OUTPUT_VARIABLE prefix_dirs - OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process( + COMMAND ${python_executable} -c "${_get_entry_points}" + OUTPUT_VARIABLE prefix_dirs + OUTPUT_STRIP_TRAILING_WHITESPACE + ) set(${paths_var} ${prefix_dirs} PARENT_SCOPE) diff --git a/rapids-cmake/cython-core/init.cmake b/rapids-cmake/cython-core/init.cmake index 8e224c5e..6a6dbca9 100644 --- a/rapids-cmake/cython-core/init.cmake +++ b/rapids-cmake/cython-core/init.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -35,16 +35,22 @@ macro(rapids_cython_init) if(NOT DEFINED RAPIDS_CYTHON_INITIALIZED) # Verify that we are using scikit-build. if(NOT DEFINED SKBUILD) - message(WARNING "rapids-cython expects scikit-build-core to be active before being used. \ + message( + WARNING + "rapids-cython expects scikit-build-core to be active before being used. \ The SKBUILD variable is not currently set, indicating that scikit-build-core \ - is not active, so builds may behave unexpectedly.") + is not active, so builds may behave unexpectedly." + ) else() # Access the variable to avoid unused variable warnings." message(TRACE "Accessing SKBUILD variable ${SKBUILD}") endif() - find_package(Python REQUIRED COMPONENTS Interpreter Development.Module - ${SKBUILD_SABI_COMPONENT}) + find_package( + Python + REQUIRED + COMPONENTS Interpreter Development.Module ${SKBUILD_SABI_COMPONENT} + ) find_program(CYTHON "cython" REQUIRED) if(NOT CYTHON_FLAGS) diff --git a/rapids-cmake/export/cpm.cmake b/rapids-cmake/export/cpm.cmake index 5e2cd6f3..9fc266a0 100644 --- a/rapids-cmake/export/cpm.cmake +++ b/rapids-cmake/export/cpm.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -66,8 +66,11 @@ function(rapids_export_cpm type name export_set) endif() string(TIMESTAMP current_year "%Y" UTC) - configure_file("${CMAKE_CURRENT_FUNCTION_LIST_DIR}/template/cpm.cmake.in" - "${CMAKE_BINARY_DIR}/rapids-cmake/${export_set}/${type}/cpm_${name}.cmake" @ONLY) + configure_file( + "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/template/cpm.cmake.in" + "${CMAKE_BINARY_DIR}/rapids-cmake/${export_set}/${type}/cpm_${name}.cmake" + @ONLY + ) if(NOT TARGET rapids_export_${type}_${export_set}) add_library(rapids_export_${type}_${export_set} INTERFACE) @@ -81,8 +84,10 @@ function(rapids_export_cpm type name export_set) if(_RAPIDS_GLOBAL_TARGETS) # record our targets that need to be marked as global when imported - set_property(TARGET rapids_export_${type}_${export_set} APPEND - PROPERTY "GLOBAL_TARGETS" "${_RAPIDS_GLOBAL_TARGETS}") + set_property( + TARGET rapids_export_${type}_${export_set} + APPEND + PROPERTY "GLOBAL_TARGETS" "${_RAPIDS_GLOBAL_TARGETS}" + ) endif() - endfunction() diff --git a/rapids-cmake/export/detail/component.cmake b/rapids-cmake/export/detail/component.cmake index c7c965f7..8ff70f98 100644 --- a/rapids-cmake/export/detail/component.cmake +++ b/rapids-cmake/export/detail/component.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -26,7 +26,15 @@ components. #]=======================================================================] # cmake-lint: disable=W0105,R0913 -function(rapids_export_component type project_name component_name export_set unique_name namespace) +function( + rapids_export_component + type + project_name + component_name + export_set + unique_name + namespace +) list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.export.rapids_export_component") string(TOLOWER ${type} type) @@ -37,40 +45,56 @@ function(rapids_export_component type project_name component_name export_set uni rapids_cmake_install_lib_dir(install_location) set(install_location "${install_location}/cmake/${project_name}") - set(deps_destination - "${PROJECT_BINARY_DIR}/rapids-cmake/${project_name}/export/${component_name}/") + set( + deps_destination + "${PROJECT_BINARY_DIR}/rapids-cmake/${project_name}/export/${component_name}/" + ) file(MAKE_DIRECTORY "${deps_destination}") - install(DIRECTORY "${deps_destination}" DESTINATION "${install_location}" - COMPONENT ${component_name}) + install( + DIRECTORY "${deps_destination}" + DESTINATION "${install_location}" + COMPONENT ${component_name} + ) if(namespace STREQUAL "") - install(EXPORT ${export_set} FILE ${project_name}-${unique_name}-targets.cmake - DESTINATION "${install_location}" COMPONENT ${component_name}) + install( + EXPORT ${export_set} + FILE ${project_name}-${unique_name}-targets.cmake + DESTINATION "${install_location}" + COMPONENT ${component_name} + ) else() - install(EXPORT ${export_set} - FILE ${project_name}-${unique_name}-targets.cmake - DESTINATION "${install_location}" - COMPONENT ${component_name} - NAMESPACE ${namespace}) + install( + EXPORT ${export_set} + FILE ${project_name}-${unique_name}-targets.cmake + DESTINATION "${install_location}" + COMPONENT ${component_name} + NAMESPACE ${namespace} + ) endif() - else() set(install_location "${PROJECT_BINARY_DIR}") set(deps_destination "${install_location}/") if(namespace STREQUAL "") - export(EXPORT ${export_set} - FILE "${install_location}/${project_name}-${unique_name}-targets.cmake") + export( + EXPORT ${export_set} + FILE "${install_location}/${project_name}-${unique_name}-targets.cmake" + ) else() - export(EXPORT ${export_set} NAMESPACE ${namespace} - FILE "${install_location}/${project_name}-${unique_name}-targets.cmake") + export( + EXPORT ${export_set} + NAMESPACE ${namespace} + FILE "${install_location}/${project_name}-${unique_name}-targets.cmake" + ) endif() - endif() if(TARGET rapids_export_${type}_${export_set}) include("${rapids-cmake-dir}/export/write_dependencies.cmake") rapids_export_write_dependencies( - ${type} ${export_set} "${deps_destination}/${project_name}-${unique_name}-dependencies.cmake") + ${type} + ${export_set} + "${deps_destination}/${project_name}-${unique_name}-dependencies.cmake" + ) endif() - endfunction() diff --git a/rapids-cmake/export/detail/post_find_package_code.cmake b/rapids-cmake/export/detail/post_find_package_code.cmake index 28444e2f..ee5fe803 100644 --- a/rapids-cmake/export/detail/post_find_package_code.cmake +++ b/rapids-cmake/export/detail/post_find_package_code.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -70,6 +70,9 @@ function(rapids_export_post_find_package_code type name code) # if the code coming in is a list of string we will have `;`, so transform those to "\n" so we # have a single string string(REPLACE ";" "\n" code "${code}") - set_property(TARGET rapids_export_${type}_${export_set} APPEND_STRING - PROPERTY "${name}_POST_FIND_CODE" "${code}\n") + set_property( + TARGET rapids_export_${type}_${export_set} + APPEND_STRING + PROPERTY "${name}_POST_FIND_CODE" "${code}\n" + ) endfunction() diff --git a/rapids-cmake/export/export.cmake b/rapids-cmake/export/export.cmake index 7a98ae4e..e5a9d275 100644 --- a/rapids-cmake/export/export.cmake +++ b/rapids-cmake/export/export.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -192,7 +192,14 @@ function(rapids_export type project_name) string(TOUPPER ${project_name} project_name_uppercase) set(options "") - set(one_value EXPORT_SET VERSION NAMESPACE DOCUMENTATION FINAL_CODE_BLOCK) + set( + one_value + EXPORT_SET + VERSION + NAMESPACE + DOCUMENTATION + FINAL_CODE_BLOCK + ) set(multi_value GLOBAL_TARGETS COMPONENTS COMPONENTS_EXPORT_SET LANGUAGES) cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) @@ -218,17 +225,23 @@ function(rapids_export type project_name) endif() if(NOT DEFINED _RAPIDS_NAMESPACE) - message(VERBOSE - "rapids-cmake EXPORT: no NAMESPACE was provided. `${project_name}::` is recommended \ -if EXPORT_NAME isn't set for the export targets.") + message( + VERBOSE + "rapids-cmake EXPORT: no NAMESPACE was provided. `${project_name}::` is recommended \ +if EXPORT_NAME isn't set for the export targets." + ) endif() if(_RAPIDS_COMPONENTS AND NOT _RAPIDS_COMPONENTS_EXPORT_SET) - message(FATAL_ERROR "rapids_export(${type} ${project_name} is missing COMPONENTS_EXPORT_SET as COMPONENTS was provided." + message( + FATAL_ERROR + "rapids_export(${type} ${project_name} is missing COMPONENTS_EXPORT_SET as COMPONENTS was provided." ) endif() if(_RAPIDS_COMPONENTS_EXPORT_SET AND NOT _RAPIDS_COMPONENTS) - message(FATAL_ERROR "rapids_export(${type} ${project_name} is missing COMPONENTS as COMPONENTS_EXPORT_SET was provided." + message( + FATAL_ERROR + "rapids_export(${type} ${project_name} is missing COMPONENTS as COMPONENTS_EXPORT_SET was provided." ) endif() @@ -237,8 +250,13 @@ if EXPORT_NAME isn't set for the export targets.") set(_RAPIDS_HAS_COMPONENTS TRUE) foreach(comp comp_export_set IN ZIP_LISTS _RAPIDS_COMPONENTS _RAPIDS_COMPONENTS_EXPORT_SET) - string(REGEX REPLACE "(${project_name}[-_])|([-_]?${comp}[-_]?)|([-_]?export[s]?)" "" - nice_export_name "${comp_export_set}") + string( + REGEX REPLACE + "(${project_name}[-_])|([-_]?${comp}[-_]?)|([-_]?export[s]?)" + "" + nice_export_name + "${comp_export_set}" + ) if(nice_export_name STREQUAL "") string(PREPEND nice_export_name "${comp}") else() @@ -248,8 +266,14 @@ if EXPORT_NAME isn't set for the export targets.") if(DEFINED _RAPIDS_NAMESPACE) set(_RAPIDS_COMPONENT_NAMESPACE "${_RAPIDS_NAMESPACE}") endif() - rapids_export_component(${type} ${project_name} ${comp} ${comp_export_set} - ${nice_export_name} "${_RAPIDS_COMPONENT_NAMESPACE}") + rapids_export_component( + ${type} + ${project_name} + ${comp} + ${comp_export_set} + ${nice_export_name} + "${_RAPIDS_COMPONENT_NAMESPACE}" + ) endforeach() endif() @@ -277,25 +301,35 @@ if EXPORT_NAME isn't set for the export targets.") set(scratch_dir "${PROJECT_BINARY_DIR}/rapids-cmake/${project_name}/export/${project_name}") string(TIMESTAMP current_year "%Y" UTC) - configure_package_config_file("${CMAKE_CURRENT_FUNCTION_LIST_DIR}/template/config.cmake.in" - "${scratch_dir}/${project_name}-config.cmake" - INSTALL_DESTINATION "${install_location}") + configure_package_config_file( + "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/template/config.cmake.in" + "${scratch_dir}/${project_name}-config.cmake" + INSTALL_DESTINATION "${install_location}" + ) if(rapids_version_set) write_basic_package_version_file( - "${scratch_dir}/${project_name}-config-version.cmake" VERSION ${rapids_project_version} - COMPATIBILITY ${rapids_project_version_compat}) + "${scratch_dir}/${project_name}-config-version.cmake" + VERSION ${rapids_project_version} + COMPATIBILITY ${rapids_project_version_compat} + ) endif() if(DEFINED _RAPIDS_NAMESPACE) - install(EXPORT ${_RAPIDS_EXPORT_SET} - FILE ${project_name}-targets.cmake - NAMESPACE ${_RAPIDS_NAMESPACE} - DESTINATION "${install_location}" - COMPONENT ${project_name}) + install( + EXPORT ${_RAPIDS_EXPORT_SET} + FILE ${project_name}-targets.cmake + NAMESPACE ${_RAPIDS_NAMESPACE} + DESTINATION "${install_location}" + COMPONENT ${project_name} + ) else() - install(EXPORT ${_RAPIDS_EXPORT_SET} FILE ${project_name}-targets.cmake - DESTINATION "${install_location}" COMPONENT ${project_name}) + install( + EXPORT ${_RAPIDS_EXPORT_SET} + FILE ${project_name}-targets.cmake + DESTINATION "${install_location}" + COMPONENT ${project_name} + ) endif() if(TARGET rapids_export_install_${_RAPIDS_EXPORT_SET}) @@ -314,41 +348,51 @@ if EXPORT_NAME isn't set for the export targets.") # Install everything we have generated install(DIRECTORY "${scratch_dir}/" DESTINATION "${install_location}" COMPONENT ${project_name}) - else() set(install_location "${PROJECT_BINARY_DIR}") string(TIMESTAMP current_year "%Y" UTC) - configure_package_config_file("${CMAKE_CURRENT_FUNCTION_LIST_DIR}/template/config.cmake.in" - "${install_location}/${project_name}-config.cmake" - INSTALL_DESTINATION "${install_location}") + configure_package_config_file( + "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/template/config.cmake.in" + "${install_location}/${project_name}-config.cmake" + INSTALL_DESTINATION "${install_location}" + ) if(rapids_version_set) write_basic_package_version_file( - "${install_location}/${project_name}-config-version.cmake" VERSION ${rapids_project_version} - COMPATIBILITY ${rapids_project_version_compat}) + "${install_location}/${project_name}-config-version.cmake" + VERSION ${rapids_project_version} + COMPATIBILITY ${rapids_project_version_compat} + ) endif() if(DEFINED _RAPIDS_NAMESPACE) - 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" + ) else() export(EXPORT ${_RAPIDS_EXPORT_SET} FILE "${install_location}/${project_name}-targets.cmake") endif() if(TARGET rapids_export_build_${_RAPIDS_EXPORT_SET}) include("${rapids-cmake-dir}/export/write_dependencies.cmake") - rapids_export_write_dependencies(BUILD ${_RAPIDS_EXPORT_SET} - "${install_location}/${project_name}-dependencies.cmake") + rapids_export_write_dependencies( + BUILD + ${_RAPIDS_EXPORT_SET} + "${install_location}/${project_name}-dependencies.cmake" + ) endif() 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() - endif() - endfunction() diff --git a/rapids-cmake/export/find_package_file.cmake b/rapids-cmake/export/find_package_file.cmake index 3a9a0563..d8ec2d0a 100644 --- a/rapids-cmake/export/find_package_file.cmake +++ b/rapids-cmake/export/find_package_file.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -75,7 +75,9 @@ function(rapids_export_find_package_file type file_path) # 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/find_package_root.cmake b/rapids-cmake/export/find_package_root.cmake index 341c0e5e..7bb47e0f 100644 --- a/rapids-cmake/export/find_package_root.cmake +++ b/rapids-cmake/export/find_package_root.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -71,9 +71,14 @@ function(rapids_export_find_package_root type name dir_path) # 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_ROOT_PACKAGES" - ${name}) - set_property(TARGET rapids_export_${type}_${export_set} APPEND PROPERTY "FIND_ROOT_FOR_${name}" - ${dir_path}) - + set_property( + TARGET rapids_export_${type}_${export_set} + APPEND + PROPERTY "FIND_ROOT_PACKAGES" ${name} + ) + set_property( + TARGET rapids_export_${type}_${export_set} + APPEND + PROPERTY "FIND_ROOT_FOR_${name}" ${dir_path} + ) endfunction() diff --git a/rapids-cmake/export/package.cmake b/rapids-cmake/export/package.cmake index 0297a385..0663463e 100644 --- a/rapids-cmake/export/package.cmake +++ b/rapids-cmake/export/package.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -71,23 +71,31 @@ function(rapids_export_package type name export_set) if(_RAPIDS_COMPONENTS AND _RAPIDS_VERSION) set(version ${_RAPIDS_VERSION}) set(components ${_RAPIDS_COMPONENTS}) - configure_file("${CMAKE_CURRENT_FUNCTION_LIST_DIR}/template/${type}_package_components_versioned.cmake.in" - "${CMAKE_BINARY_DIR}/rapids-cmake/${export_set}/${type}/package_${name}.cmake" - @ONLY) + configure_file( + "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/template/${type}_package_components_versioned.cmake.in" + "${CMAKE_BINARY_DIR}/rapids-cmake/${export_set}/${type}/package_${name}.cmake" + @ONLY + ) elseif(_RAPIDS_COMPONENTS) set(components ${_RAPIDS_COMPONENTS}) - configure_file("${CMAKE_CURRENT_FUNCTION_LIST_DIR}/template/${type}_package_components.cmake.in" - "${CMAKE_BINARY_DIR}/rapids-cmake/${export_set}/${type}/package_${name}.cmake" - @ONLY) + configure_file( + "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/template/${type}_package_components.cmake.in" + "${CMAKE_BINARY_DIR}/rapids-cmake/${export_set}/${type}/package_${name}.cmake" + @ONLY + ) elseif(_RAPIDS_VERSION) set(version ${_RAPIDS_VERSION}) - configure_file("${CMAKE_CURRENT_FUNCTION_LIST_DIR}/template/${type}_package_versioned.cmake.in" - "${CMAKE_BINARY_DIR}/rapids-cmake/${export_set}/${type}/package_${name}.cmake" - @ONLY) + configure_file( + "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/template/${type}_package_versioned.cmake.in" + "${CMAKE_BINARY_DIR}/rapids-cmake/${export_set}/${type}/package_${name}.cmake" + @ONLY + ) else() - configure_file("${CMAKE_CURRENT_FUNCTION_LIST_DIR}/template/${type}_package.cmake.in" - "${CMAKE_BINARY_DIR}/rapids-cmake/${export_set}/${type}/package_${name}.cmake" - @ONLY) + configure_file( + "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/template/${type}_package.cmake.in" + "${CMAKE_BINARY_DIR}/rapids-cmake/${export_set}/${type}/package_${name}.cmake" + @ONLY + ) endif() if(NOT TARGET rapids_export_${type}_${export_set}) @@ -102,8 +110,10 @@ function(rapids_export_package type name export_set) if(_RAPIDS_GLOBAL_TARGETS) # record our targets that need to be marked as global when imported - set_property(TARGET rapids_export_${type}_${export_set} APPEND - PROPERTY "GLOBAL_TARGETS" "${_RAPIDS_GLOBAL_TARGETS}") + set_property( + TARGET rapids_export_${type}_${export_set} + APPEND + PROPERTY "GLOBAL_TARGETS" "${_RAPIDS_GLOBAL_TARGETS}" + ) endif() - endfunction() diff --git a/rapids-cmake/export/write_dependencies.cmake b/rapids-cmake/export/write_dependencies.cmake index b6d37498..a8940eeb 100644 --- a/rapids-cmake/export/write_dependencies.cmake +++ b/rapids-cmake/export/write_dependencies.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -44,13 +44,19 @@ function(rapids_export_write_dependencies type export_set file_path) endif() # Determine if we need have any `ROOT_DIR` variables we need to set. - get_property(find_root_dirs TARGET rapids_export_${type}_${export_set} - PROPERTY "FIND_ROOT_PACKAGES") + get_property( + find_root_dirs + TARGET rapids_export_${type}_${export_set} + PROPERTY "FIND_ROOT_PACKAGES" + ) list(REMOVE_DUPLICATES find_root_dirs) # 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") + 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 @@ -66,10 +72,17 @@ function(rapids_export_write_dependencies type export_set file_path) set(_RAPIDS_EXPORT_CONTENTS) if(uses_cpm) # Include download_with_retry.cmake in the exported dependencies first - file(READ "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../cmake/download_with_retry.cmake" - download_with_retry_logic) - string(REPLACE "include_guard(GLOBAL)\n" "" download_with_retry_logic - "${download_with_retry_logic}") + file( + READ "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../cmake/download_with_retry.cmake" + download_with_retry_logic + ) + string( + REPLACE + "include_guard(GLOBAL)\n" + "" + download_with_retry_logic + "${download_with_retry_logic}" + ) string(APPEND _RAPIDS_EXPORT_CONTENTS ${download_with_retry_logic}) file(READ "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../cpm/detail/download.cmake" cpm_logic) @@ -78,19 +91,23 @@ function(rapids_export_write_dependencies type export_set file_path) string(APPEND _RAPIDS_EXPORT_CONTENTS "rapids_cpm_download()\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) -endif()\n") +endif()\n" + ) endif() endif() foreach(package IN LISTS find_root_dirs) - get_property(root_dir_path TARGET rapids_export_${type}_${export_set} - PROPERTY "FIND_ROOT_FOR_${package}") + get_property( + root_dir_path + TARGET rapids_export_${type}_${export_set} + PROPERTY "FIND_ROOT_FOR_${package}" + ) set(dep_content "set(${package}_ROOT \"${root_dir_path}\")") string(APPEND _RAPIDS_EXPORT_CONTENTS "${dep_content}\n") endforeach() @@ -99,8 +116,11 @@ 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() set(dep_dir "${CMAKE_BINARY_DIR}/rapids-cmake/${export_set}/${type}") @@ -115,8 +135,11 @@ endif()\n") endif() string(APPEND _RAPIDS_EXPORT_CONTENTS "${dep_content}\n") - get_property(post_find_code TARGET rapids_export_${type}_${export_set} - PROPERTY "${dep}_POST_FIND_CODE") + get_property( + post_find_code + TARGET rapids_export_${type}_${export_set} + PROPERTY "${dep}_POST_FIND_CODE" + ) if(post_find_code) string(APPEND _RAPIDS_EXPORT_CONTENTS "if(${dep}_FOUND)\n${post_find_code}\nendif()\n") endif() @@ -130,6 +153,9 @@ endif()\n") string(APPEND _RAPIDS_EXPORT_CONTENTS "set(rapids_global_targets ${global_targets})\n") string(TIMESTAMP current_year "%Y" UTC) - 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 5fdaa59f..39284463 100644 --- a/rapids-cmake/export/write_language.cmake +++ b/rapids-cmake/export/write_language.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -40,8 +40,9 @@ for packages included via `CPM` to enable extra languages. function(rapids_export_write_language type lang file_path) list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.export.write_language") - set(code_to_inject - [=[ + 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 @@ -132,9 +133,9 @@ endforeach() unset(rapids_existing_calls) unset(rapids_directories) unset(rapids_root_directory) -]=]) +]=] + ) string(CONFIGURE "${code_to_inject}" code_to_inject @ONLY) file(WRITE "${file_path}" "${code_to_inject}") - endfunction() diff --git a/rapids-cmake/find/generate_module.cmake b/rapids-cmake/find/generate_module.cmake index 1c8bc7cc..22f1cf4d 100644 --- a/rapids-cmake/find/generate_module.cmake +++ b/rapids-cmake/find/generate_module.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -137,7 +137,14 @@ function(rapids_find_generate_module name) list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.find.generate_module") set(options NO_CONFIG) - set(one_value VERSION BUILD_EXPORT_SET INSTALL_EXPORT_SET INITIAL_CODE_BLOCK FINAL_CODE_BLOCK) + set( + one_value + VERSION + BUILD_EXPORT_SET + INSTALL_EXPORT_SET + INITIAL_CODE_BLOCK + FINAL_CODE_BLOCK + ) set(multi_value HEADER_NAMES LIBRARY_NAMES INCLUDE_SUFFIXES) cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) @@ -164,21 +171,32 @@ function(rapids_find_generate_module name) if(DEFINED _RAPIDS_VERSION) list(TRANSFORM _RAPIDS_PKG_LIB_NAMES APPEND "${_RAPIDS_VERSION}" OUTPUT_VARIABLE lib_version1) - list(TRANSFORM _RAPIDS_PKG_LIB_NAMES APPEND ".${_RAPIDS_VERSION}" OUTPUT_VARIABLE - lib_version2) + 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() if(DEFINED _RAPIDS_INITIAL_CODE_BLOCK) if(NOT DEFINED ${_RAPIDS_INITIAL_CODE_BLOCK}) - message(FATAL_ERROR "INITIAL_CODE_BLOCK variable `${_RAPIDS_INITIAL_CODE_BLOCK}` doesn't exist" + message( + FATAL_ERROR + "INITIAL_CODE_BLOCK variable `${_RAPIDS_INITIAL_CODE_BLOCK}` doesn't exist" ) endif() set(_RAPIDS_FIND_INITIAL_CODE_BLOCK "${${_RAPIDS_INITIAL_CODE_BLOCK}}") @@ -193,8 +211,11 @@ function(rapids_find_generate_module name) # Need to generate the module string(TIMESTAMP current_year "%Y" UTC) - 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) @@ -204,10 +225,16 @@ function(rapids_find_generate_module name) # Record what export sets this module is part of include("${rapids-cmake-dir}/export/find_package_file.cmake") - rapids_export_find_package_file(BUILD "${CMAKE_BINARY_DIR}/cmake/find_modules/Find${name}.cmake" - EXPORT_SET ${_RAPIDS_BUILD_EXPORT_SET}) - rapids_export_find_package_file(INSTALL "${CMAKE_BINARY_DIR}/cmake/find_modules/Find${name}.cmake" - EXPORT_SET ${_RAPIDS_INSTALL_EXPORT_SET}) + rapids_export_find_package_file( + BUILD + "${CMAKE_BINARY_DIR}/cmake/find_modules/Find${name}.cmake" + EXPORT_SET ${_RAPIDS_BUILD_EXPORT_SET} + ) + rapids_export_find_package_file( + INSTALL + "${CMAKE_BINARY_DIR}/cmake/find_modules/Find${name}.cmake" + EXPORT_SET ${_RAPIDS_INSTALL_EXPORT_SET} + ) endfunction() cmake_policy(POP) diff --git a/rapids-cmake/find/package.cmake b/rapids-cmake/find/package.cmake index a0087743..7978d5b3 100644 --- a/rapids-cmake/find/package.cmake +++ b/rapids-cmake/find/package.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -106,8 +106,13 @@ macro(rapids_find_package name) set(_rapids_options FIND_ARGS) set(_rapids_one_value BUILD_EXPORT_SET INSTALL_EXPORT_SET) set(_rapids_multi_value COMPONENTS GLOBAL_TARGETS) - cmake_parse_arguments(_RAPIDS_FIND "${_rapids_options}" "${_rapids_one_value}" - "${_rapids_multi_value}" ${ARGN}) + cmake_parse_arguments( + _RAPIDS_FIND + "${_rapids_options}" + "${_rapids_one_value}" + "${_rapids_multi_value}" + ${ARGN} + ) if(_RAPIDS_FIND_COMPONENTS) list(APPEND _RAPIDS_FIND_UNPARSED_ARGUMENTS COMPONENTS ${_RAPIDS_FIND_COMPONENTS}) @@ -123,7 +128,6 @@ macro(rapids_find_package name) # Only record the export requirements if the package was found This allows us to handle implicit # OPTIONAL find packages if(${${name}_FOUND}) - set(_rapids_extra_info) if(_RAPIDS_FIND_GLOBAL_TARGETS) list(APPEND _rapids_extra_info "GLOBAL_TARGETS" ${_RAPIDS_FIND_GLOBAL_TARGETS}) @@ -145,8 +149,12 @@ macro(rapids_find_package name) if(_RAPIDS_FIND_INSTALL_EXPORT_SET) include("${rapids-cmake-dir}/export/package.cmake") - rapids_export_package(INSTALL ${name} ${_RAPIDS_FIND_INSTALL_EXPORT_SET} - ${_rapids_extra_info}) + rapids_export_package( + INSTALL + ${name} + ${_RAPIDS_FIND_INSTALL_EXPORT_SET} + ${_rapids_extra_info} + ) endif() unset(_rapids_extra_info) diff --git a/rapids-cmake/rapids-version.cmake b/rapids-cmake/rapids-version.cmake index a9071d80..34286f44 100644 --- a/rapids-cmake/rapids-version.cmake +++ b/rapids-cmake/rapids-version.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -17,7 +17,9 @@ if(NOT DEFINED rapids-cmake-checkout-tag) set(RAPIDS_VERSION "${RAPIDS_VERSION_MAJOR}.${RAPIDS_VERSION_MINOR}.${RAPIDS_VERSION_PATCH}") else() string(REPLACE "\n" "\n " _rapids_version_formatted " ${_rapids_version}") - message(FATAL_ERROR "Could not determine RAPIDS version. Contents of VERSION file:\n${_rapids_version_formatted}" + message( + FATAL_ERROR + "Could not determine RAPIDS version. Contents of VERSION file:\n${_rapids_version_formatted}" ) endif() @@ -28,7 +30,9 @@ if(NOT DEFINED rapids-cmake-checkout-tag) # Use STRINGS to trim whitespace/newlines file(STRINGS "${CMAKE_CURRENT_LIST_DIR}/../RAPIDS_BRANCH" _rapids_checkout) if(NOT _rapids_checkout) - message(FATAL_ERROR "Could not determine branch name to use for checking out rapids-cmake. The file \"${CMAKE_CURRENT_LIST_DIR}/../RAPIDS_BRANCH\" is missing." + message( + FATAL_ERROR + "Could not determine branch name to use for checking out rapids-cmake. The file \"${CMAKE_CURRENT_LIST_DIR}/../RAPIDS_BRANCH\" is missing." ) endif() set(rapids-cmake-checkout-tag "${_rapids_checkout}") diff --git a/rapids-cmake/test/add.cmake b/rapids-cmake/test/add.cmake index 114445f6..f90febdd 100644 --- a/rapids-cmake/test/add.cmake +++ b/rapids-cmake/test/add.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -61,7 +61,15 @@ function(rapids_test_add) list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.test.add") set(options) - set(one_value NAME WORKING_DIRECTORY GPUS PERCENT INSTALL_COMPONENT_SET INSTALL_TARGET) + set( + one_value + NAME + WORKING_DIRECTORY + GPUS + PERCENT + INSTALL_COMPONENT_SET + INSTALL_TARGET + ) set(multi_value COMMAND) cmake_parse_arguments(_RAPIDS_TEST "${options}" "${one_value}" "${multi_value}" ${ARGN}) @@ -82,7 +90,9 @@ function(rapids_test_add) endif() if(DEFINED _RAPIDS_TEST_INSTALL_TARGET) if(NOT TARGET ${_RAPIDS_TEST_INSTALL_TARGET}) - message(FATAL_ERROR "rapids_add_test given INSTALL_TARGET \"${_RAPIDS_TEST_INSTALL_TARGET}\", which does not exist" + message( + FATAL_ERROR + "rapids_add_test given INSTALL_TARGET \"${_RAPIDS_TEST_INSTALL_TARGET}\", which does not exist" ) endif() set(target_to_install ${_RAPIDS_TEST_INSTALL_TARGET}) @@ -102,30 +112,42 @@ function(rapids_test_add) set(_rapids_run_gpu_test_script_dir "${PROJECT_BINARY_DIR}/rapids-cmake/") set(_rapids_run_gpu_test_script "./run_gpu_test.cmake") if(NOT EXISTS "${_rapids_run_gpu_test_script_dir}${_rapids_run_gpu_test_script}") - file(COPY "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/detail/run_gpu_test.cmake" - DESTINATION "${_rapids_run_gpu_test_script_dir}") + file( + COPY "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/detail/run_gpu_test.cmake" + DESTINATION "${_rapids_run_gpu_test_script_dir}" + ) endif() - add_test(NAME ${_RAPIDS_TEST_NAME} - COMMAND ${CMAKE_COMMAND} "-Dcommand_to_run=${command}" "-Dcommand_args=${args}" - "-P=${_rapids_run_gpu_test_script_dir}${_rapids_run_gpu_test_script}" - WORKING_DIRECTORY "${_RAPIDS_TEST_WORKING_DIRECTORY}") + add_test( + NAME ${_RAPIDS_TEST_NAME} + COMMAND + ${CMAKE_COMMAND} "-Dcommand_to_run=${command}" "-Dcommand_args=${args}" + "-P=${_rapids_run_gpu_test_script_dir}${_rapids_run_gpu_test_script}" + WORKING_DIRECTORY "${_RAPIDS_TEST_WORKING_DIRECTORY}" + ) include(${CMAKE_CURRENT_FUNCTION_LIST_DIR}/gpu_requirements.cmake) if(DEFINED _RAPIDS_TEST_GPUS) - rapids_test_gpu_requirements(${_RAPIDS_TEST_NAME} GPUS ${_RAPIDS_TEST_GPUS} - PERCENT ${_RAPIDS_TEST_PERCENT}) + rapids_test_gpu_requirements( + ${_RAPIDS_TEST_NAME} + GPUS ${_RAPIDS_TEST_GPUS} + PERCENT ${_RAPIDS_TEST_PERCENT} + ) endif() if(_RAPIDS_TEST_INSTALL_COMPONENT_SET) include(${CMAKE_CURRENT_FUNCTION_LIST_DIR}/detail/record_test_component.cmake) include(${CMAKE_CURRENT_FUNCTION_LIST_DIR}/detail/record_install.cmake) - rapids_test_record_test_component(NAME ${_RAPIDS_TEST_NAME} COMPONENT - ${_RAPIDS_TEST_INSTALL_COMPONENT_SET}) + rapids_test_record_test_component( + NAME ${_RAPIDS_TEST_NAME} + COMPONENT ${_RAPIDS_TEST_INSTALL_COMPONENT_SET} + ) if(TARGET ${target_to_install}) - rapids_test_record_install(TARGET ${target_to_install} COMPONENT - ${_RAPIDS_TEST_INSTALL_COMPONENT_SET}) + rapids_test_record_install( + TARGET ${target_to_install} + COMPONENT ${_RAPIDS_TEST_INSTALL_COMPONENT_SET} + ) endif() endif() endfunction() diff --git a/rapids-cmake/test/detail/generate_installed_CTestTestfile.cmake b/rapids-cmake/test/detail/generate_installed_CTestTestfile.cmake index 42788403..67b13990 100644 --- a/rapids-cmake/test/detail/generate_installed_CTestTestfile.cmake +++ b/rapids-cmake/test/detail/generate_installed_CTestTestfile.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -42,14 +42,24 @@ function(convert_paths_to_install_dir prop_var) get_property(build_locs GLOBAL PROPERTY ${name}_build) foreach(build_loc IN LISTS build_locs) if(build_loc STREQUAL possible_build_path) - string(REPLACE "${build_loc}" "${install_loc}/${name}" install_value - "${possible_build_path}") + string( + REPLACE + "${build_loc}" + "${install_loc}/${name}" + install_value + "${possible_build_path}" + ) break() endif() endforeach() else() - string(REPLACE "${_RAPIDS_BUILD_DIR}" "\${CMAKE_INSTALL_PREFIX}" install_value - "${possible_build_path}") + string( + REPLACE + "${_RAPIDS_BUILD_DIR}" + "\${CMAKE_INSTALL_PREFIX}" + install_value + "${possible_build_path}" + ) endif() set(${prop_var} "${install_value}" PARENT_SCOPE) endfunction() @@ -82,6 +92,7 @@ endfunction() # Provide an `add_test` function signature since the built-in version doesn't exist in script mode function(add_test name command) + # gersemi: ignore if(NOT name IN_LIST _RAPIDS_TESTS_TO_RUN) return() endif() @@ -120,44 +131,59 @@ endfunction() # Provide a `set_tests_properties` function signature since the built-in version doesn't exist in # script mode function(set_tests_properties name) + # gersemi: ignore if(NOT name IN_LIST _RAPIDS_TESTS_TO_RUN) return() endif() set(options PROPERTIES) - set(env_props ENVIRONMENT # - ENVIRONMENT_MODIFICATION) - set(one_value - FIXTURES_CLEANUP # - FIXTURES_REQUIRED # - FIXTURES_SETUP # - LABELS # - MEASUREMENT # - PASS_REGULAR_EXPRESSION # - PROCESSOR_AFFINITY # - PROCESSORS # - REQUIRED_FILES # - RESOURCE_GROUPS # - RESOURCE_LOCK # - RUN_SERIAL # - SKIP_REGULAR_EXPRESSION # - SKIP_RETURN_CODE # - TIMEOUT # - TIMEOUT_AFTER_MATCH # - WILL_FAIL) - set(multi_value_no_propagate - _BACKTRACE_TRIPLES # - ATTACHED_FILES # - ATTACHED_FILES_ON_FAIL # - WORKING_DIRECTORY) - cmake_parse_arguments(_RAPIDS_TEST "${options}" "${one_value}" - "${env_props};${multi_value_no_propagate}" ${ARGN}) + set( + env_props + ENVIRONMENT # + ENVIRONMENT_MODIFICATION + ) + set( + one_value + FIXTURES_CLEANUP # + FIXTURES_REQUIRED # + FIXTURES_SETUP # + LABELS # + MEASUREMENT # + PASS_REGULAR_EXPRESSION # + PROCESSOR_AFFINITY # + PROCESSORS # + REQUIRED_FILES # + RESOURCE_GROUPS # + RESOURCE_LOCK # + RUN_SERIAL # + SKIP_REGULAR_EXPRESSION # + SKIP_RETURN_CODE # + TIMEOUT # + TIMEOUT_AFTER_MATCH # + WILL_FAIL + ) + set( + multi_value_no_propagate + _BACKTRACE_TRIPLES # + ATTACHED_FILES # + ATTACHED_FILES_ON_FAIL # + WORKING_DIRECTORY + ) + cmake_parse_arguments( + _RAPIDS_TEST + "${options}" + "${one_value}" + "${env_props};${multi_value_no_propagate}" + ${ARGN} + ) foreach(prop IN LISTS env_props) if(_RAPIDS_TEST_${prop}) set(prop_value "${_RAPIDS_TEST_${prop}}") find_and_convert_paths_from_var_list(prop_value) - string(APPEND test_prop_content - "set_tests_properties([=[${name}]=] PROPERTIES ${prop} \"${prop_value}\")\n") + string( + APPEND test_prop_content + "set_tests_properties([=[${name}]=] PROPERTIES ${prop} \"${prop_value}\")\n" + ) endif() endforeach() @@ -165,8 +191,10 @@ function(set_tests_properties name) if(_RAPIDS_TEST_${prop}) set(prop_value "${_RAPIDS_TEST_${prop}}") convert_paths_to_install_dir(prop_value) - string(APPEND test_prop_content - "set_tests_properties([=[${name}]=] PROPERTIES ${prop} ${prop_value})\n") + string( + APPEND test_prop_content + "set_tests_properties([=[${name}]=] PROPERTIES ${prop} ${prop_value})\n" + ) endif() endforeach() @@ -176,6 +204,7 @@ endfunction() # Provide a `subdirs` function signature since the built-in version doesn't exist in script mode function(subdirs name) + # gersemi: ignore string(APPEND test_file_content "\n") if(EXISTS "${name}/CTestTestfile.cmake") include("${name}/CTestTestfile.cmake") @@ -198,10 +227,19 @@ function(extract_install_info) set(options "file(INSTALL") set(one_value DESTINATION TYPE) set(multi_value FILES) - cmake_parse_arguments(_RAPIDS_TEST "${options}" "${one_value}" "${multi_value}" - ${install_contents}) - if(_RAPIDS_TEST_TYPE STREQUAL "EXECUTABLE" OR _RAPIDS_TEST_TYPE STREQUAL "SHARED_LIBRARY" - OR _RAPIDS_TEST_TYPE STREQUAL "STATIC_LIBRARY" OR _RAPIDS_TEST_TYPE STREQUAL "OBJECT_LIBRARY") + cmake_parse_arguments( + _RAPIDS_TEST + "${options}" + "${one_value}" + "${multi_value}" + ${install_contents} + ) + if( + _RAPIDS_TEST_TYPE STREQUAL "EXECUTABLE" + OR _RAPIDS_TEST_TYPE STREQUAL "SHARED_LIBRARY" + OR _RAPIDS_TEST_TYPE STREQUAL "STATIC_LIBRARY" + OR _RAPIDS_TEST_TYPE STREQUAL "OBJECT_LIBRARY" + ) foreach(build_loc IN LISTS _RAPIDS_TEST_FILES) cmake_path(GET build_loc FILENAME name) set_property(GLOBAL PROPERTY ${name}_install ${_RAPIDS_TEST_DESTINATION}) @@ -250,12 +288,15 @@ endfunction() determine_install_location_of_all_targets() # Setup the install location of `run_gpu_test` set_property(GLOBAL PROPERTY run_gpu_test.cmake_install ".") -set_property(GLOBAL PROPERTY run_gpu_test.cmake_build - "${_RAPIDS_PROJECT_DIR}/rapids-cmake/./run_gpu_test.cmake") +set_property( + GLOBAL + PROPERTY run_gpu_test.cmake_build "${_RAPIDS_PROJECT_DIR}/rapids-cmake/./run_gpu_test.cmake" +) include(${CMAKE_CURRENT_LIST_DIR}/default_names.cmake) -set(test_file_content - " +set( + test_file_content + " set(CTEST_SCRIPT_DIRECTORY \".\") set(CMAKE_INSTALL_PREFIX \"./${_RAPIDS_INSTALL_PREFIX}\") add_test(generate_resource_spec ./${rapids_test_generate_exe_name} \"./${rapids_test_json_file_name}\") @@ -265,7 +306,8 @@ set_tests_properties(generate_resource_spec PROPERTIES GENERATED_RESOURCE_SPEC_FILE \"\${_cwd}/${rapids_test_json_file_name}\" ) \n\n -") +" +) # will cause the above `add_test`, etc hooks to trigger filling up the contents of # `test_file_content` diff --git a/rapids-cmake/test/detail/record_install.cmake b/rapids-cmake/test/detail/record_install.cmake index 328d4d6f..ebfd092c 100644 --- a/rapids-cmake/test/detail/record_install.cmake +++ b/rapids-cmake/test/detail/record_install.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -29,6 +29,9 @@ function(rapids_test_record_install) cmake_parse_arguments(_RAPIDS_TEST "${options}" "${one_value}" "${multi_value}" ${ARGN}) set(component ${_RAPIDS_TEST_COMPONENT}) - set_property(TARGET rapids_test_install_${component} APPEND PROPERTY TARGETS_TO_INSTALL - "${_RAPIDS_TEST_TARGET}") + set_property( + TARGET rapids_test_install_${component} + APPEND + PROPERTY TARGETS_TO_INSTALL "${_RAPIDS_TEST_TARGET}" + ) endfunction() diff --git a/rapids-cmake/test/detail/record_test_component.cmake b/rapids-cmake/test/detail/record_test_component.cmake index d21e337d..1c42a954 100644 --- a/rapids-cmake/test/detail/record_test_component.cmake +++ b/rapids-cmake/test/detail/record_test_component.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -31,6 +31,9 @@ function(rapids_test_record_test_component) if(NOT TARGET rapids_test_install_${component}) add_library(rapids_test_install_${component} INTERFACE) endif() - set_property(TARGET rapids_test_install_${component} APPEND PROPERTY "TESTS_TO_RUN" - "${_RAPIDS_TEST_NAME}") + set_property( + TARGET rapids_test_install_${component} + APPEND + PROPERTY "TESTS_TO_RUN" "${_RAPIDS_TEST_NAME}" + ) endfunction() diff --git a/rapids-cmake/test/detail/run_gpu_test.cmake b/rapids-cmake/test/detail/run_gpu_test.cmake index a2f9f673..8588f688 100644 --- a/rapids-cmake/test/detail/run_gpu_test.cmake +++ b/rapids-cmake/test/detail/run_gpu_test.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -23,5 +23,8 @@ if(DEFINED ENV{CTEST_RESOURCE_GROUP_COUNT}) endif() endforeach() endif() -execute_process(COMMAND ${command_to_run} ${command_args} COMMAND_ECHO STDOUT - COMMAND_ERROR_IS_FATAL ANY) +execute_process( + COMMAND ${command_to_run} ${command_args} + COMMAND_ECHO STDOUT + COMMAND_ERROR_IS_FATAL ANY +) diff --git a/rapids-cmake/test/generate_resource_spec.cmake b/rapids-cmake/test/generate_resource_spec.cmake index eb26365c..6f8616ca 100644 --- a/rapids-cmake/test/generate_resource_spec.cmake +++ b/rapids-cmake/test/generate_resource_spec.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -52,7 +52,9 @@ function(rapids_test_generate_resource_spec DESTINATION filepath) endif() if(NOT rapids_lang) - message(FATAL_ERROR "rapids_test_generate_resource_spec Requires the CUDA or C++ language to be enabled." + message( + FATAL_ERROR + "rapids_test_generate_resource_spec Requires the CUDA or C++ language to be enabled." ) endif() @@ -62,23 +64,30 @@ function(rapids_test_generate_resource_spec DESTINATION filepath) if(NOT TARGET generate_ctest_json) find_package(CUDAToolkit QUIET) - add_executable(generate_ctest_json - ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/detail/generate_resource_spec.cpp) + add_executable( + generate_ctest_json + ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/detail/generate_resource_spec.cpp + ) if(CUDAToolkit_FOUND) target_link_libraries(generate_ctest_json PRIVATE CUDA::cudart_static) target_compile_definitions(generate_ctest_json PRIVATE HAVE_CUDA) endif() - set_property(SOURCE ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/detail/generate_resource_spec.cpp - PROPERTY LANGUAGE ${rapids_lang}) - set_target_properties(generate_ctest_json - PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/rapids-cmake/" - OUTPUT_NAME ${rapids_test_generate_exe_name}) + set_property( + SOURCE ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/detail/generate_resource_spec.cpp + PROPERTY LANGUAGE ${rapids_lang} + ) + set_target_properties( + generate_ctest_json + PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/rapids-cmake/" + OUTPUT_NAME ${rapids_test_generate_exe_name} + ) target_compile_features(generate_ctest_json PRIVATE ${rapids_lang_lower}_std_17) add_test(NAME generate_resource_spec COMMAND generate_ctest_json "${filepath}") - set_tests_properties(generate_resource_spec - PROPERTIES FIXTURES_SETUP resource_spec GENERATED_RESOURCE_SPEC_FILE - "${filepath}") + set_tests_properties( + generate_resource_spec + PROPERTIES FIXTURES_SETUP resource_spec GENERATED_RESOURCE_SPEC_FILE "${filepath}" + ) endif() - endfunction() diff --git a/rapids-cmake/test/gpu_requirements.cmake b/rapids-cmake/test/gpu_requirements.cmake index 612c321f..b731ce93 100644 --- a/rapids-cmake/test/gpu_requirements.cmake +++ b/rapids-cmake/test/gpu_requirements.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -54,7 +54,9 @@ function(rapids_test_gpu_requirements test_name) cmake_parse_arguments(_RAPIDS_TEST "${options}" "${one_value}" "${multi_value}" ${ARGN}) if(DEFINED _RAPIDS_TEST_PERCENT AND NOT DEFINED _RAPIDS_TEST_GPUS) - message(FATAL_ERROR "rapids_test_gpu_requirements requires the GPUS option to be provided when PERCENT is" + message( + FATAL_ERROR + "rapids_test_gpu_requirements requires the GPUS option to be provided when PERCENT is" ) endif() @@ -80,5 +82,4 @@ function(rapids_test_gpu_requirements test_name) set_property(TEST ${test_name} PROPERTY RESOURCE_GROUPS "${gpus},gpus:${percent}") set_property(TEST ${test_name} PROPERTY FIXTURES_REQUIRED resource_spec) endif() - endfunction() diff --git a/rapids-cmake/test/init.cmake b/rapids-cmake/test/init.cmake index aab6d1c8..9956730f 100644 --- a/rapids-cmake/test/init.cmake +++ b/rapids-cmake/test/init.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -52,5 +52,4 @@ function(rapids_test_init) if(NOT CTEST_RESOURCE_SPEC_FILE) rapids_test_generate_resource_spec(DESTINATION "${rapids_test_spec_file}") endif() - endfunction() diff --git a/rapids-cmake/test/install_relocatable.cmake b/rapids-cmake/test/install_relocatable.cmake index 5ce3f70a..c31e141b 100644 --- a/rapids-cmake/test/install_relocatable.cmake +++ b/rapids-cmake/test/install_relocatable.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -70,7 +70,9 @@ function(rapids_test_install_relocatable) list(JOIN from_install_prefix "" from_install_prefix) # cmake-lint: disable=W0106 - install(CODE " + install( + CODE + " # set variables needed by `generate_installed_CTestTestfile.cmake` set(_RAPIDS_TEST_DESTINATION \"${_RAPIDS_TEST_DESTINATION}\") set(_RAPIDS_INSTALL_PREFIX \"${from_install_prefix}\") @@ -89,23 +91,35 @@ function(rapids_test_install_relocatable) # install `test_launcher_file` file(INSTALL DESTINATION \"\${CMAKE_INSTALL_PREFIX}/${_RAPIDS_TEST_DESTINATION}\" TYPE FILE RENAME \"CTestTestfile.cmake\" FILES \"\${test_launcher_file}\") " - COMPONENT ${_RAPIDS_TEST_INSTALL_COMPONENT_SET} - ${to_exclude}) + COMPONENT ${_RAPIDS_TEST_INSTALL_COMPONENT_SET} + ${to_exclude} + ) # We need to install the rapids-test gpu detector, and the json script we also need to write out / # install the new CTestTestfile.cmake include(${CMAKE_CURRENT_FUNCTION_LIST_DIR}/detail/default_names.cmake) if(TARGET generate_ctest_json) - install(TARGETS generate_ctest_json COMPONENT ${_RAPIDS_TEST_INSTALL_COMPONENT_SET} - DESTINATION ${_RAPIDS_TEST_DESTINATION} ${to_exclude}) + install( + TARGETS generate_ctest_json + COMPONENT ${_RAPIDS_TEST_INSTALL_COMPONENT_SET} + DESTINATION ${_RAPIDS_TEST_DESTINATION} + ${to_exclude} + ) endif() if(EXISTS "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/detail/run_gpu_test.cmake") - install(FILES "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/detail/run_gpu_test.cmake" - COMPONENT ${_RAPIDS_TEST_INSTALL_COMPONENT_SET} DESTINATION ${_RAPIDS_TEST_DESTINATION} - ${to_exclude}) + install( + FILES "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/detail/run_gpu_test.cmake" + COMPONENT ${_RAPIDS_TEST_INSTALL_COMPONENT_SET} + DESTINATION ${_RAPIDS_TEST_DESTINATION} + ${to_exclude} + ) endif() if(targets_to_install) - install(TARGETS ${targets_to_install} COMPONENT ${_RAPIDS_TEST_INSTALL_COMPONENT_SET} - DESTINATION ${_RAPIDS_TEST_DESTINATION} ${to_exclude}) + install( + TARGETS ${targets_to_install} + COMPONENT ${_RAPIDS_TEST_INSTALL_COMPONENT_SET} + DESTINATION ${_RAPIDS_TEST_DESTINATION} + ${to_exclude} + ) endif() endfunction() diff --git a/testing/cmake/conda_env-build-envvar.cmake b/testing/cmake/conda_env-build-envvar.cmake index f0884db6..6108b2e4 100644 --- a/testing/cmake/conda_env-build-envvar.cmake +++ b/testing/cmake/conda_env-build-envvar.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -41,14 +41,18 @@ endif() get_target_property(link_options conda_env INTERFACE_LINK_OPTIONS) message(STATUS "link_options: ${link_options}") if(NOT "$" IN_LIST link_options) - message(FATAL_ERROR "Expected rpath-link=env{BUILD_PREFIX} to be in the link options of `conda_env`" + message( + FATAL_ERROR + "Expected rpath-link=env{BUILD_PREFIX} to be in the link options of `conda_env`" ) endif() if(NOT "$" IN_LIST link_options) message(FATAL_ERROR "Expected rpath-link=env{PREFIX} to be in the link options of `conda_env`") endif() if("$" IN_LIST link_options) - message(FATAL_ERROR "Not expected for rpath-link=env{CONDA_PREFIX} to be in the link options of `conda_env`" + message( + FATAL_ERROR + "Not expected for rpath-link=env{CONDA_PREFIX} to be in the link options of `conda_env`" ) endif() @@ -56,7 +60,9 @@ endif() set(before_call_value "$ENV{CMAKE_PREFIX_PATH}") rapids_cmake_support_conda_env(conda_env MODIFY_PREFIX_PATH) if(NOT ("${before_call_value}" STREQUAL "$ENV{CMAKE_PREFIX_PATH}")) - message(FATAL_ERROR "Expected rapids_cmake_support_conda_env not to change ENV{CMAKE_PREFIX_PATH}" + message( + FATAL_ERROR + "Expected rapids_cmake_support_conda_env not to change ENV{CMAKE_PREFIX_PATH}" ) endif() diff --git a/testing/cmake/conda_env-build.cmake b/testing/cmake/conda_env-build.cmake index 5326c776..22863b1a 100644 --- a/testing/cmake/conda_env-build.cmake +++ b/testing/cmake/conda_env-build.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -18,7 +18,9 @@ endif() get_target_property(compile_options conda_env INTERFACE_COMPILE_OPTIONS) if(NOT "$<$:-O0>" IN_LIST compile_options) - message(FATAL_ERROR "Expected $<$>:-O0> to be in the compile options of `conda_env`" + message( + FATAL_ERROR + "Expected $<$>:-O0> to be in the compile options of `conda_env`" ) endif() @@ -47,14 +49,18 @@ endif() get_target_property(link_options conda_env INTERFACE_LINK_OPTIONS) message(STATUS "link_options: ${link_options}") if(NOT "$" IN_LIST link_options) - message(FATAL_ERROR "Expected rpath-link=env{BUILD_PREFIX} to be in the link options of `conda_env`" + message( + FATAL_ERROR + "Expected rpath-link=env{BUILD_PREFIX} to be in the link options of `conda_env`" ) endif() if(NOT "$" IN_LIST link_options) message(FATAL_ERROR "Expected rpath-link=env{PREFIX} to be in the link options of `conda_env`") endif() if("$" IN_LIST link_options) - message(FATAL_ERROR "Not expected for rpath-link=env{CONDA_PREFIX} to be in the link options of `conda_env`" + message( + FATAL_ERROR + "Not expected for rpath-link=env{CONDA_PREFIX} to be in the link options of `conda_env`" ) endif() @@ -83,9 +89,22 @@ list(GET CMAKE_PREFIX_PATH 1 second_value) list(GET CMAKE_PREFIX_PATH 2 third_value) list(GET CMAKE_PREFIX_PATH 3 fourth_value) list(GET CMAKE_PREFIX_PATH 4 fifth_value) -set(correct_list "placeholder" "env_1" "env_2" "$ENV{PREFIX}" "$ENV{BUILD_PREFIX}") -set(actual_list "${first_value}" "${second_value}" "${third_value}" "${fourth_value}" - "${fifth_value}") +set( + correct_list + "placeholder" + "env_1" + "env_2" + "$ENV{PREFIX}" + "$ENV{BUILD_PREFIX}" +) +set( + actual_list + "${first_value}" + "${second_value}" + "${third_value}" + "${fourth_value}" + "${fifth_value}" +) foreach(correct actual IN ZIP_LISTS correct_list actual_list) if(NOT correct STREQUAL actual) diff --git a/testing/cmake/conda_env-cross-build-arm-envvar.cmake b/testing/cmake/conda_env-cross-build-arm-envvar.cmake index 60cff8ac..03127eed 100644 --- a/testing/cmake/conda_env-cross-build-arm-envvar.cmake +++ b/testing/cmake/conda_env-cross-build-arm-envvar.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -42,19 +42,27 @@ endif() get_target_property(link_options conda_env INTERFACE_LINK_OPTIONS) message(STATUS "link_options: ${link_options}") if(NOT "$" IN_LIST link_options) - message(FATAL_ERROR "Expected rpath-link=env{BUILD_PREFIX} to be in the link options of `conda_env`" + message( + FATAL_ERROR + "Expected rpath-link=env{BUILD_PREFIX} to be in the link options of `conda_env`" ) endif() if(NOT "$" IN_LIST link_options) message(FATAL_ERROR "Expected rpath-link=env{PREFIX} to be in the link options of `conda_env`") endif() -if(NOT "$" IN_LIST - link_options) - message(FATAL_ERROR "Expected rpath-link=env{PREFIX}/targets/sbsa-linux/ to be in the link options of `conda_env`" +if( + NOT + "$" IN_LIST link_options +) + message( + FATAL_ERROR + "Expected rpath-link=env{PREFIX}/targets/sbsa-linux/ to be in the link options of `conda_env`" ) endif() if("$" IN_LIST link_options) - message(FATAL_ERROR "Not expected for rpath-link=env{CONDA_PREFIX} to be in the link options of `conda_env`" + message( + FATAL_ERROR + "Not expected for rpath-link=env{CONDA_PREFIX} to be in the link options of `conda_env`" ) endif() @@ -62,7 +70,9 @@ endif() set(before_call_value "$ENV{CMAKE_PREFIX_PATH}") rapids_cmake_support_conda_env(conda_env MODIFY_PREFIX_PATH) if(NOT ("${before_call_value}" STREQUAL "$ENV{CMAKE_PREFIX_PATH}")) - message(FATAL_ERROR "Expected rapids_cmake_support_conda_env not to change ENV{CMAKE_PREFIX_PATH}" + message( + FATAL_ERROR + "Expected rapids_cmake_support_conda_env not to change ENV{CMAKE_PREFIX_PATH}" ) endif() @@ -84,8 +94,13 @@ list(GET env_cmake_prefix_path 0 first_value) list(GET env_cmake_prefix_path 1 second_value) list(GET env_cmake_prefix_path 2 third_value) list(GET env_cmake_prefix_path 3 fourth_value) -set(correct_list "placeholder" "$ENV{PREFIX}/targets/sbsa-linux" "$ENV{PREFIX}" - "$ENV{BUILD_PREFIX}") +set( + correct_list + "placeholder" + "$ENV{PREFIX}/targets/sbsa-linux" + "$ENV{PREFIX}" + "$ENV{BUILD_PREFIX}" +) set(actual_list "${first_value}" "${second_value}" "${third_value}" "${fourth_value}") foreach(correct actual IN ZIP_LISTS correct_list actual_list) if(NOT correct STREQUAL actual) diff --git a/testing/cmake/conda_env-cross-build-arm.cmake b/testing/cmake/conda_env-cross-build-arm.cmake index 65d9e126..8c5eea40 100644 --- a/testing/cmake/conda_env-cross-build-arm.cmake +++ b/testing/cmake/conda_env-cross-build-arm.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -42,19 +42,27 @@ endif() get_target_property(link_options conda_env INTERFACE_LINK_OPTIONS) message(STATUS "link_options: ${link_options}") if(NOT "$" IN_LIST link_options) - message(FATAL_ERROR "Expected rpath-link=env{BUILD_PREFIX} to be in the link options of `conda_env`" + message( + FATAL_ERROR + "Expected rpath-link=env{BUILD_PREFIX} to be in the link options of `conda_env`" ) endif() if(NOT "$" IN_LIST link_options) message(FATAL_ERROR "Expected rpath-link=env{PREFIX} to be in the link options of `conda_env`") endif() -if(NOT "$" IN_LIST - link_options) - message(FATAL_ERROR "Expected rpath-link=env{PREFIX}/targets/sbsa-linux/ to be in the link options of `conda_env`" +if( + NOT + "$" IN_LIST link_options +) + message( + FATAL_ERROR + "Expected rpath-link=env{PREFIX}/targets/sbsa-linux/ to be in the link options of `conda_env`" ) endif() if("$" IN_LIST link_options) - message(FATAL_ERROR "Not expected for rpath-link=env{CONDA_PREFIX} to be in the link options of `conda_env`" + message( + FATAL_ERROR + "Not expected for rpath-link=env{CONDA_PREFIX} to be in the link options of `conda_env`" ) endif() @@ -84,10 +92,24 @@ list(GET CMAKE_PREFIX_PATH 2 third_value) list(GET CMAKE_PREFIX_PATH 3 fourth_value) list(GET CMAKE_PREFIX_PATH 4 fifth_value) list(GET CMAKE_PREFIX_PATH 5 sixth_value) -set(correct_list "placeholder" "env_1" "env_2" "$ENV{PREFIX}/targets/sbsa-linux" "$ENV{PREFIX}" - "$ENV{BUILD_PREFIX}") -set(actual_list "${first_value}" "${second_value}" "${third_value}" "${fourth_value}" - "${fifth_value}" "${sixth_value}") +set( + correct_list + "placeholder" + "env_1" + "env_2" + "$ENV{PREFIX}/targets/sbsa-linux" + "$ENV{PREFIX}" + "$ENV{BUILD_PREFIX}" +) +set( + actual_list + "${first_value}" + "${second_value}" + "${third_value}" + "${fourth_value}" + "${fifth_value}" + "${sixth_value}" +) foreach(correct actual IN ZIP_LISTS correct_list actual_list) if(NOT correct STREQUAL actual) message(STATUS "correct: ${correct}") diff --git a/testing/cmake/conda_env-cross-build-x86-envvar.cmake b/testing/cmake/conda_env-cross-build-x86-envvar.cmake index dc27d00d..743718d3 100644 --- a/testing/cmake/conda_env-cross-build-x86-envvar.cmake +++ b/testing/cmake/conda_env-cross-build-x86-envvar.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -42,19 +42,29 @@ endif() get_target_property(link_options conda_env INTERFACE_LINK_OPTIONS) message(STATUS "link_options: ${link_options}") if(NOT "$" IN_LIST link_options) - message(FATAL_ERROR "Expected rpath-link=env{BUILD_PREFIX} to be in the link options of `conda_env`" + message( + FATAL_ERROR + "Expected rpath-link=env{BUILD_PREFIX} to be in the link options of `conda_env`" ) endif() if(NOT "$" IN_LIST link_options) message(FATAL_ERROR "Expected rpath-link=env{PREFIX} to be in the link options of `conda_env`") endif() -if(NOT "$" IN_LIST - link_options) - message(FATAL_ERROR "Expected rpath-link=env{PREFIX}/targets/x86_64-linux/ to be in the link options of `conda_env`" +if( + NOT + "$" + IN_LIST + link_options +) + message( + FATAL_ERROR + "Expected rpath-link=env{PREFIX}/targets/x86_64-linux/ to be in the link options of `conda_env`" ) endif() if("$" IN_LIST link_options) - message(FATAL_ERROR "Not expected for rpath-link=env{CONDA_PREFIX} to be in the link options of `conda_env`" + message( + FATAL_ERROR + "Not expected for rpath-link=env{CONDA_PREFIX} to be in the link options of `conda_env`" ) endif() @@ -62,7 +72,9 @@ endif() set(before_call_value "$ENV{CMAKE_PREFIX_PATH}") rapids_cmake_support_conda_env(conda_env MODIFY_PREFIX_PATH) if(NOT ("${before_call_value}" STREQUAL "$ENV{CMAKE_PREFIX_PATH}")) - message(FATAL_ERROR "Expected rapids_cmake_support_conda_env not to change ENV{CMAKE_PREFIX_PATH}" + message( + FATAL_ERROR + "Expected rapids_cmake_support_conda_env not to change ENV{CMAKE_PREFIX_PATH}" ) endif() @@ -84,8 +96,13 @@ list(GET env_cmake_prefix_path 0 first_value) list(GET env_cmake_prefix_path 1 second_value) list(GET env_cmake_prefix_path 2 third_value) list(GET env_cmake_prefix_path 3 fourth_value) -set(correct_list "placeholder" "$ENV{PREFIX}/targets/x86_64-linux" "$ENV{PREFIX}" - "$ENV{BUILD_PREFIX}") +set( + correct_list + "placeholder" + "$ENV{PREFIX}/targets/x86_64-linux" + "$ENV{PREFIX}" + "$ENV{BUILD_PREFIX}" +) set(actual_list "${first_value}" "${second_value}" "${third_value}" "${fourth_value}") foreach(correct actual IN ZIP_LISTS correct_list actual_list) diff --git a/testing/cmake/conda_env-cross-build-x86.cmake b/testing/cmake/conda_env-cross-build-x86.cmake index 7d5d9325..12ee168f 100644 --- a/testing/cmake/conda_env-cross-build-x86.cmake +++ b/testing/cmake/conda_env-cross-build-x86.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -42,19 +42,29 @@ endif() get_target_property(link_options conda_env INTERFACE_LINK_OPTIONS) message(STATUS "link_options: ${link_options}") if(NOT "$" IN_LIST link_options) - message(FATAL_ERROR "Expected rpath-link=env{BUILD_PREFIX} to be in the link options of `conda_env`" + message( + FATAL_ERROR + "Expected rpath-link=env{BUILD_PREFIX} to be in the link options of `conda_env`" ) endif() if(NOT "$" IN_LIST link_options) message(FATAL_ERROR "Expected rpath-link=env{PREFIX} to be in the link options of `conda_env`") endif() -if(NOT "$" IN_LIST - link_options) - message(FATAL_ERROR "Expected rpath-link=env{PREFIX}/targets/x86_64-linux/ to be in the link options of `conda_env`" +if( + NOT + "$" + IN_LIST + link_options +) + message( + FATAL_ERROR + "Expected rpath-link=env{PREFIX}/targets/x86_64-linux/ to be in the link options of `conda_env`" ) endif() if("$" IN_LIST link_options) - message(FATAL_ERROR "Not expected for rpath-link=env{CONDA_PREFIX} to be in the link options of `conda_env`" + message( + FATAL_ERROR + "Not expected for rpath-link=env{CONDA_PREFIX} to be in the link options of `conda_env`" ) endif() @@ -84,10 +94,24 @@ list(GET CMAKE_PREFIX_PATH 2 third_value) list(GET CMAKE_PREFIX_PATH 3 fourth_value) list(GET CMAKE_PREFIX_PATH 4 fifth_value) list(GET CMAKE_PREFIX_PATH 5 sixth_value) -set(correct_list "placeholder" "env_1" "env_2" "$ENV{PREFIX}/targets/x86_64-linux" "$ENV{PREFIX}" - "$ENV{BUILD_PREFIX}") -set(actual_list "${first_value}" "${second_value}" "${third_value}" "${fourth_value}" - "${fifth_value}" "${sixth_value}") +set( + correct_list + "placeholder" + "env_1" + "env_2" + "$ENV{PREFIX}/targets/x86_64-linux" + "$ENV{PREFIX}" + "$ENV{BUILD_PREFIX}" +) +set( + actual_list + "${first_value}" + "${second_value}" + "${third_value}" + "${fourth_value}" + "${fifth_value}" + "${sixth_value}" +) foreach(correct actual IN ZIP_LISTS correct_list actual_list) if(NOT correct STREQUAL actual) diff --git a/testing/cmake/conda_env-invalid.cmake b/testing/cmake/conda_env-invalid.cmake index 02d0f604..9c87e355 100644 --- a/testing/cmake/conda_env-invalid.cmake +++ b/testing/cmake/conda_env-invalid.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -24,6 +24,8 @@ if(TARGET conda_env2) endif() if(NOT "${before_call_value}" STREQUAL "${CMAKE_PREFIX_PATH}") - message(FATAL_ERROR "Not expected for `rapids_cmake_support_conda_env` to modify CMAKE_PREFIX_PATH" + message( + FATAL_ERROR + "Not expected for `rapids_cmake_support_conda_env` to modify CMAKE_PREFIX_PATH" ) endif() diff --git a/testing/cmake/conda_env-prefix-envvar.cmake b/testing/cmake/conda_env-prefix-envvar.cmake index 74d295c4..afc9e294 100644 --- a/testing/cmake/conda_env-prefix-envvar.cmake +++ b/testing/cmake/conda_env-prefix-envvar.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -37,15 +37,21 @@ endif() get_target_property(link_options conda_env INTERFACE_LINK_OPTIONS) if("$" IN_LIST link_options) - message(FATAL_ERROR "Not expected rpath-link=env{BUILD_PREFIX} to be in the link options of `conda_env`" + message( + FATAL_ERROR + "Not expected rpath-link=env{BUILD_PREFIX} to be in the link options of `conda_env`" ) endif() if("$" IN_LIST link_options) - message(FATAL_ERROR "Not expected rpath-link=env{PREFIX} to be in the link options of `conda_env`" + message( + FATAL_ERROR + "Not expected rpath-link=env{PREFIX} to be in the link options of `conda_env`" ) endif() if(NOT "$" IN_LIST link_options) - message(FATAL_ERROR "Expected for rpath-link=env{CONDA_PREFIX} to be in the link options of `conda_env`" + message( + FATAL_ERROR + "Expected for rpath-link=env{CONDA_PREFIX} to be in the link options of `conda_env`" ) endif() diff --git a/testing/cmake/conda_env-prefix.cmake b/testing/cmake/conda_env-prefix.cmake index 45b99a0b..7c07757a 100644 --- a/testing/cmake/conda_env-prefix.cmake +++ b/testing/cmake/conda_env-prefix.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -18,7 +18,9 @@ endif() get_target_property(compile_options conda_env INTERFACE_COMPILE_OPTIONS) if(NOT "$<$:-O0>" IN_LIST compile_options) - message(FATAL_ERROR "Expected $<$>:-O0> to be in the compile options of `conda_env`" + message( + FATAL_ERROR + "Expected $<$>:-O0> to be in the compile options of `conda_env`" ) endif() @@ -46,15 +48,21 @@ endif() get_target_property(link_options conda_env INTERFACE_LINK_OPTIONS) if("$" IN_LIST link_options) - message(FATAL_ERROR "Not expected rpath-link=env{BUILD_PREFIX} to be in the link options of `conda_env`" + message( + FATAL_ERROR + "Not expected rpath-link=env{BUILD_PREFIX} to be in the link options of `conda_env`" ) endif() if("$" IN_LIST link_options) - message(FATAL_ERROR "Not expected rpath-link=env{PREFIX} to be in the link options of `conda_env`" + message( + FATAL_ERROR + "Not expected rpath-link=env{PREFIX} to be in the link options of `conda_env`" ) endif() if(NOT "$" IN_LIST link_options) - message(FATAL_ERROR "Expected for rpath-link=env{CONDA_PREFIX} to be in the link options of `conda_env`" + message( + FATAL_ERROR + "Expected for rpath-link=env{CONDA_PREFIX} to be in the link options of `conda_env`" ) endif() diff --git a/testing/cmake/download_with_retry-basic.cmake b/testing/cmake/download_with_retry-basic.cmake index d18b4d86..54f3030f 100644 --- a/testing/cmake/download_with_retry-basic.cmake +++ b/testing/cmake/download_with_retry-basic.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -11,8 +11,9 @@ file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/download_test") file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/download_test") # Test URL - using a static test file with known contents -set(test_url - "https://raw.githubusercontent.com/rapidsai/rapids-cmake/c0d8c09c5590ecf38a9f9897c93e686e3da1858b/testing/cmake/test_files/test1.txt" +set( + test_url + "https://raw.githubusercontent.com/rapidsai/rapids-cmake/c0d8c09c5590ecf38a9f9897c93e686e3da1858b/testing/cmake/test_files/test1.txt" ) set(output_file "${CMAKE_CURRENT_BINARY_DIR}/download_test/test_file.txt") # Expected SHA256 of the test file (content: "This is a test file for rapids-cmake download tests.") @@ -32,8 +33,13 @@ endif() # Test 2: Download with custom retry parameters set(output_file2 "${CMAKE_CURRENT_BINARY_DIR}/download_test/test_file2.txt") -rapids_cmake_download_with_retry("${test_url}" "${output_file2}" "${expected_sha256}" MAX_RETRIES 2 - RETRY_DELAY 1) +rapids_cmake_download_with_retry( + "${test_url}" + "${output_file2}" + "${expected_sha256}" + MAX_RETRIES 2 + RETRY_DELAY 1 +) if(NOT EXISTS "${output_file2}") message(FATAL_ERROR "Download with custom parameters failed - file does not exist") endif() diff --git a/testing/cmake/download_with_retry-overwrite.cmake b/testing/cmake/download_with_retry-overwrite.cmake index a8a3d544..cceb7ea6 100644 --- a/testing/cmake/download_with_retry-overwrite.cmake +++ b/testing/cmake/download_with_retry-overwrite.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -11,11 +11,13 @@ file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/download_test") file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/download_test") # Test URLs - using static test files with known contents -set(test_url1 - "https://raw.githubusercontent.com/rapidsai/rapids-cmake/c0d8c09c5590ecf38a9f9897c93e686e3da1858b/testing/cmake/test_files/test1.txt" +set( + test_url1 + "https://raw.githubusercontent.com/rapidsai/rapids-cmake/c0d8c09c5590ecf38a9f9897c93e686e3da1858b/testing/cmake/test_files/test1.txt" ) -set(test_url2 - "https://raw.githubusercontent.com/rapidsai/rapids-cmake/c0d8c09c5590ecf38a9f9897c93e686e3da1858b/testing/cmake/test_files/test2.txt" +set( + test_url2 + "https://raw.githubusercontent.com/rapidsai/rapids-cmake/c0d8c09c5590ecf38a9f9897c93e686e3da1858b/testing/cmake/test_files/test2.txt" ) set(output_file "${CMAKE_CURRENT_BINARY_DIR}/download_test/overwrite_test.txt") diff --git a/testing/cmake/install_lib_dir-after-gnuinstalldir-include.cmake b/testing/cmake/install_lib_dir-after-gnuinstalldir-include.cmake index a3891a07..af151ba4 100644 --- a/testing/cmake/install_lib_dir-after-gnuinstalldir-include.cmake +++ b/testing/cmake/install_lib_dir-after-gnuinstalldir-include.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -14,17 +14,23 @@ set(old_CMAKE_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR}) rapids_cmake_install_lib_dir(lib_dir) if(NOT DEFINED CMAKE_INSTALL_LIBDIR) - message(FATAL_ERROR "rapids_cmake_install_lib_dir shouldn't have caused the CMAKE_INSTALL_LIBDIR variable to not exist" + message( + FATAL_ERROR + "rapids_cmake_install_lib_dir shouldn't have caused the CMAKE_INSTALL_LIBDIR variable to not exist" ) endif() if(NOT lib_dir STREQUAL CMAKE_INSTALL_LIBDIR) - message(FATAL_ERROR "rapids_cmake_install_lib_dir computed '${lib_dir}', but we expected '${CMAKE_INSTALL_LIBDIR}' as it should match GNUInstallDirs" + message( + FATAL_ERROR + "rapids_cmake_install_lib_dir computed '${lib_dir}', but we expected '${CMAKE_INSTALL_LIBDIR}' as it should match GNUInstallDirs" ) endif() if(NOT lib_dir STREQUAL old_CMAKE_INSTALL_LIBDIR) - message(FATAL_ERROR "rapids_cmake_install_lib_dir computed '${lib_dir}', but we expected '${CMAKE_INSTALL_LIBDIR}' as it should match GNUInstallDirs" + message( + FATAL_ERROR + "rapids_cmake_install_lib_dir computed '${lib_dir}', but we expected '${CMAKE_INSTALL_LIBDIR}' as it should match GNUInstallDirs" ) endif() diff --git a/testing/cmake/install_lib_dir-build.cmake b/testing/cmake/install_lib_dir-build.cmake index b369721d..956ba7e8 100644 --- a/testing/cmake/install_lib_dir-build.cmake +++ b/testing/cmake/install_lib_dir-build.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -13,34 +13,46 @@ set(CMAKE_INSTALL_PREFIX "/opt/conda/prefix") rapids_cmake_install_lib_dir(lib_dir) if(NOT lib_dir STREQUAL "lib") - message(FATAL_ERROR "rapids_cmake_install_lib_dir computed '${lib_dir}', but we expected 'lib' as we are in a CONDA env" + message( + FATAL_ERROR + "rapids_cmake_install_lib_dir computed '${lib_dir}', but we expected 'lib' as we are in a CONDA env" ) endif() # verify CMAKE_INSTALL_LIBDIR doesn't exist if(DEFINED CMAKE_INSTALL_LIBDIR) - message(FATAL_ERROR "rapids_cmake_install_lib_dir shouldn't have caused the CMAKE_INSTALL_LIBDIR variable to exist" + message( + FATAL_ERROR + "rapids_cmake_install_lib_dir shouldn't have caused the CMAKE_INSTALL_LIBDIR variable to exist" ) endif() rapids_cmake_install_lib_dir(lib_dir MODIFY_INSTALL_LIBDIR) if(NOT lib_dir STREQUAL "lib") - message(FATAL_ERROR "rapids_cmake_install_lib_dir computed '${lib_dir}', but we expected 'lib' as we are in a CONDA env" + message( + FATAL_ERROR + "rapids_cmake_install_lib_dir computed '${lib_dir}', but we expected 'lib' as we are in a CONDA env" ) endif() if(NOT CMAKE_INSTALL_LIBDIR STREQUAL "lib") - message(FATAL_ERROR "CMAKE_INSTALL_LIBDIR computed to '${CMAKE_INSTALL_LIBDIR}', but we expected 'lib' as we are in a CONDA env" + message( + FATAL_ERROR + "CMAKE_INSTALL_LIBDIR computed to '${CMAKE_INSTALL_LIBDIR}', but we expected 'lib' as we are in a CONDA env" ) endif() if(NOT $CACHE{CMAKE_INSTALL_LIBDIR} STREQUAL "lib") - message(FATAL_ERROR "CACHE{CMAKE_INSTALL_LIBDIR} computed to '${CMAKE_INSTALL_LIBDIR}', but we expected 'lib' as we are in a CONDA env" + message( + FATAL_ERROR + "CACHE{CMAKE_INSTALL_LIBDIR} computed to '${CMAKE_INSTALL_LIBDIR}', but we expected 'lib' as we are in a CONDA env" ) endif() # verify CMAKE_INSTALL_LIBDIR touched if(NOT DEFINED CMAKE_INSTALL_LIBDIR) - message(FATAL_ERROR "rapids_cmake_install_lib_dir should have caused the CMAKE_INSTALL_LIBDIR to be a local variable" + message( + FATAL_ERROR + "rapids_cmake_install_lib_dir should have caused the CMAKE_INSTALL_LIBDIR to be a local variable" ) endif() diff --git a/testing/cmake/install_lib_dir-lib64-with-conda_build.cmake b/testing/cmake/install_lib_dir-lib64-with-conda_build.cmake index 2b0349bc..074c6972 100644 --- a/testing/cmake/install_lib_dir-lib64-with-conda_build.cmake +++ b/testing/cmake/install_lib_dir-lib64-with-conda_build.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -19,7 +19,9 @@ endif() # verify CMAKE_INSTALL_LIBDIR doesn't exist if(NOT CMAKE_INSTALL_LIBDIR STREQUAL "lib64") - message(FATAL_ERROR "CMAKE_INSTALL_LIBDIR now set to '${CMAKE_INSTALL_LIBDIR}', but we expected 'lib64'" + message( + FATAL_ERROR + "CMAKE_INSTALL_LIBDIR now set to '${CMAKE_INSTALL_LIBDIR}', but we expected 'lib64'" ) endif() @@ -35,7 +37,9 @@ endif() # verify CMAKE_INSTALL_LIBDIR doesn't exist if(NOT CMAKE_INSTALL_LIBDIR STREQUAL "lib") - message(FATAL_ERROR "CMAKE_INSTALL_LIBDIR now set to '${CMAKE_INSTALL_LIBDIR}', but we expected 'lib'" + message( + FATAL_ERROR + "CMAKE_INSTALL_LIBDIR now set to '${CMAKE_INSTALL_LIBDIR}', but we expected 'lib'" ) endif() diff --git a/testing/cmake/install_lib_dir-lib64-with-conda_prefix.cmake b/testing/cmake/install_lib_dir-lib64-with-conda_prefix.cmake index 058589a5..ee6a0e1a 100644 --- a/testing/cmake/install_lib_dir-lib64-with-conda_prefix.cmake +++ b/testing/cmake/install_lib_dir-lib64-with-conda_prefix.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -21,7 +21,9 @@ endif() # verify CMAKE_INSTALL_LIBDIR doesn't exist if(NOT CMAKE_INSTALL_LIBDIR STREQUAL "lib64") - message(FATAL_ERROR "CMAKE_INSTALL_LIBDIR now set to '${CMAKE_INSTALL_LIBDIR}', but we expected 'lib64'" + message( + FATAL_ERROR + "CMAKE_INSTALL_LIBDIR now set to '${CMAKE_INSTALL_LIBDIR}', but we expected 'lib64'" ) endif() @@ -37,7 +39,9 @@ endif() # verify CMAKE_INSTALL_LIBDIR doesn't exist if(NOT CMAKE_INSTALL_LIBDIR STREQUAL "lib") - message(FATAL_ERROR "CMAKE_INSTALL_LIBDIR now set to '${CMAKE_INSTALL_LIBDIR}', but we expected 'lib'" + message( + FATAL_ERROR + "CMAKE_INSTALL_LIBDIR now set to '${CMAKE_INSTALL_LIBDIR}', but we expected 'lib'" ) endif() diff --git a/testing/cmake/install_lib_dir-no-conda.cmake b/testing/cmake/install_lib_dir-no-conda.cmake index c153a3ae..ee41c120 100644 --- a/testing/cmake/install_lib_dir-no-conda.cmake +++ b/testing/cmake/install_lib_dir-no-conda.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -11,13 +11,17 @@ unset(ENV{CONDA_PREFIX}) rapids_cmake_install_lib_dir(lib_dir) if(DEFINED CMAKE_INSTALL_LIBDIR) - message(FATAL_ERROR "rapids_cmake_install_lib_dir shouldn't have caused the CMAKE_INSTALL_LIBDIR variable to exist" + message( + FATAL_ERROR + "rapids_cmake_install_lib_dir shouldn't have caused the CMAKE_INSTALL_LIBDIR variable to exist" ) endif() include(GNUInstallDirs) if(NOT lib_dir STREQUAL CMAKE_INSTALL_LIBDIR) - message(FATAL_ERROR "rapids_cmake_install_lib_dir computed '${lib_dir}', but we expected '${CMAKE_INSTALL_LIBDIR}' as it should match GNUInstallDirs" + message( + FATAL_ERROR + "rapids_cmake_install_lib_dir computed '${lib_dir}', but we expected '${CMAKE_INSTALL_LIBDIR}' as it should match GNUInstallDirs" ) endif() diff --git a/testing/cmake/install_lib_dir-prefix.cmake b/testing/cmake/install_lib_dir-prefix.cmake index e9693d1a..a24f166f 100644 --- a/testing/cmake/install_lib_dir-prefix.cmake +++ b/testing/cmake/install_lib_dir-prefix.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -15,34 +15,46 @@ set(CMAKE_INSTALL_PREFIX "/opt/conda/prefix") rapids_cmake_install_lib_dir(lib_dir) if(NOT lib_dir STREQUAL "lib") - message(FATAL_ERROR "rapids_cmake_install_lib_dir computed '${lib_dir}', but we expected 'lib' as we are in a CONDA env" + message( + FATAL_ERROR + "rapids_cmake_install_lib_dir computed '${lib_dir}', but we expected 'lib' as we are in a CONDA env" ) endif() # verify CMAKE_INSTALL_LIBDIR doesn't exist if(DEFINED CMAKE_INSTALL_LIBDIR) - message(FATAL_ERROR "rapids_cmake_install_lib_dir shouldn't have caused the CMAKE_INSTALL_LIBDIR variable to exist" + message( + FATAL_ERROR + "rapids_cmake_install_lib_dir shouldn't have caused the CMAKE_INSTALL_LIBDIR variable to exist" ) endif() rapids_cmake_install_lib_dir(lib_dir MODIFY_INSTALL_LIBDIR) if(NOT lib_dir STREQUAL "lib") - message(FATAL_ERROR "rapids_cmake_install_lib_dir computed '${lib_dir}', but we expected 'lib' as we are in a CONDA env" + message( + FATAL_ERROR + "rapids_cmake_install_lib_dir computed '${lib_dir}', but we expected 'lib' as we are in a CONDA env" ) endif() if(NOT CMAKE_INSTALL_LIBDIR STREQUAL "lib") - message(FATAL_ERROR "CMAKE_INSTALL_LIBDIR computed to '${CMAKE_INSTALL_LIBDIR}', but we expected 'lib' as we are in a CONDA env" + message( + FATAL_ERROR + "CMAKE_INSTALL_LIBDIR computed to '${CMAKE_INSTALL_LIBDIR}', but we expected 'lib' as we are in a CONDA env" ) endif() if(NOT $CACHE{CMAKE_INSTALL_LIBDIR} STREQUAL "lib") - message(FATAL_ERROR "CACHE{CMAKE_INSTALL_LIBDIR} computed to '${CMAKE_INSTALL_LIBDIR}', but we expected 'lib' as we are in a CONDA env" + message( + FATAL_ERROR + "CACHE{CMAKE_INSTALL_LIBDIR} computed to '${CMAKE_INSTALL_LIBDIR}', but we expected 'lib' as we are in a CONDA env" ) endif() # verify CMAKE_INSTALL_LIBDIR touched if(NOT DEFINED CMAKE_INSTALL_LIBDIR) - message(FATAL_ERROR "rapids_cmake_install_lib_dir should have caused the CMAKE_INSTALL_LIBDIR to be a local variable" + message( + FATAL_ERROR + "rapids_cmake_install_lib_dir should have caused the CMAKE_INSTALL_LIBDIR to be a local variable" ) endif() diff --git a/testing/cmake/write_git_revision-custom-prefix/CMakeLists.txt b/testing/cmake/write_git_revision-custom-prefix/CMakeLists.txt index 255796e0..2b31b4de 100644 --- a/testing/cmake/write_git_revision-custom-prefix/CMakeLists.txt +++ b/testing/cmake/write_git_revision-custom-prefix/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -9,10 +9,15 @@ include(${rapids-cmake-dir}/cmake/write_git_revision_file.cmake) cmake_minimum_required(VERSION 3.30.4) project(DEMO VERSION 2.4 LANGUAGES CXX) -rapids_cmake_write_git_revision_file(demo_version - "${CMAKE_CURRENT_BINARY_DIR}/demo/demo_git_version.hpp") rapids_cmake_write_git_revision_file( - nested_version "${CMAKE_CURRENT_BINARY_DIR}/nested/nested_git_version.h" PREFIX NESTED) + demo_version + "${CMAKE_CURRENT_BINARY_DIR}/demo/demo_git_version.hpp" +) +rapids_cmake_write_git_revision_file( + nested_version + "${CMAKE_CURRENT_BINARY_DIR}/nested/nested_git_version.h" + PREFIX NESTED +) add_executable(write_git_version main.cpp) target_link_libraries(write_git_version PRIVATE demo_version nested_version) diff --git a/testing/cmake/write_git_revision-dirty/CMakeLists.txt b/testing/cmake/write_git_revision-dirty/CMakeLists.txt index e14921d3..af4b3aba 100644 --- a/testing/cmake/write_git_revision-dirty/CMakeLists.txt +++ b/testing/cmake/write_git_revision-dirty/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -10,14 +10,17 @@ cmake_minimum_required(VERSION 3.30.4) project(DEMO VERSION 2.4 LANGUAGES CXX) -rapids_cmake_write_git_revision_file(git_generated_header - "${CMAKE_CURRENT_BINARY_DIR}/git_version.hpp") +rapids_cmake_write_git_revision_file( + git_generated_header + "${CMAKE_CURRENT_BINARY_DIR}/git_version.hpp" +) -execute_process(COMMAND ${GIT_EXECUTABLE} describe --tag --dirty --always - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - ERROR_QUIET - OUTPUT_VARIABLE RAPIDS_WRITE_VERSION - OUTPUT_STRIP_TRAILING_WHITESPACE # need to strip off any newline +execute_process( + COMMAND ${GIT_EXECUTABLE} describe --tag --dirty --always + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + ERROR_QUIET + OUTPUT_VARIABLE RAPIDS_WRITE_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE # need to strip off any newline ) add_executable(is_dirty main.cpp) diff --git a/testing/cmake/write_git_revision-embed/CMakeLists.txt b/testing/cmake/write_git_revision-embed/CMakeLists.txt index 7554d444..f0f39741 100644 --- a/testing/cmake/write_git_revision-embed/CMakeLists.txt +++ b/testing/cmake/write_git_revision-embed/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -9,8 +9,10 @@ include(${rapids-cmake-dir}/cmake/write_git_revision_file.cmake) cmake_minimum_required(VERSION 3.30.4) project(DEMO VERSION 2.4 LANGUAGES CXX) -rapids_cmake_write_git_revision_file(git_generated_header - "${CMAKE_CURRENT_BINARY_DIR}/demo/git_version.hpp") +rapids_cmake_write_git_revision_file( + git_generated_header + "${CMAKE_CURRENT_BINARY_DIR}/demo/git_version.hpp" +) add_executable(embed_git_version main.cpp) target_link_libraries(embed_git_version PRIVATE git_generated_header) @@ -20,9 +22,11 @@ target_compile_features(embed_git_version PRIVATE cxx_std_14) find_package(Git QUIET) -add_custom_command(TARGET embed_git_version - POST_BUILD - COMMAND ${CMAKE_COMMAND} -DWORKING_DIRECTORY=${CMAKE_CURRENT_SOURCE_DIR} - -DEXECUTABLE=$ - -DGIT_EXECUTABLE=${GIT_EXECUTABLE} -P - ${CMAKE_CURRENT_SOURCE_DIR}/verify_embedding.cmake) +add_custom_command( + TARGET embed_git_version + POST_BUILD + COMMAND + ${CMAKE_COMMAND} -DWORKING_DIRECTORY=${CMAKE_CURRENT_SOURCE_DIR} + -DEXECUTABLE=$ -DGIT_EXECUTABLE=${GIT_EXECUTABLE} -P + ${CMAKE_CURRENT_SOURCE_DIR}/verify_embedding.cmake +) diff --git a/testing/cmake/write_git_revision-embed/verify_embedding.cmake b/testing/cmake/write_git_revision-embed/verify_embedding.cmake index ac16ed76..cf53863b 100644 --- a/testing/cmake/write_git_revision-embed/verify_embedding.cmake +++ b/testing/cmake/write_git_revision-embed/verify_embedding.cmake @@ -1,29 +1,32 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= cmake_minimum_required(VERSION 3.30.4) file(STRINGS "${EXECUTABLE}" contents) -execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse HEAD - WORKING_DIRECTORY ${WORKING_DIRECTORY} - ERROR_QUIET - OUTPUT_VARIABLE RAPIDS_WRITE_SHA1 - OUTPUT_STRIP_TRAILING_WHITESPACE # need to strip off any newline +execute_process( + COMMAND ${GIT_EXECUTABLE} rev-parse HEAD + WORKING_DIRECTORY ${WORKING_DIRECTORY} + ERROR_QUIET + OUTPUT_VARIABLE RAPIDS_WRITE_SHA1 + OUTPUT_STRIP_TRAILING_WHITESPACE # need to strip off any newline ) -execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD - WORKING_DIRECTORY ${WORKING_DIRECTORY} - ERROR_QUIET - OUTPUT_VARIABLE RAPIDS_WRITE_BRANCH - OUTPUT_STRIP_TRAILING_WHITESPACE # need to strip off any newline +execute_process( + COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD + WORKING_DIRECTORY ${WORKING_DIRECTORY} + ERROR_QUIET + OUTPUT_VARIABLE RAPIDS_WRITE_BRANCH + OUTPUT_STRIP_TRAILING_WHITESPACE # need to strip off any newline ) -execute_process(COMMAND ${GIT_EXECUTABLE} describe --tag --dirty --always - WORKING_DIRECTORY ${WORKING_DIRECTORY} - ERROR_QUIET - OUTPUT_VARIABLE RAPIDS_WRITE_VERSION - OUTPUT_STRIP_TRAILING_WHITESPACE # need to strip off any newline +execute_process( + COMMAND ${GIT_EXECUTABLE} describe --tag --dirty --always + WORKING_DIRECTORY ${WORKING_DIRECTORY} + ERROR_QUIET + OUTPUT_VARIABLE RAPIDS_WRITE_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE # need to strip off any newline ) if(NOT contents MATCHES "sha1=${RAPIDS_WRITE_SHA1}") diff --git a/testing/cmake/write_git_revision-no-git/gen_header/CMakeLists.txt b/testing/cmake/write_git_revision-no-git/gen_header/CMakeLists.txt index 5bf9e813..8b34b412 100644 --- a/testing/cmake/write_git_revision-no-git/gen_header/CMakeLists.txt +++ b/testing/cmake/write_git_revision-no-git/gen_header/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -10,5 +10,7 @@ include(${rapids-cmake-dir}/cmake/write_git_revision_file.cmake) # git doesn't exist find_package(Git) set(GIT_EXECUTABLE "/fake/path") -rapids_cmake_write_git_revision_file(git_generated_header - "${CMAKE_CURRENT_BINARY_DIR}/demo/git_version.hpp") +rapids_cmake_write_git_revision_file( + git_generated_header + "${CMAKE_CURRENT_BINARY_DIR}/demo/git_version.hpp" +) diff --git a/testing/cmake/write_git_revision-no-git/verify_embedding.cmake b/testing/cmake/write_git_revision-no-git/verify_embedding.cmake index ac16ed76..cf53863b 100644 --- a/testing/cmake/write_git_revision-no-git/verify_embedding.cmake +++ b/testing/cmake/write_git_revision-no-git/verify_embedding.cmake @@ -1,29 +1,32 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= cmake_minimum_required(VERSION 3.30.4) file(STRINGS "${EXECUTABLE}" contents) -execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse HEAD - WORKING_DIRECTORY ${WORKING_DIRECTORY} - ERROR_QUIET - OUTPUT_VARIABLE RAPIDS_WRITE_SHA1 - OUTPUT_STRIP_TRAILING_WHITESPACE # need to strip off any newline +execute_process( + COMMAND ${GIT_EXECUTABLE} rev-parse HEAD + WORKING_DIRECTORY ${WORKING_DIRECTORY} + ERROR_QUIET + OUTPUT_VARIABLE RAPIDS_WRITE_SHA1 + OUTPUT_STRIP_TRAILING_WHITESPACE # need to strip off any newline ) -execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD - WORKING_DIRECTORY ${WORKING_DIRECTORY} - ERROR_QUIET - OUTPUT_VARIABLE RAPIDS_WRITE_BRANCH - OUTPUT_STRIP_TRAILING_WHITESPACE # need to strip off any newline +execute_process( + COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD + WORKING_DIRECTORY ${WORKING_DIRECTORY} + ERROR_QUIET + OUTPUT_VARIABLE RAPIDS_WRITE_BRANCH + OUTPUT_STRIP_TRAILING_WHITESPACE # need to strip off any newline ) -execute_process(COMMAND ${GIT_EXECUTABLE} describe --tag --dirty --always - WORKING_DIRECTORY ${WORKING_DIRECTORY} - ERROR_QUIET - OUTPUT_VARIABLE RAPIDS_WRITE_VERSION - OUTPUT_STRIP_TRAILING_WHITESPACE # need to strip off any newline +execute_process( + COMMAND ${GIT_EXECUTABLE} describe --tag --dirty --always + WORKING_DIRECTORY ${WORKING_DIRECTORY} + ERROR_QUIET + OUTPUT_VARIABLE RAPIDS_WRITE_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE # need to strip off any newline ) if(NOT contents MATCHES "sha1=${RAPIDS_WRITE_SHA1}") diff --git a/testing/cmake/write_git_revision-simple/CMakeLists.txt b/testing/cmake/write_git_revision-simple/CMakeLists.txt index 2e6788f1..c88a3a1d 100644 --- a/testing/cmake/write_git_revision-simple/CMakeLists.txt +++ b/testing/cmake/write_git_revision-simple/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -10,12 +10,16 @@ include(${rapids-cmake-dir}/export/export.cmake) cmake_minimum_required(VERSION 3.30.4) project(DEMO VERSION 2.4 LANGUAGES CXX) -rapids_cmake_write_git_revision_file(demo_version - "${CMAKE_CURRENT_BINARY_DIR}/demo/demo_git_version.hpp") +rapids_cmake_write_git_revision_file( + demo_version + "${CMAKE_CURRENT_BINARY_DIR}/demo/demo_git_version.hpp" +) project(NESTED VERSION 3.14.159 LANGUAGES NONE) -rapids_cmake_write_git_revision_file(nested_version - "${CMAKE_CURRENT_BINARY_DIR}/nested/nested_git_version.h") +rapids_cmake_write_git_revision_file( + nested_version + "${CMAKE_CURRENT_BINARY_DIR}/nested/nested_git_version.h" +) add_executable(write_git_version main.cpp) target_link_libraries(write_git_version PRIVATE demo_version nested_version) @@ -25,21 +29,27 @@ install(TARGETS write_git_version EXPORT write_git) rapids_export(BUILD DEMO EXPORT_SET write_git) # write out the cmake file used to verify the copyright -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/verify_copyright.cmake - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/verify_copyright.cmake + [=[ include(${rapids-cmake-testing-dir}/utils/check_copyright_header.cmake) check_copyright_header("${WORKING_DIRECTORY}/demo/demo_git_version.hpp") check_copyright_header("${WORKING_DIRECTORY}/nested/nested_git_version.h") -]=]) +]=] +) # Setup a custom build target that verifies that our generated git version header files have the # correct copyright year -add_custom_target(verify_git_info ALL - COMMENT "verify copyright in generate git revision file for write_git_version" - COMMAND ${CMAKE_COMMAND} -DWORKING_DIRECTORY=${CMAKE_CURRENT_BINARY_DIR} - -Drapids-cmake-testing-dir=${rapids-cmake-testing-dir} -P - ${CMAKE_CURRENT_BINARY_DIR}/verify_copyright.cmake - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_custom_target( + verify_git_info + ALL + COMMENT "verify copyright in generate git revision file for write_git_version" + COMMAND + ${CMAKE_COMMAND} -DWORKING_DIRECTORY=${CMAKE_CURRENT_BINARY_DIR} + -Drapids-cmake-testing-dir=${rapids-cmake-testing-dir} -P + ${CMAKE_CURRENT_BINARY_DIR}/verify_copyright.cmake + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} +) add_dependencies(verify_git_info demo_version_compute_git_info) add_dependencies(verify_git_info nested_version_compute_git_info) diff --git a/testing/cpm/CMakeLists.txt b/testing/cpm/CMakeLists.txt index aea17eab..07f11f89 100644 --- a/testing/cpm/CMakeLists.txt +++ b/testing/cpm/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -22,8 +22,12 @@ add_cmake_config_test(cpm_find-options-escaped) add_cmake_config_test(cpm_find-patch-command NO_CPM_CACHE) add_cmake_config_test(cpm_find-patch-command-embedded NO_CPM_CACHE) add_cmake_config_test(cpm_find-patch-command-required NO_CPM_CACHE) -add_cmake_config_test(cpm_find-patch-command-required-fails NO_CPM_CACHE SHOULD_FAIL - "rapids-cmake [GTest]: failed to apply patch") +add_cmake_config_test( + cpm_find-patch-command-required-fails + NO_CPM_CACHE + SHOULD_FAIL + "rapids-cmake [GTest]: failed to apply patch" +) add_cmake_config_test(cpm_find-restore-cpm-vars) add_cmake_config_test(cpm_find-version-explicit-install.cmake) @@ -40,10 +44,16 @@ add_cmake_config_test(cpm_convert_patch_json-special-chars.cmake) add_cmake_config_test(cpm_init-bad-default-path.cmake SHOULD_FAIL "rapids_cpm_init can't load") add_cmake_config_test(cpm_init-bad-default-cmake-var.cmake SHOULD_FAIL "rapids_cpm_init can't load") -add_cmake_config_test(cpm_init-bad-override-path.cmake SHOULD_FAIL - "rapids_cpm_package_override can't load") -add_cmake_config_test(cpm_init-bad-override-cmake-var.cmake SHOULD_FAIL - "rapids_cpm_package_override can't load") +add_cmake_config_test( + cpm_init-bad-override-path.cmake + SHOULD_FAIL + "rapids_cpm_package_override can't load" +) +add_cmake_config_test( + cpm_init-bad-override-cmake-var.cmake + SHOULD_FAIL + "rapids_cpm_package_override can't load" +) add_cmake_config_test(cpm_init-custom-default-simple.cmake) add_cmake_config_test(cpm_init-custom-default-multiple.cmake) add_cmake_config_test(cpm_init-custom-default-via-cmake-var.cmake) @@ -52,8 +62,11 @@ add_cmake_config_test(cpm_init-override-simple.cmake) add_cmake_config_test(cpm_init-override-via-cmake-var.cmake) add_cmake_config_test(cpm_package_override-add-new-project.cmake) -add_cmake_config_test(cpm_package_override-bad-path.cmake SHOULD_FAIL - "rapids_cpm_package_override can't load") +add_cmake_config_test( + cpm_package_override-bad-path.cmake + SHOULD_FAIL + "rapids_cpm_package_override can't load" +) add_cmake_config_test(cpm_package_override-before-init.cmake) add_cmake_config_test(cpm_package_override-defaults-with-different-casing.cmake) add_cmake_config_test(cpm_package_override-defaults-with-different-casing-warning.cmake) @@ -62,8 +75,11 @@ add_cmake_config_test(cpm_package_override-empty.cmake) add_cmake_config_test(cpm_package_override-env-var-support.cmake) add_cmake_config_test(cpm_package_override-multiple-cmake-var.cmake) add_cmake_config_test(cpm_package_override-multiple.cmake) -add_cmake_config_test(cpm_package_override-no-version-value.cmake SHOULD_FAIL - "rapids_cmake can't parse") +add_cmake_config_test( + cpm_package_override-no-version-value.cmake + SHOULD_FAIL + "rapids_cmake can't parse" +) add_cmake_config_test(cpm_package_override-obey-cpm-source-var.cmake) add_cmake_config_test(cpm_package_override-patches.cmake) add_cmake_config_test(cpm_package_override-source-subdir.cmake) diff --git a/testing/cpm/cpm_bs_thread_pool-build-config-works.cmake b/testing/cpm/cpm_bs_thread_pool-build-config-works.cmake index f3d36f9d..fa56b187 100644 --- a/testing/cpm/cpm_bs_thread_pool-build-config-works.cmake +++ b/testing/cpm/cpm_bs_thread_pool-build-config-works.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -11,8 +11,9 @@ rapids_cpm_init() rapids_cpm_bs_thread_pool(BUILD_EXPORT_SET test) # Add a custom command that verifies that the expect files have been installed for each component -file(WRITE "${CMAKE_BINARY_DIR}/check_bs_thread_pool_dir/CMakeLists.txt" - " +file( + WRITE "${CMAKE_BINARY_DIR}/check_bs_thread_pool_dir/CMakeLists.txt" + " cmake_minimum_required(VERSION 3.30.4) project(verify_bs_thread_pool LANGUAGES CXX) @@ -22,11 +23,15 @@ find_package(bs_thread_pool REQUIRED) file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/stub.cpp\" \"#include \") add_library(uses_bs_thread_pool SHARED stub.cpp) target_link_libraries(uses_bs_thread_pool PRIVATE BS::thread_pool) -") +" +) -add_custom_target(verify_build_config ALL - COMMAND ${CMAKE_COMMAND} -E rm -rf - "${CMAKE_BINARY_DIR}/check_bs_thread_pool_dir/build" - COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/check_bs_thread_pool_dir" - -B="${CMAKE_BINARY_DIR}/build" - COMMAND ${CMAKE_COMMAND} --build "${CMAKE_BINARY_DIR}/build") +add_custom_target( + verify_build_config + ALL + COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/check_bs_thread_pool_dir/build" + COMMAND + ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/check_bs_thread_pool_dir" + -B="${CMAKE_BINARY_DIR}/build" + COMMAND ${CMAKE_COMMAND} --build "${CMAKE_BINARY_DIR}/build" +) diff --git a/testing/cpm/cpm_bs_thread_pool-export.cmake b/testing/cpm/cpm_bs_thread_pool-export.cmake index cf4fb4b6..325f6b99 100644 --- a/testing/cpm/cpm_bs_thread_pool-export.cmake +++ b/testing/cpm/cpm_bs_thread_pool-export.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -14,12 +14,16 @@ rapids_cpm_bs_thread_pool(INSTALL_EXPORT_SET test2) get_target_property(packages rapids_export_build_test PACKAGE_NAMES) if(NOT bs_thread_pool IN_LIST packages) - message(FATAL_ERROR "rapids_cpm_bs_thread_pool failed to record bs_thread_pool needs to be exported" + message( + FATAL_ERROR + "rapids_cpm_bs_thread_pool failed to record bs_thread_pool needs to be exported" ) endif() get_target_property(packages rapids_export_install_test2 PACKAGE_NAMES) if(NOT bs_thread_pool IN_LIST packages) - message(FATAL_ERROR "rapids_cpm_bs_thread_pool failed to record bs_thread_pool needs to be exported" + message( + FATAL_ERROR + "rapids_cpm_bs_thread_pool failed to record bs_thread_pool needs to be exported" ) endif() diff --git a/testing/cpm/cpm_bs_thread_pool-install-config-works.cmake b/testing/cpm/cpm_bs_thread_pool-install-config-works.cmake index dcc32ef1..4fa7a921 100644 --- a/testing/cpm/cpm_bs_thread_pool-install-config-works.cmake +++ b/testing/cpm/cpm_bs_thread_pool-install-config-works.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -11,8 +11,9 @@ rapids_cpm_init() rapids_cpm_bs_thread_pool(BUILD_EXPORT_SET test) # Add a custom command that verifies that the expect files have been installed for each component -file(WRITE "${CMAKE_BINARY_DIR}/check_bs_thread_pool_dir/CMakeLists.txt" - " +file( + WRITE "${CMAKE_BINARY_DIR}/check_bs_thread_pool_dir/CMakeLists.txt" + " cmake_minimum_required(VERSION 3.30.4) project(verify_bs_thread_pool LANGUAGES CXX) @@ -22,12 +23,16 @@ find_package(bs_thread_pool REQUIRED) file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/stub.cpp\" \"#include \") add_library(uses_bs_thread_pool SHARED stub.cpp) target_link_libraries(uses_bs_thread_pool PRIVATE BS::thread_pool) -") +" +) -add_custom_target(verify_build_config ALL - COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --prefix ./install/ - COMMAND ${CMAKE_COMMAND} -E rm -rf - "${CMAKE_BINARY_DIR}/check_bs_thread_pool_dir/build" - COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/check_bs_thread_pool_dir" - -B="${CMAKE_BINARY_DIR}/build" - COMMAND ${CMAKE_COMMAND} --build "${CMAKE_BINARY_DIR}/build") +add_custom_target( + verify_build_config + ALL + COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --prefix ./install/ + COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/check_bs_thread_pool_dir/build" + COMMAND + ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/check_bs_thread_pool_dir" + -B="${CMAKE_BINARY_DIR}/build" + COMMAND ${CMAKE_COMMAND} --build "${CMAKE_BINARY_DIR}/build" +) diff --git a/testing/cpm/cpm_cccl-enable-unstable.cmake b/testing/cpm/cpm_cccl-enable-unstable.cmake index efdf3a8f..75782d5a 100644 --- a/testing/cpm/cpm_cccl-enable-unstable.cmake +++ b/testing/cpm/cpm_cccl-enable-unstable.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -18,7 +18,14 @@ endif() rapids_cpm_cccl(ENABLE_UNSTABLE) # Test that all expected targets exist, including CCCL::cudax -set(targets CCCL::CCCL CCCL::CUB CCCL::libcudacxx CCCL::Thrust CCCL::cudax) +set( + targets + CCCL::CCCL + CCCL::CUB + CCCL::libcudacxx + CCCL::Thrust + CCCL::cudax +) foreach(target IN LISTS targets) if(NOT TARGET ${target}) message(FATAL_ERROR "Expected ${target} to exist") diff --git a/testing/cpm/cpm_cccl-preserve-custom-install-loc/CMakeLists.txt b/testing/cpm/cpm_cccl-preserve-custom-install-loc/CMakeLists.txt index 7acc6f5f..46a78510 100644 --- a/testing/cpm/cpm_cccl-preserve-custom-install-loc/CMakeLists.txt +++ b/testing/cpm/cpm_cccl-preserve-custom-install-loc/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -29,12 +29,16 @@ call_cccl_with_custom_install_loc() rapids_cpm_cccl(INSTALL_EXPORT_SET export_set) # Install our project so we can verify `cccl`/`thrust` has preserved the correct install location -add_custom_target(install_project ALL COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" - --prefix check_thrust/install/) +add_custom_target( + install_project + ALL + COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --prefix check_thrust/install/ +) # Add a custom command that verifies that the expect files have been installed for each component -file(WRITE "${CMAKE_BINARY_DIR}/check_thrust/CMakeLists.txt" - [=[ +file( + WRITE "${CMAKE_BINARY_DIR}/check_thrust/CMakeLists.txt" + [=[ cmake_minimum_required(VERSION 3.20) project(verify_install_targets LANGUAGES CXX) @@ -52,10 +56,14 @@ set(expected "../../../../../../") if(NOT from_install_prefix STREQUAL expected) message(FATAL_ERROR "thrust-header-search.cmake contains the wrong 'from_install_prefix'. Expected '${expected}' but found '${from_install_prefix}'") endif() -]=]) +]=] +) -add_custom_target(verify_thrust_header_search ALL - COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/check_thrust/build" - COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/check_thrust" - -B="${CMAKE_BINARY_DIR}/install/build") +add_custom_target( + verify_thrust_header_search + ALL + COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/check_thrust/build" + COMMAND + ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/check_thrust" -B="${CMAKE_BINARY_DIR}/install/build" +) add_dependencies(verify_thrust_header_search install_project) diff --git a/testing/cpm/cpm_cccl-version-2-8.cmake b/testing/cpm/cpm_cccl-version-2-8.cmake index fd606118..70942943 100644 --- a/testing/cpm/cpm_cccl-version-2-8.cmake +++ b/testing/cpm/cpm_cccl-version-2-8.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -15,8 +15,9 @@ set(CMAKE_INSTALL_INCLUDEDIR "include") rapids_cpm_init() # Need to write out an override file -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json + [=[ { "packages": { "CCCL": { @@ -27,19 +28,24 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json } } } - ]=]) + ]=] +) rapids_cpm_package_override(${CMAKE_CURRENT_BINARY_DIR}/override.json) rapids_cpm_cccl(INSTALL_EXPORT_SET export_set) # Install our project so we can verify `cccl`/`thrust` has preserved the correct install location -add_custom_target(install_project ALL COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" - --prefix check_cccl/install/) +add_custom_target( + install_project + ALL + COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --prefix check_cccl/install/ +) # Add a custom command that verifies that the expect files have been installed for each component -file(WRITE "${CMAKE_BINARY_DIR}/check_cccl/CMakeLists.txt" - [=[ +file( + WRITE "${CMAKE_BINARY_DIR}/check_cccl/CMakeLists.txt" + [=[ cmake_minimum_required(VERSION 3.20) project(verify_install_targets LANGUAGES CXX) @@ -61,10 +67,14 @@ foreach(to_verify IN LISTS include_dirs_to_verify cmake_dirs_to_verify) message(FATAL_ERROR "Failed to find `${path}` location") endif() endforeach() -]=]) +]=] +) -add_custom_target(verify_thrust_header_search ALL - COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/check_cccl/build" - COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/check_cccl" - -B="${CMAKE_BINARY_DIR}/install/build") +add_custom_target( + verify_thrust_header_search + ALL + COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/check_cccl/build" + COMMAND + ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/check_cccl" -B="${CMAKE_BINARY_DIR}/install/build" +) add_dependencies(verify_thrust_header_search install_project) diff --git a/testing/cpm/cpm_cccl-version-3-0.cmake b/testing/cpm/cpm_cccl-version-3-0.cmake index 5a00f92f..6cd19580 100644 --- a/testing/cpm/cpm_cccl-version-3-0.cmake +++ b/testing/cpm/cpm_cccl-version-3-0.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -15,8 +15,9 @@ set(CMAKE_INSTALL_INCLUDEDIR "include") rapids_cpm_init() # Need to write out an override file -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json + [=[ { "packages": { "CCCL": { @@ -27,19 +28,24 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json } } } - ]=]) + ]=] +) rapids_cpm_package_override(${CMAKE_CURRENT_BINARY_DIR}/override.json) rapids_cpm_cccl(INSTALL_EXPORT_SET export_set) # Install our project so we can verify `cccl`/`thrust` has preserved the correct install location -add_custom_target(install_project ALL COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" - --prefix check_cccl/install/) +add_custom_target( + install_project + ALL + COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --prefix check_cccl/install/ +) # Add a custom command that verifies that the expect files have been installed for each component -file(WRITE "${CMAKE_BINARY_DIR}/check_cccl/CMakeLists.txt" - [=[ +file( + WRITE "${CMAKE_BINARY_DIR}/check_cccl/CMakeLists.txt" + [=[ cmake_minimum_required(VERSION 3.20) project(verify_install_targets LANGUAGES CXX) @@ -61,10 +67,14 @@ foreach(to_verify IN LISTS include_dirs_to_verify cmake_dirs_to_verify) message(FATAL_ERROR "Failed to find `${path}` location") endif() endforeach() -]=]) +]=] +) -add_custom_target(verify_thrust_header_search ALL - COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/check_cccl/build" - COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/check_cccl" - -B="${CMAKE_BINARY_DIR}/install/build") +add_custom_target( + verify_thrust_header_search + ALL + COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/check_cccl/build" + COMMAND + ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/check_cccl" -B="${CMAKE_BINARY_DIR}/install/build" +) add_dependencies(verify_thrust_header_search install_project) diff --git a/testing/cpm/cpm_convert_patch_json-special-chars.cmake b/testing/cpm/cpm_convert_patch_json-special-chars.cmake index 86679bd5..4688487b 100644 --- a/testing/cpm/cpm_convert_patch_json-special-chars.cmake +++ b/testing/cpm/cpm_convert_patch_json-special-chars.cmake @@ -1,26 +1,30 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= include(${rapids-cmake-dir}/cpm/detail/convert_patch_json.cmake) -set(bug - [=[#include "file.h" +set( + bug + [=[#include "file.h" int function(not_parsed[ N], properly ) { -}]=]) +}]=] +) set(file_path "${CMAKE_BINARY_DIR}/bug.txt") file(WRITE ${file_path} "${bug}") -set(expected_output - [==[[ +set( + expected_output + [==[[ "#include \"file.h\"", "int function(not_parsed[", "N], properly ) {", "}" -]]==]) +]]==] +) rapids_cpm_convert_patch_json(FROM_FILE_TO_JSON json FILE_VAR file_path) string(JSON json_content GET "${json}" "content") diff --git a/testing/cpm/cpm_find-components/CMakeLists.txt b/testing/cpm/cpm_find-components/CMakeLists.txt index 5f706de4..d427f23c 100644 --- a/testing/cpm/cpm_find-components/CMakeLists.txt +++ b/testing/cpm/cpm_find-components/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -13,8 +13,14 @@ project(rapids-test-project LANGUAGES CXX) set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}") rapids_cpm_init() -rapids_cpm_find(FakeDependency 11 REQUIRED COMPONENTS A B C INSTALL_EXPORT_SET test_export_set - BUILD_EXPORT_SET test_export_set) +rapids_cpm_find( + FakeDependency + 11 + REQUIRED + COMPONENTS A B C + INSTALL_EXPORT_SET test_export_set + BUILD_EXPORT_SET test_export_set +) if(NOT (TARGET FakeDependency::A AND TARGET FakeDependency::B AND TARGET FakeDependency::C)) message(FATAL_ERROR "rapids_cpm_find() failed to propagate COMPONENT A B C") @@ -26,7 +32,9 @@ set(path "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/build/cpm_FakeDepende file(READ "${path}" contents) string(FIND "${contents}" "${to_match_string}" is_found) if(is_found EQUAL -1) - message(FATAL_ERROR "rapids_cpm_find(BUILD) failed to preserve version information in exported file" + message( + FATAL_ERROR + "rapids_cpm_find(BUILD) failed to preserve version information in exported file" ) endif() @@ -34,6 +42,8 @@ set(path "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/install/package_FakeD file(READ "${path}" contents) string(FIND "${contents}" "${to_match_string}" is_found) if(is_found EQUAL -1) - message(FATAL_ERROR "rapids_cpm_find(INSTALL) failed to preserve version information in exported file" + message( + FATAL_ERROR + "rapids_cpm_find(INSTALL) failed to preserve version information in exported file" ) endif() diff --git a/testing/cpm/cpm_find-components/fakedependency-config.cmake b/testing/cpm/cpm_find-components/fakedependency-config.cmake index a05584be..2094c1e5 100644 --- a/testing/cpm/cpm_find-components/fakedependency-config.cmake +++ b/testing/cpm/cpm_find-components/fakedependency-config.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -17,5 +17,8 @@ endforeach() include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(FakeDependency REASON_FAILURE_MESSAGE "${_FAIL_REASON}" - HANDLE_COMPONENTS) +find_package_handle_standard_args( + FakeDependency + REASON_FAILURE_MESSAGE "${_FAIL_REASON}" + HANDLE_COMPONENTS +) diff --git a/testing/cpm/cpm_find-existing-build-dir/CMakeLists.txt b/testing/cpm/cpm_find-existing-build-dir/CMakeLists.txt index f084d9c1..e881a364 100644 --- a/testing/cpm/cpm_find-existing-build-dir/CMakeLists.txt +++ b/testing/cpm/cpm_find-existing-build-dir/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -12,16 +12,27 @@ project(rapids-test-project LANGUAGES CXX) include("${rapids-cmake-testing-dir}/cpm/make_fake_project_build_dir_with_config.cmake") -make_fake_project_build_dir_with_config(RapidsTestFind 2021.01.02 RapidsTestFindConfig.cmake - RapidsTestFindConfigVersion.cmake) +make_fake_project_build_dir_with_config( + RapidsTestFind + 2021.01.02 + RapidsTestFindConfig.cmake + RapidsTestFindConfigVersion.cmake +) -make_fake_project_build_dir_with_config(RapidsTestFind2 0.2 rapidstestfind2-config.cmake - rapidstestfind2-config-version.cmake) +make_fake_project_build_dir_with_config( + RapidsTestFind2 + 0.2 + rapidstestfind2-config.cmake + rapidstestfind2-config-version.cmake +) rapids_cpm_init() -set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_BINARY_DIR}/RapidsTestFind-build/" - "${CMAKE_CURRENT_BINARY_DIR}/RapidsTestFind2-build/") +set( + CMAKE_PREFIX_PATH + "${CMAKE_CURRENT_BINARY_DIR}/RapidsTestFind-build/" + "${CMAKE_CURRENT_BINARY_DIR}/RapidsTestFind2-build/" +) rapids_cpm_find(RapidsTestFind 2021.01.02) rapids_cpm_find(RapidsTestFind2 0.2) diff --git a/testing/cpm/cpm_find-existing-build-dir/RapidsTestFindConfig.cmake b/testing/cpm/cpm_find-existing-build-dir/RapidsTestFindConfig.cmake.in similarity index 100% rename from testing/cpm/cpm_find-existing-build-dir/RapidsTestFindConfig.cmake rename to testing/cpm/cpm_find-existing-build-dir/RapidsTestFindConfig.cmake.in diff --git a/testing/cpm/cpm_find-existing-build-dir/rapidstestfind2-config.cmake b/testing/cpm/cpm_find-existing-build-dir/rapidstestfind2-config.cmake.in similarity index 100% rename from testing/cpm/cpm_find-existing-build-dir/rapidstestfind2-config.cmake rename to testing/cpm/cpm_find-existing-build-dir/rapidstestfind2-config.cmake.in diff --git a/testing/cpm/cpm_find-existing-target-to-export-sets/CMakeLists.txt b/testing/cpm/cpm_find-existing-target-to-export-sets/CMakeLists.txt index 8a91edc3..f98ca5d3 100644 --- a/testing/cpm/cpm_find-existing-target-to-export-sets/CMakeLists.txt +++ b/testing/cpm/cpm_find-existing-target-to-export-sets/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -14,8 +14,12 @@ project(rapids-existing-target LANGUAGES CXX) include("${rapids-cmake-testing-dir}/cpm/make_fake_project_build_dir_with_config.cmake") -make_fake_project_build_dir_with_config(RapidsTestFind 2021.01.02 RapidsTestFindConfig.cmake - RapidsTestFindConfigVersion.cmake) +make_fake_project_build_dir_with_config( + RapidsTestFind + 2021.01.02 + RapidsTestFindConfig.cmake + RapidsTestFindConfigVersion.cmake +) rapids_cpm_init() @@ -23,14 +27,26 @@ set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_BINARY_DIR}/RapidsTestFind-build/") add_library(RapidsTest::RapidsTest IMPORTED INTERFACE) -rapids_cpm_find(RapidsTestFind 2021.01.02 GLOBAL_TARGETS RapidsTest::RapidsTest - INSTALL_EXPORT_SET setA) - -rapids_cpm_find(RapidsTestFind 2021.01.02 GLOBAL_TARGETS RapidsTest::RapidsTest - INSTALL_EXPORT_SET setB) - -rapids_cpm_find(RapidsTestFind 2021.01.02 GLOBAL_TARGETS RapidsTest::RapidsTest - BUILD_EXPORT_SET setB) +rapids_cpm_find( + RapidsTestFind + 2021.01.02 + GLOBAL_TARGETS RapidsTest::RapidsTest + INSTALL_EXPORT_SET setA +) + +rapids_cpm_find( + RapidsTestFind + 2021.01.02 + GLOBAL_TARGETS RapidsTest::RapidsTest + INSTALL_EXPORT_SET setB +) + +rapids_cpm_find( + RapidsTestFind + 2021.01.02 + GLOBAL_TARGETS RapidsTest::RapidsTest + BUILD_EXPORT_SET setB +) function(verify_dependency_file file_name to_match) file(STRINGS "${file_name}" text) @@ -46,7 +62,6 @@ function(verify_dependency_file file_name to_match) if(NOT package_dependency_found) message(FATAL_ERROR "${file_name} failed to export RapidsTestFind properly") endif() - endfunction() set(file_path "${CMAKE_CURRENT_BINARY_DIR}/build_export_set.cmake") diff --git a/testing/cpm/cpm_find-existing-target-to-export-sets/RapidsTestFindConfig.cmake b/testing/cpm/cpm_find-existing-target-to-export-sets/RapidsTestFindConfig.cmake.in similarity index 100% rename from testing/cpm/cpm_find-existing-target-to-export-sets/RapidsTestFindConfig.cmake rename to testing/cpm/cpm_find-existing-target-to-export-sets/RapidsTestFindConfig.cmake.in diff --git a/testing/cpm/cpm_find-existing-target/CMakeLists.txt b/testing/cpm/cpm_find-existing-target/CMakeLists.txt index 069831a3..8d8e1b43 100644 --- a/testing/cpm/cpm_find-existing-target/CMakeLists.txt +++ b/testing/cpm/cpm_find-existing-target/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -12,8 +12,12 @@ project(rapids-existing-target LANGUAGES CXX) include("${rapids-cmake-testing-dir}/cpm/make_fake_project_build_dir_with_config.cmake") -make_fake_project_build_dir_with_config(RapidsTestFind 2021.01.02 RapidsTestFindConfig.cmake - RapidsTestFindConfigVersion.cmake) +make_fake_project_build_dir_with_config( + RapidsTestFind + 2021.01.02 + RapidsTestFindConfig.cmake + RapidsTestFindConfigVersion.cmake +) rapids_cpm_init() diff --git a/testing/cpm/cpm_find-existing-target/RapidsTestFindConfig.cmake b/testing/cpm/cpm_find-existing-target/RapidsTestFindConfig.cmake.in similarity index 100% rename from testing/cpm/cpm_find-existing-target/RapidsTestFindConfig.cmake rename to testing/cpm/cpm_find-existing-target/RapidsTestFindConfig.cmake.in diff --git a/testing/cpm/cpm_find-options-escaped/CMakeLists.txt b/testing/cpm/cpm_find-options-escaped/CMakeLists.txt index 5e3f6881..1f5eea0e 100644 --- a/testing/cpm/cpm_find-options-escaped/CMakeLists.txt +++ b/testing/cpm/cpm_find-options-escaped/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -11,11 +11,16 @@ cmake_minimum_required(VERSION 3.30.4) project(rapids-test-project LANGUAGES CXX) rapids_cpm_init() -rapids_cpm_find(RapidsTest 20.09.00 - GLOBAL_TARGETS RapidsTest::RapidsTest - BUILD_EXPORT_SET example_export_set - CPM_ARGS DOWNLOAD_COMMAND "ls" # Fake comment - OPTIONS "BUILD_TESTS TRUE" "BUILD_EXAMPLES FALSE") +rapids_cpm_find( + RapidsTest + 20.09.00 + GLOBAL_TARGETS RapidsTest::RapidsTest + BUILD_EXPORT_SET example_export_set + CPM_ARGS + DOWNLOAD_COMMAND + "ls" # Fake comment + OPTIONS "BUILD_TESTS TRUE" "BUILD_EXAMPLES FALSE" +) add_library(exampleLib INTERFACE) install(TARGETS exampleLib EXPORT example_export_set) @@ -28,8 +33,9 @@ endif() # We need to validate that we propagate NAME, VERSION, and CPM ARGS properly to the exported # dependency file -set(to_match_string - [=["NAME;RapidsTest;VERSION;20.09.00;DOWNLOAD_COMMAND;ls;OPTIONS;BUILD_TESTS TRUE;BUILD_EXAMPLES FALSE"]=] +set( + to_match_string + [=["NAME;RapidsTest;VERSION;20.09.00;DOWNLOAD_COMMAND;ls;OPTIONS;BUILD_TESTS TRUE;BUILD_EXAMPLES FALSE"]=] ) file(READ "${CMAKE_BINARY_DIR}/rapids-test-project-dependencies.cmake" contents) string(FIND "${contents}" "${to_match_string}" is_found) diff --git a/testing/cpm/cpm_find-options-escaped/rapidstest-config.cmake b/testing/cpm/cpm_find-options-escaped/rapidstest-config.cmake.in similarity index 100% rename from testing/cpm/cpm_find-options-escaped/rapidstest-config.cmake rename to testing/cpm/cpm_find-options-escaped/rapidstest-config.cmake.in diff --git a/testing/cpm/cpm_find-patch-command-embedded/CMakeLists.txt b/testing/cpm/cpm_find-patch-command-embedded/CMakeLists.txt index 92801767..e824c592 100644 --- a/testing/cpm/cpm_find-patch-command-embedded/CMakeLists.txt +++ b/testing/cpm/cpm_find-patch-command-embedded/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -14,8 +14,10 @@ set(deps_dir "${CMAKE_CURRENT_BINARY_DIR}/_gtest_dep") if(NOT EXISTS "${deps_dir}") file(MAKE_DIRECTORY "${deps_dir}") find_package(Git) - execute_process(COMMAND ${GIT_EXECUTABLE} clone --depth 1 --branch "${tag}" "${repository}" - WORKING_DIRECTORY "${deps_dir}") + execute_process( + COMMAND ${GIT_EXECUTABLE} clone --depth 1 --branch "${tag}" "${repository}" + WORKING_DIRECTORY "${deps_dir}" + ) endif() set(gtest_dir "${deps_dir}/googletest") @@ -44,8 +46,11 @@ if(NOT EXISTS "${GTest_SOURCE_DIR}/git_file_2.txt") message(FATAL_ERROR "failed to apply gtest second patch") endif() -execute_process(COMMAND ${GIT_EXECUTABLE} diff --quiet ${tag} RESULT_VARIABLE REPO_IS_PATCHED - WORKING_DIRECTORY "${GTest_SOURCE_DIR}") +execute_process( + COMMAND ${GIT_EXECUTABLE} diff --quiet ${tag} + RESULT_VARIABLE REPO_IS_PATCHED + WORKING_DIRECTORY "${GTest_SOURCE_DIR}" +) if(NOT ${REPO_IS_PATCHED}) message(FATAL_ERROR "The repo was downloaded to ${GTest_SOURCE_DIR} but not patched.") diff --git a/testing/cpm/cpm_find-patch-command-required-fails/CMakeLists.txt b/testing/cpm/cpm_find-patch-command-required-fails/CMakeLists.txt index 10234d19..006f07a2 100644 --- a/testing/cpm/cpm_find-patch-command-required-fails/CMakeLists.txt +++ b/testing/cpm/cpm_find-patch-command-required-fails/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -14,8 +14,10 @@ set(deps_dir "${CMAKE_CURRENT_BINARY_DIR}/_gtest_dep") if(NOT EXISTS "${deps_dir}") file(MAKE_DIRECTORY "${deps_dir}") find_package(Git) - execute_process(COMMAND ${GIT_EXECUTABLE} clone --depth 1 --branch "${tag}" "${repository}" - WORKING_DIRECTORY "${deps_dir}") + execute_process( + COMMAND ${GIT_EXECUTABLE} clone --depth 1 --branch "${tag}" "${repository}" + WORKING_DIRECTORY "${deps_dir}" + ) endif() set(gtest_dir "${deps_dir}/googletest") diff --git a/testing/cpm/cpm_find-patch-command-required/CMakeLists.txt b/testing/cpm/cpm_find-patch-command-required/CMakeLists.txt index 7dd86b29..94f92ac5 100644 --- a/testing/cpm/cpm_find-patch-command-required/CMakeLists.txt +++ b/testing/cpm/cpm_find-patch-command-required/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -14,8 +14,10 @@ set(deps_dir "${CMAKE_CURRENT_BINARY_DIR}/_gtest_dep") if(NOT EXISTS "${deps_dir}") file(MAKE_DIRECTORY "${deps_dir}") find_package(Git) - execute_process(COMMAND ${GIT_EXECUTABLE} clone --depth 1 --branch "${tag}" "${repository}" - WORKING_DIRECTORY "${deps_dir}") + execute_process( + COMMAND ${GIT_EXECUTABLE} clone --depth 1 --branch "${tag}" "${repository}" + WORKING_DIRECTORY "${deps_dir}" + ) endif() set(gtest_dir "${deps_dir}/googletest") @@ -44,8 +46,11 @@ if(NOT EXISTS "${GTest_SOURCE_DIR}/git_file_2.txt") message(FATAL_ERROR "failed to apply GTest second patch") endif() -execute_process(COMMAND ${GIT_EXECUTABLE} diff --quiet ${tag} RESULT_VARIABLE REPO_IS_PATCHED - WORKING_DIRECTORY "${GTest_SOURCE_DIR}") +execute_process( + COMMAND ${GIT_EXECUTABLE} diff --quiet ${tag} + RESULT_VARIABLE REPO_IS_PATCHED + WORKING_DIRECTORY "${GTest_SOURCE_DIR}" +) if(NOT ${REPO_IS_PATCHED}) message(FATAL_ERROR "The repo was downloaded to ${GTest_SOURCE_DIR} but not patched.") diff --git a/testing/cpm/cpm_find-patch-command/CMakeLists.txt b/testing/cpm/cpm_find-patch-command/CMakeLists.txt index 7dd86b29..94f92ac5 100644 --- a/testing/cpm/cpm_find-patch-command/CMakeLists.txt +++ b/testing/cpm/cpm_find-patch-command/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -14,8 +14,10 @@ set(deps_dir "${CMAKE_CURRENT_BINARY_DIR}/_gtest_dep") if(NOT EXISTS "${deps_dir}") file(MAKE_DIRECTORY "${deps_dir}") find_package(Git) - execute_process(COMMAND ${GIT_EXECUTABLE} clone --depth 1 --branch "${tag}" "${repository}" - WORKING_DIRECTORY "${deps_dir}") + execute_process( + COMMAND ${GIT_EXECUTABLE} clone --depth 1 --branch "${tag}" "${repository}" + WORKING_DIRECTORY "${deps_dir}" + ) endif() set(gtest_dir "${deps_dir}/googletest") @@ -44,8 +46,11 @@ if(NOT EXISTS "${GTest_SOURCE_DIR}/git_file_2.txt") message(FATAL_ERROR "failed to apply GTest second patch") endif() -execute_process(COMMAND ${GIT_EXECUTABLE} diff --quiet ${tag} RESULT_VARIABLE REPO_IS_PATCHED - WORKING_DIRECTORY "${GTest_SOURCE_DIR}") +execute_process( + COMMAND ${GIT_EXECUTABLE} diff --quiet ${tag} + RESULT_VARIABLE REPO_IS_PATCHED + WORKING_DIRECTORY "${GTest_SOURCE_DIR}" +) if(NOT ${REPO_IS_PATCHED}) message(FATAL_ERROR "The repo was downloaded to ${GTest_SOURCE_DIR} but not patched.") diff --git a/testing/cpm/cpm_find-restore-cpm-vars/CMakeLists.txt b/testing/cpm/cpm_find-restore-cpm-vars/CMakeLists.txt index cfb81c22..fbe19031 100644 --- a/testing/cpm/cpm_find-restore-cpm-vars/CMakeLists.txt +++ b/testing/cpm/cpm_find-restore-cpm-vars/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -58,6 +58,8 @@ if(NOT old_binary_dir STREQUAL ZLIB_BINARY_DIR) message(FATAL_ERROR "rapids_cpm_find failed to restore correct ZLIB_BINARY_DIR path") endif() if(ZLIB_ADDED) - message(FATAL_ERROR "rapids_cpm_find failed to restore correct ZLIB_ADDED state ( second call should be ZLIB_ADDED=false )" + message( + FATAL_ERROR + "rapids_cpm_find failed to restore correct ZLIB_ADDED state ( second call should be ZLIB_ADDED=false )" ) endif() diff --git a/testing/cpm/cpm_find-version-explicit-install.cmake b/testing/cpm/cpm_find-version-explicit-install.cmake index ac883863..0d2fb7a6 100644 --- a/testing/cpm/cpm_find-version-explicit-install.cmake +++ b/testing/cpm/cpm_find-version-explicit-install.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -20,6 +20,8 @@ file(READ "${cccl_path}" contents) message(STATUS "contents: ${contents}") string(FIND "${contents}" "${cccl_version}" is_found) if(is_found EQUAL -1) - message(FATAL_ERROR "rapids_cpm_cccl failed to generate a find_package configuration with version" + message( + FATAL_ERROR + "rapids_cpm_cccl failed to generate a find_package configuration with version" ) endif() diff --git a/testing/cpm/cpm_generate_patch_command-build.cmake b/testing/cpm/cpm_generate_patch_command-build.cmake index a6ad124c..bf43a3c7 100644 --- a/testing/cpm/cpm_generate_patch_command-build.cmake +++ b/testing/cpm/cpm_generate_patch_command-build.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -8,8 +8,9 @@ cmake_minimum_required(VERSION 3.30.4) project(rapids-cpm_find-patch-command-project LANGUAGES CXX) # Need to write out an override file -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json + [=[ { "packages": { "pkg_with_non_build_patch": { @@ -51,7 +52,8 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json } } } - ]=]) + ]=] +) include(${rapids-cmake-dir}/cpm/init.cmake) rapids_cpm_init(OVERRIDE ${CMAKE_CURRENT_BINARY_DIR}/override.json) @@ -60,12 +62,16 @@ include("${rapids-cmake-dir}/cpm/detail/generate_patch_command.cmake") rapids_cpm_generate_patch_command(pkg_with_only_build_patches 10.2 patch_command build_patch_only) if(NOT build_patch_only STREQUAL "BUILD_PATCH_ONLY") - message(FATAL_ERROR "rapids_cpm_generate_patch_command generated wrong arguments for pkg_with_only_build_patches" + message( + FATAL_ERROR + "rapids_cpm_generate_patch_command generated wrong arguments for pkg_with_only_build_patches" ) endif() rapids_cpm_generate_patch_command(pkg_with_non_build_patch 10.2 patch_command build_patch_only) if(DEFINED build_patch_only) - message(FATAL_ERROR "rapids_cpm_generate_patch_command generated wrong arguments for pkg_with_non_build_patch" + message( + FATAL_ERROR + "rapids_cpm_generate_patch_command generated wrong arguments for pkg_with_non_build_patch" ) endif() diff --git a/testing/cpm/cpm_generate_patch_command-current_json_dir.cmake b/testing/cpm/cpm_generate_patch_command-current_json_dir.cmake index ff561b93..459fcb6c 100644 --- a/testing/cpm/cpm_generate_patch_command-current_json_dir.cmake +++ b/testing/cpm/cpm_generate_patch_command-current_json_dir.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -15,8 +15,9 @@ if(patch_command) endif() # Need to write out an override file -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json + [=[ { "packages": { "pkg_with_patch": { @@ -40,7 +41,8 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json } } } - ]=]) + ]=] +) rapids_cpm_package_override(${CMAKE_CURRENT_BINARY_DIR}/override.json) rapids_cpm_generate_patch_command(pkg_with_patch 10.2 patch_command build_patch_only) @@ -48,14 +50,17 @@ if(NOT patch_command) message(FATAL_ERROR "rapids_cpm_package_override specified a patch step for `pkg_with_patch`") endif() -set(to_match_string - "set(files \"${CMAKE_CURRENT_BINARY_DIR}/example.diff;${CMAKE_CURRENT_BINARY_DIR}/example2.diff\")" +set( + to_match_string + "set(files \"${CMAKE_CURRENT_BINARY_DIR}/example.diff;${CMAKE_CURRENT_BINARY_DIR}/example2.diff\")" ) list(POP_BACK patch_command script_to_run) file(READ "${script_to_run}" contents) string(FIND "${contents}" "${to_match_string}" is_found) if(is_found EQUAL -1) - message(FATAL_ERROR "rapids_cpm_generate_patch_command failed to handle the `current_json_dir` placeholder" + message( + FATAL_ERROR + "rapids_cpm_generate_patch_command failed to handle the `current_json_dir` placeholder" ) endif() diff --git a/testing/cpm/cpm_generate_patch_command-override-case-insensitive.cmake b/testing/cpm/cpm_generate_patch_command-override-case-insensitive.cmake index 54f122a9..f6f31758 100644 --- a/testing/cpm/cpm_generate_patch_command-override-case-insensitive.cmake +++ b/testing/cpm/cpm_generate_patch_command-override-case-insensitive.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -8,8 +8,9 @@ cmake_minimum_required(VERSION 3.30.4) project(rapids-cpm_find-patch-command-project LANGUAGES CXX) # Need to write out an override file -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json + [=[ { "packages": { "gtest": { @@ -23,7 +24,8 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json } } } - ]=]) + ]=] +) include("${rapids-cmake-dir}/cpm/detail/package_info.cmake") rapids_cpm_package_info(GTest VERSION_VAR version) @@ -35,7 +37,9 @@ include("${rapids-cmake-dir}/cpm/detail/generate_patch_command.cmake") rapids_cpm_generate_patch_command(GTest ${version} patch_command build_patch_only) message(STATUS "patch_command: ${patch_command}") if(NOT patch_command) - message(FATAL_ERROR "rapids_cpm_package_override failed to load patch step for `GTest` from package `gtest`" + message( + FATAL_ERROR + "rapids_cpm_package_override failed to load patch step for `GTest` from package `gtest`" ) endif() diff --git a/testing/cpm/cpm_generate_patch_command-override.cmake b/testing/cpm/cpm_generate_patch_command-override.cmake index b2cefca5..c13c3349 100644 --- a/testing/cpm/cpm_generate_patch_command-override.cmake +++ b/testing/cpm/cpm_generate_patch_command-override.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -15,8 +15,9 @@ if(patch_command) endif() # Need to write out an override file -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json + [=[ { "packages": { "pkg_with_patch": { @@ -49,7 +50,8 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json } } } - ]=]) + ]=] +) rapids_cpm_package_override(${CMAKE_CURRENT_BINARY_DIR}/override.json) rapids_cpm_generate_patch_command(pkg_with_patch 10.2 patch_command build_patch_only) @@ -60,6 +62,8 @@ endif() unset(patch_command) rapids_cpm_generate_patch_command(pkg_patch_not_applied 10.2 patch_command build_patch_only) if(patch_command) - message(FATAL_ERROR "rapids_cpm_package_override patch step for `pkg_patch_not_applied` shouldn't apply due to version values" + message( + FATAL_ERROR + "rapids_cpm_package_override patch step for `pkg_patch_not_applied` shouldn't apply due to version values" ) endif() diff --git a/testing/cpm/cpm_generate_patch_command-verify-copyright-header.cmake b/testing/cpm/cpm_generate_patch_command-verify-copyright-header.cmake index 505ccb29..3d033922 100644 --- a/testing/cpm/cpm_generate_patch_command-verify-copyright-header.cmake +++ b/testing/cpm/cpm_generate_patch_command-verify-copyright-header.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -12,8 +12,9 @@ include(${rapids-cmake-testing-dir}/utils/check_copyright_header.cmake) rapids_cpm_init() # Need to write out an override file -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json + [=[ { "packages": { "pkg_with_patch": { @@ -32,7 +33,8 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json } } } - ]=]) + ]=] +) rapids_cpm_package_override(${CMAKE_CURRENT_BINARY_DIR}/override.json) rapids_cpm_generate_patch_command(pkg_with_patch 10.2 patch_command build_patch_only) diff --git a/testing/cpm/cpm_generate_pins-custom-src-dir/CMakeLists.txt b/testing/cpm/cpm_generate_pins-custom-src-dir/CMakeLists.txt index de2e3a77..09b7d2cd 100644 --- a/testing/cpm/cpm_generate_pins-custom-src-dir/CMakeLists.txt +++ b/testing/cpm/cpm_generate_pins-custom-src-dir/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -17,16 +17,28 @@ rapids_cpm_generate_pinned_versions(OUTPUT "${CMAKE_BINARY_DIR}/output_pinned_ve rapids_cpm_nvtx3(INSTALL_EXPORT_SET test) set(CPM_DOWNLOAD_ALL ON) # required so we don't find a local installed version of zstd -rapids_cpm_find(zstd 1.5.7 - GLOBAL_TARGETS zstd - CPM_ARGS - GIT_REPOSITORY https://github.com/facebook/zstd.git - GIT_TAG v1.5.7 - GIT_SHALLOW FALSE SOURCE_SUBDIR build/cmake - OPTIONS "ZSTD_BUILD_STATIC ON" "ZSTD_BUILD_SHARED OFF" "ZSTD_BUILD_TESTS OFF" - "ZSTD_BUILD_PROGRAMS OFF" "BUILD_SHARED_LIBS OFF" - INSTALL_EXPORT_SET test) +rapids_cpm_find( + zstd + 1.5.7 + GLOBAL_TARGETS zstd + CPM_ARGS + GIT_REPOSITORY https://github.com/facebook/zstd.git + GIT_TAG v1.5.7 + GIT_SHALLOW FALSE + SOURCE_SUBDIR build/cmake + OPTIONS + "ZSTD_BUILD_STATIC ON" + "ZSTD_BUILD_SHARED OFF" + "ZSTD_BUILD_TESTS OFF" + "ZSTD_BUILD_PROGRAMS OFF" + "BUILD_SHARED_LIBS OFF" + INSTALL_EXPORT_SET test +) include("${rapids-cmake-testing-dir}/cpm/verify_generated_pins.cmake") -verify_generated_pins(verify_pins PROJECTS nvtx3 zstd SOURCE_SUBDIR_PROJECTS nvtx3 zstd PIN_FILE - "${CMAKE_BINARY_DIR}/output_pinned_versions.json") +verify_generated_pins( + verify_pins + PROJECTS nvtx3 zstd + SOURCE_SUBDIR_PROJECTS nvtx3 zstd + PIN_FILE "${CMAKE_BINARY_DIR}/output_pinned_versions.json" +) diff --git a/testing/cpm/cpm_generate_pins-format-patches/CMakeLists.txt b/testing/cpm/cpm_generate_pins-format-patches/CMakeLists.txt index 4bec7003..c662f64a 100644 --- a/testing/cpm/cpm_generate_pins-format-patches/CMakeLists.txt +++ b/testing/cpm/cpm_generate_pins-format-patches/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -34,8 +34,10 @@ if(NOT EXISTS "${cuco_SOURCE_DIR}/git_file_1.txt") message(FATAL_ERROR "failed to apply cucco first patch") endif() -add_custom_target(verify_generated_pins ALL - COMMAND ${CMAKE_COMMAND} "-S${CMAKE_SOURCE_DIR}/verify/" - "-B${CMAKE_BINARY_DIR}/verify_build" - "-Drapids-cmake-dir=${rapids-cmake-dir}" - "-DCPM_DOWNLOAD_LOCATION=${CPM_DOWNLOAD_LOCATION}") +add_custom_target( + verify_generated_pins + ALL + COMMAND + ${CMAKE_COMMAND} "-S${CMAKE_SOURCE_DIR}/verify/" "-B${CMAKE_BINARY_DIR}/verify_build" + "-Drapids-cmake-dir=${rapids-cmake-dir}" "-DCPM_DOWNLOAD_LOCATION=${CPM_DOWNLOAD_LOCATION}" +) diff --git a/testing/cpm/cpm_generate_pins-format-patches/verify/CMakeLists.txt b/testing/cpm/cpm_generate_pins-format-patches/verify/CMakeLists.txt index 9d4ca303..a8101854 100644 --- a/testing/cpm/cpm_generate_pins-format-patches/verify/CMakeLists.txt +++ b/testing/cpm/cpm_generate_pins-format-patches/verify/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -15,13 +15,29 @@ rapids_cpm_init() rapids_cpm_package_override("${CMAKE_CURRENT_BINARY_DIR}/../rapids-cmake/pinned_versions.json") # Verify that each git_tag is now different. -rapids_cpm_package_details_internal(rmm rmm_version rmm_repository pin_rmm_tag rmm_src_dir - rmm_shallow rmm_exclude) -rapids_cpm_package_details_internal(cuco cuco_version cuco_repository pin_cuco_tag cuco_src_dir - cuco_shallow cuco_exclude) +rapids_cpm_package_details_internal( + rmm + rmm_version + rmm_repository + pin_rmm_tag + rmm_src_dir + rmm_shallow + rmm_exclude +) +rapids_cpm_package_details_internal( + cuco + cuco_version + cuco_repository + pin_cuco_tag + cuco_src_dir + cuco_shallow + cuco_exclude +) if(NOT pin_rmm_tag STREQUAL "e3e32150d1bef13480ede4b2df1f0b38e43108a4") - message(FATAL_ERROR "pinned rmm tag (${pin_rmm_tag}) doesn't match pre-computed SHA1 for the 22.02 tag" + message( + FATAL_ERROR + "pinned rmm tag (${pin_rmm_tag}) doesn't match pre-computed SHA1 for the 22.02 tag" ) endif() if(NOT pin_cuco_tag STREQUAL "f823d30d6b08a60383266db25821074dbdbe5822") @@ -35,8 +51,11 @@ function(validate_has_inline_patches package_name) get_override_json(${package_name} json_data) string(TOLOWER "${package_name}" normalized_pkg_name) - get_property(override_json_path GLOBAL - PROPERTY rapids_cpm_${normalized_pkg_name}_override_json_file) + get_property( + override_json_path + GLOBAL + PROPERTY rapids_cpm_${normalized_pkg_name}_override_json_file + ) string(JSON json_data ERROR_VARIABLE no_override_patch GET "${json_data}" patches) # Gather number of patches diff --git a/testing/cpm/cpm_generate_pins-no-src-dir/CMakeLists.txt b/testing/cpm/cpm_generate_pins-no-src-dir/CMakeLists.txt index a6173aef..0cac8db6 100644 --- a/testing/cpm/cpm_generate_pins-no-src-dir/CMakeLists.txt +++ b/testing/cpm/cpm_generate_pins-no-src-dir/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -16,14 +16,17 @@ rapids_cpm_generate_pinned_versions(OUTPUT "${CMAKE_BINARY_DIR}/output_pinned_ve set(PKG_VERSION 0.6.2) set(PKG_REPOSITORY https://github.com/nmslib/hnswlib.git) -rapids_cpm_find(hnswlib ${PKG_VERSION} - GLOBAL_TARGETS hnswlib::hnswlib - CPM_ARGS - GIT_REPOSITORY ${PKG_REPOSITORY} - GIT_TAG v${PKG_VERSION} - GIT_SHALLOW TRUE - DOWNLOAD_ONLY ON - EXCLUDE_FROM_ALL ON) +rapids_cpm_find( + hnswlib + ${PKG_VERSION} + GLOBAL_TARGETS hnswlib::hnswlib + CPM_ARGS + GIT_REPOSITORY ${PKG_REPOSITORY} + GIT_TAG v${PKG_VERSION} + GIT_SHALLOW TRUE + DOWNLOAD_ONLY ON + EXCLUDE_FROM_ALL ON +) # rapids_find_package should never be in CPM packages, but lets double check rapids_find_package(Threads REQUIRED) @@ -33,5 +36,9 @@ rapids_find_package(Threads REQUIRED) rapids_cpm_find(ZLIB 1.0 REQUIRED) include("${rapids-cmake-testing-dir}/cpm/verify_generated_pins.cmake") -verify_generated_pins(verify_pins PROJECTS hnswlib PROJECTS_NOT_EXIST ZLIB Threads PIN_FILE - "${CMAKE_BINARY_DIR}/output_pinned_versions.json") +verify_generated_pins( + verify_pins + PROJECTS hnswlib + PROJECTS_NOT_EXIST ZLIB Threads + PIN_FILE "${CMAKE_BINARY_DIR}/output_pinned_versions.json" +) diff --git a/testing/cpm/cpm_generate_pins-override/CMakeLists.txt b/testing/cpm/cpm_generate_pins-override/CMakeLists.txt index cb0256ec..c0916b76 100644 --- a/testing/cpm/cpm_generate_pins-override/CMakeLists.txt +++ b/testing/cpm/cpm_generate_pins-override/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -11,8 +11,9 @@ include(${rapids-cmake-dir}/cpm/init.cmake) rapids_cpm_init(GENERATE_PINNED_VERSIONS) # Need to write out an override file -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json + [=[ { "packages" : { "rmm" : { @@ -22,15 +23,18 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json } } } - ]=]) + ]=] +) include(${rapids-cmake-dir}/cpm/package_override.cmake) rapids_cpm_package_override(${CMAKE_CURRENT_BINARY_DIR}/override.json) include(${rapids-cmake-dir}/cpm/rmm.cmake) rapids_cpm_rmm(DOWNLOAD_ONLY ON) -add_custom_target(verify_generated_pins ALL - COMMAND ${CMAKE_COMMAND} "-S${CMAKE_SOURCE_DIR}/verify/" - "-B${CMAKE_BINARY_DIR}/verify_build" - "-Drapids-cmake-dir=${rapids-cmake-dir}" - "-DCPM_DOWNLOAD_LOCATION=${CPM_DOWNLOAD_LOCATION}") +add_custom_target( + verify_generated_pins + ALL + COMMAND + ${CMAKE_COMMAND} "-S${CMAKE_SOURCE_DIR}/verify/" "-B${CMAKE_BINARY_DIR}/verify_build" + "-Drapids-cmake-dir=${rapids-cmake-dir}" "-DCPM_DOWNLOAD_LOCATION=${CPM_DOWNLOAD_LOCATION}" +) diff --git a/testing/cpm/cpm_generate_pins-override/verify/CMakeLists.txt b/testing/cpm/cpm_generate_pins-override/verify/CMakeLists.txt index e58ff893..c3321b7c 100644 --- a/testing/cpm/cpm_generate_pins-override/verify/CMakeLists.txt +++ b/testing/cpm/cpm_generate_pins-override/verify/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -15,10 +15,19 @@ rapids_cpm_init() rapids_cpm_package_override("${CMAKE_CURRENT_BINARY_DIR}/../rapids-cmake/pinned_versions.json") # Verify that each git_tag is now different. -rapids_cpm_package_details_internal(rmm rmm_version rmm_repository pin_rmm_tag rmm_src_dir - rmm_shallow rmm_exclude) +rapids_cpm_package_details_internal( + rmm + rmm_version + rmm_repository + pin_rmm_tag + rmm_src_dir + rmm_shallow + rmm_exclude +) if(NOT pin_rmm_tag STREQUAL "e3e32150d1bef13480ede4b2df1f0b38e43108a4") - message(FATAL_ERROR "pinned rmm tag (${pin_rmm_tag}) doesn't match pre-computed SHA1 for the 22.02 tag" + message( + FATAL_ERROR + "pinned rmm tag (${pin_rmm_tag}) doesn't match pre-computed SHA1 for the 22.02 tag" ) endif() diff --git a/testing/cpm/cpm_generate_pins-pure-cpm/CMakeLists.txt b/testing/cpm/cpm_generate_pins-pure-cpm/CMakeLists.txt index 2020018d..ca433036 100644 --- a/testing/cpm/cpm_generate_pins-pure-cpm/CMakeLists.txt +++ b/testing/cpm/cpm_generate_pins-pure-cpm/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -15,15 +15,21 @@ rapids_cpm_generate_pinned_versions(OUTPUT "${CMAKE_BINARY_DIR}/output_pinned_ve set(PKG_VERSION 0.6.2) set(PKG_REPOSITORY https://github.com/nmslib/hnswlib.git) -rapids_cpm_find(hnswlib ${PKG_VERSION} - GLOBAL_TARGETS hnswlib::hnswlib - CPM_ARGS - GIT_REPOSITORY ${PKG_REPOSITORY} - GIT_TAG v${PKG_VERSION} - GIT_SHALLOW TRUE - DOWNLOAD_ONLY ON - EXCLUDE_FROM_ALL ON) +rapids_cpm_find( + hnswlib + ${PKG_VERSION} + GLOBAL_TARGETS hnswlib::hnswlib + CPM_ARGS + GIT_REPOSITORY ${PKG_REPOSITORY} + GIT_TAG v${PKG_VERSION} + GIT_SHALLOW TRUE + DOWNLOAD_ONLY ON + EXCLUDE_FROM_ALL ON +) include("${rapids-cmake-testing-dir}/cpm/verify_generated_pins.cmake") -verify_generated_pins(verify_pins PROJECTS hnswlib PIN_FILE - "${CMAKE_BINARY_DIR}/output_pinned_versions.json") +verify_generated_pins( + verify_pins + PROJECTS hnswlib + PIN_FILE "${CMAKE_BINARY_DIR}/output_pinned_versions.json" +) diff --git a/testing/cpm/cpm_generate_pins-simple-via-variable/CMakeLists.txt b/testing/cpm/cpm_generate_pins-simple-via-variable/CMakeLists.txt index 12b65cb6..44aba6ef 100644 --- a/testing/cpm/cpm_generate_pins-simple-via-variable/CMakeLists.txt +++ b/testing/cpm/cpm_generate_pins-simple-via-variable/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -8,8 +8,10 @@ cmake_minimum_required(VERSION 3.30.4) project(rapids-test-project LANGUAGES CXX) -set(RAPIDS_CMAKE_CPM_PINNED_VERSIONS_FILE - "${CMAKE_CURRENT_BINARY_DIR}/custom_path/pinned_versions.json") +set( + RAPIDS_CMAKE_CPM_PINNED_VERSIONS_FILE + "${CMAKE_CURRENT_BINARY_DIR}/custom_path/pinned_versions.json" +) include(${rapids-cmake-dir}/cpm/init.cmake) include(${rapids-cmake-dir}/cpm/gbench.cmake) @@ -20,5 +22,8 @@ rapids_cpm_gbench() rapids_cpm_gtest() include("${rapids-cmake-testing-dir}/cpm/verify_generated_pins.cmake") -verify_generated_pins(verify_pins PROJECTS benchmark GTest PIN_FILE - "${RAPIDS_CMAKE_CPM_PINNED_VERSIONS_FILE}") +verify_generated_pins( + verify_pins + PROJECTS benchmark GTest + PIN_FILE "${RAPIDS_CMAKE_CPM_PINNED_VERSIONS_FILE}" +) diff --git a/testing/cpm/cpm_generate_pins-var-and-arg/CMakeLists.txt b/testing/cpm/cpm_generate_pins-var-and-arg/CMakeLists.txt index be742075..e185e47f 100644 --- a/testing/cpm/cpm_generate_pins-var-and-arg/CMakeLists.txt +++ b/testing/cpm/cpm_generate_pins-var-and-arg/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -11,15 +11,23 @@ include(${rapids-cmake-dir}/cpm/init.cmake) include(${rapids-cmake-dir}/cpm/gbench.cmake) include(${rapids-cmake-dir}/cpm/gtest.cmake) -set(RAPIDS_CMAKE_CPM_PINNED_VERSIONS_FILE - "${CMAKE_CURRENT_BINARY_DIR}/custom_path/pinned_versions.json") +set( + RAPIDS_CMAKE_CPM_PINNED_VERSIONS_FILE + "${CMAKE_CURRENT_BINARY_DIR}/custom_path/pinned_versions.json" +) rapids_cpm_init(GENERATE_PINNED_VERSIONS) rapids_cpm_gbench() rapids_cpm_gtest() include("${rapids-cmake-testing-dir}/cpm/verify_generated_pins.cmake") -verify_generated_pins(verify_pins_A PROJECTS benchmark GTest PIN_FILE - "${RAPIDS_CMAKE_CPM_PINNED_VERSIONS_FILE}") +verify_generated_pins( + verify_pins_A + PROJECTS benchmark GTest + PIN_FILE "${RAPIDS_CMAKE_CPM_PINNED_VERSIONS_FILE}" +) -verify_generated_pins(verify_pins_B PROJECTS benchmark GTest PIN_FILE - "${CMAKE_BINARY_DIR}/rapids-cmake/pinned_versions.json") +verify_generated_pins( + verify_pins_B + PROJECTS benchmark GTest + PIN_FILE "${CMAKE_BINARY_DIR}/rapids-cmake/pinned_versions.json" +) diff --git a/testing/cpm/cpm_gtest-explicit-static.cmake b/testing/cpm/cpm_gtest-explicit-static.cmake index cb85449f..ccc55c75 100644 --- a/testing/cpm/cpm_gtest-explicit-static.cmake +++ b/testing/cpm/cpm_gtest-explicit-static.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -15,8 +15,9 @@ if(NOT type STREQUAL STATIC_LIBRARY) message(FATAL_ERROR "rapids_cpm_gtest failed to get a static version of gtest") endif() -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/use_gtest.cpp" - [=[ +file( + WRITE "${CMAKE_CURRENT_BINARY_DIR}/use_gtest.cpp" + [=[ #include // The fixture for testing class Foo. @@ -28,6 +29,7 @@ class FooTest : public testing::Test { void SetUp() override {} void TearDown() override {} }; -]=]) +]=] +) add_library(uses_gtest SHARED ${CMAKE_CURRENT_BINARY_DIR}/use_gtest.cpp) target_link_libraries(uses_gtest PRIVATE GTest::gtest) diff --git a/testing/cpm/cpm_gtest-static.cmake b/testing/cpm/cpm_gtest-static.cmake index 8e648259..1623bdfa 100644 --- a/testing/cpm/cpm_gtest-static.cmake +++ b/testing/cpm/cpm_gtest-static.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -16,8 +16,9 @@ endif() set(BUILD_SHARED_LIBS OFF) rapids_cpm_gtest() -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/use_gtest.cpp" - [=[ +file( + WRITE "${CMAKE_CURRENT_BINARY_DIR}/use_gtest.cpp" + [=[ #include // The fixture for testing class Foo. @@ -29,6 +30,7 @@ class FooTest : public testing::Test { void SetUp() override {} void TearDown() override {} }; -]=]) +]=] +) add_library(uses_gtest SHARED ${CMAKE_CURRENT_BINARY_DIR}/use_gtest.cpp) target_link_libraries(uses_gtest PRIVATE GTest::gtest) diff --git a/testing/cpm/cpm_init-custom-default-multiple.cmake b/testing/cpm/cpm_init-custom-default-multiple.cmake index 1abf5463..833d92f6 100644 --- a/testing/cpm/cpm_init-custom-default-multiple.cmake +++ b/testing/cpm/cpm_init-custom-default-multiple.cmake @@ -1,14 +1,15 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= include(${rapids-cmake-dir}/cpm/init.cmake) # Need to write out multiple default files -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/defaultsA.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/defaultsA.json + [=[ { "packages": { "nvbench": { @@ -18,10 +19,12 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/defaultsA.json } } } - ]=]) + ]=] +) -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/defaultsB.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/defaultsB.json + [=[ { "packages": { "nvbench": { @@ -36,10 +39,12 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/defaultsB.json }, } } - ]=]) + ]=] +) -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/defaultsC.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/defaultsC.json + [=[ { "packages": { "GTest": { @@ -49,7 +54,8 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/defaultsC.json } } } - ]=]) + ]=] +) # Emulate multiple projects calling `rapids_cpm_init` with different default files rapids_cpm_init(CUSTOM_DEFAULT_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/defaultsA.json") @@ -70,7 +76,9 @@ foreach(proj IN ITEMS rmm nvbench GTest) message(FATAL_ERROR "${proj} default tag field was removed.") endif() if(CPM_DOWNLOAD_ALL) - message(FATAL_ERROR "CPM_DOWNLOAD_ALL should be false since since we just specified a defaults version file'" + message( + FATAL_ERROR + "CPM_DOWNLOAD_ALL should be false since since we just specified a defaults version file'" ) endif() unset(CPM_DOWNLOAD_ALL) diff --git a/testing/cpm/cpm_init-custom-default-simple.cmake b/testing/cpm/cpm_init-custom-default-simple.cmake index 595924d9..9b14ddf1 100644 --- a/testing/cpm/cpm_init-custom-default-simple.cmake +++ b/testing/cpm/cpm_init-custom-default-simple.cmake @@ -1,14 +1,15 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= include(${rapids-cmake-dir}/cpm/init.cmake) # Need to write out a custom default file -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/defaults.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/defaults.json + [=[ { "packages": { "nvbench": { @@ -18,7 +19,8 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/defaults.json } } } - ]=]) + ]=] +) rapids_cpm_init(CUSTOM_DEFAULT_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/defaults.json") @@ -27,11 +29,15 @@ include("${rapids-cmake-dir}/cpm/detail/package_details.cmake") rapids_cpm_package_details_internal(nvbench version repository tag src_subdir shallow exclude) if(NOT version STREQUAL "custom_version") - message(FATAL_ERROR "custom default version field was ignored. ${version} found instead of custom_version" + message( + FATAL_ERROR + "custom default version field was ignored. ${version} found instead of custom_version" ) endif() if(NOT repository STREQUAL "my_url") - message(FATAL_ERROR "custom default git_url field was ignored. ${repository} found instead of my_url" + message( + FATAL_ERROR + "custom default git_url field was ignored. ${repository} found instead of my_url" ) endif() if(NOT tag STREQUAL "my_tag") diff --git a/testing/cpm/cpm_init-custom-default-via-cmake-var.cmake b/testing/cpm/cpm_init-custom-default-via-cmake-var.cmake index fe12e87d..3c9d81a6 100644 --- a/testing/cpm/cpm_init-custom-default-via-cmake-var.cmake +++ b/testing/cpm/cpm_init-custom-default-via-cmake-var.cmake @@ -1,14 +1,15 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= include(${rapids-cmake-dir}/cpm/init.cmake) # Need to write out the custom default file that is real but should be ignored -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/defaults_ignored.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/defaults_ignored.json + [=[ { "packages": { "nvbench": { @@ -18,11 +19,13 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/defaults_ignored.json } } } - ]=]) + ]=] +) # Need to write out the custom default file that will be used by the CMake var -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/defaults.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/defaults.json + [=[ { "packages": { "nvbench": { @@ -32,7 +35,8 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/defaults.json } } } - ]=]) + ]=] +) set(RAPIDS_CMAKE_CPM_DEFAULT_VERSION_FILE ${CMAKE_CURRENT_BINARY_DIR}/defaults.json) rapids_cpm_init(CUSTOM_DEFAULT_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/defaults_ignored.json") @@ -42,11 +46,15 @@ include("${rapids-cmake-dir}/cpm/detail/package_details.cmake") rapids_cpm_package_details_internal(nvbench version repository tag src_subdir shallow exclude) if(NOT version STREQUAL "custom_version") - message(FATAL_ERROR "custom default version field was ignored. ${version} found instead of custom_version" + message( + FATAL_ERROR + "custom default version field was ignored. ${version} found instead of custom_version" ) endif() if(NOT repository STREQUAL "my_url") - message(FATAL_ERROR "custom default git_url field was ignored. ${repository} found instead of my_url" + message( + FATAL_ERROR + "custom default git_url field was ignored. ${repository} found instead of my_url" ) endif() if(NOT tag STREQUAL "my_tag") diff --git a/testing/cpm/cpm_init-override-multiple.cmake b/testing/cpm/cpm_init-override-multiple.cmake index e8ec8054..32bfe285 100644 --- a/testing/cpm/cpm_init-override-multiple.cmake +++ b/testing/cpm/cpm_init-override-multiple.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -11,17 +11,22 @@ function(expect_fetch_content_details project expected) set(internal_fetch_content_var_name "_FetchContent_${project}_savedDetails") get_property(exists GLOBAL PROPERTY ${internal_fetch_content_var_name} SET) if(expected AND NOT exists) - message(FATAL_ERROR "FetchContent expected ${project} doesn't match expected[${exists}!=${expected})" + message( + FATAL_ERROR + "FetchContent expected ${project} doesn't match expected[${exists}!=${expected})" ) elseif(NOT expected AND exists) - message(FATAL_ERROR "FetchContent expected ${project} doesn't match expected[${exists}!=${expected})" + message( + FATAL_ERROR + "FetchContent expected ${project} doesn't match expected[${exists}!=${expected})" ) endif() endfunction() # Need to write out a default file -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/default.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/default.json + [=[ { "packages": { "nvbench": { @@ -42,24 +47,40 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/default.json } } } - ]=]) + ]=] +) rapids_cpm_init(CUSTOM_DEFAULT_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/default.json") # Load the default values for nvbench and GTest projects include("${rapids-cmake-dir}/cpm/detail/package_details.cmake") -rapids_cpm_package_details_internal(nvbench nvbench_version nvbench_repository nvbench_tag - nvbench_subdir nvbench_shallow nvbench_exclude) -rapids_cpm_package_details_internal(GTest GTest_version GTest_repository GTest_tag GTest_subdir - GTest_shallow GTest_exclude) +rapids_cpm_package_details_internal( + nvbench + nvbench_version + nvbench_repository + nvbench_tag + nvbench_subdir + nvbench_shallow + nvbench_exclude +) +rapids_cpm_package_details_internal( + GTest + GTest_version + GTest_repository + GTest_tag + GTest_subdir + GTest_shallow + GTest_exclude +) expect_fetch_content_details(nvbench NO) expect_fetch_content_details(rmm NO) expect_fetch_content_details(GTest NO) # Need to write out an override file -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json + [=[ { "packages": { "nvbench": { @@ -74,10 +95,13 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json } } } - ]=]) + ]=] +) -rapids_cpm_init(CUSTOM_DEFAULT_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/default.json" - OVERRIDE "${CMAKE_CURRENT_BINARY_DIR}/override.json") +rapids_cpm_init( + CUSTOM_DEFAULT_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/default.json" + OVERRIDE "${CMAKE_CURRENT_BINARY_DIR}/override.json" +) expect_fetch_content_details(nvbench YES) expect_fetch_content_details(rmm YES) expect_fetch_content_details(GTest YES) @@ -94,7 +118,9 @@ if(NOT tag STREQUAL "my_tag") message(FATAL_ERROR "custom git_tag field was ignored. ${tag} found instead of my_tag") endif() if(CPM_DOWNLOAD_ALL) - message(FATAL_ERROR "CPM_DOWNLOAD_ALL should be false since the nvbench override explicitly sets it to 'false'" + message( + FATAL_ERROR + "CPM_DOWNLOAD_ALL should be false since the nvbench override explicitly sets it to 'false'" ) endif() unset(CPM_DOWNLOAD_ALL) @@ -114,10 +140,14 @@ if(NOT version STREQUAL "2.99") message(FATAL_ERROR "custom version field was removed. ${version} was found instead") endif() if(NOT tag MATCHES "2.99") - message(FATAL_ERROR "custom version field not used when computing git_tag value. ${tag} was found instead" + message( + FATAL_ERROR + "custom version field not used when computing git_tag value. ${tag} was found instead" ) endif() if(CPM_DOWNLOAD_ALL) - message(FATAL_ERROR "CPM_DOWNLOAD_ALL should be false by default when an override exists that doesn't modify url or tag" + message( + FATAL_ERROR + "CPM_DOWNLOAD_ALL should be false by default when an override exists that doesn't modify url or tag" ) endif() diff --git a/testing/cpm/cpm_init-override-simple.cmake b/testing/cpm/cpm_init-override-simple.cmake index 1592ce6c..67ba4d6f 100644 --- a/testing/cpm/cpm_init-override-simple.cmake +++ b/testing/cpm/cpm_init-override-simple.cmake @@ -1,14 +1,15 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= include(${rapids-cmake-dir}/cpm/init.cmake) # Need to write out an override file -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json + [=[ { "packages": { "nvbench": { @@ -18,7 +19,8 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json } } } - ]=]) + ]=] +) rapids_cpm_init(OVERRIDE "${CMAKE_CURRENT_BINARY_DIR}/override.json") @@ -27,7 +29,9 @@ include("${rapids-cmake-dir}/cpm/detail/package_details.cmake") rapids_cpm_package_details_internal(nvbench version repository tag src_subdir shallow exclude) if(NOT version STREQUAL "custom_version") - message(FATAL_ERROR "custom version field was ignored. ${version} found instead of custom_version" + message( + FATAL_ERROR + "custom version field was ignored. ${version} found instead of custom_version" ) endif() if(NOT repository STREQUAL "my_url") diff --git a/testing/cpm/cpm_init-override-via-cmake-var.cmake b/testing/cpm/cpm_init-override-via-cmake-var.cmake index c10e05f8..35442df3 100644 --- a/testing/cpm/cpm_init-override-via-cmake-var.cmake +++ b/testing/cpm/cpm_init-override-via-cmake-var.cmake @@ -1,13 +1,14 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= include(${rapids-cmake-dir}/cpm/init.cmake) -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override_ignored.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/override_ignored.json + [=[ { "packages": { "nvbench": { @@ -17,11 +18,13 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override_ignored.json } } } - ]=]) + ]=] +) # Need to write out an override file -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json + [=[ { "packages": { "nvbench": { @@ -31,7 +34,8 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json } } } - ]=]) + ]=] +) set(RAPIDS_CMAKE_CPM_OVERRIDE_VERSION_FILE ${CMAKE_CURRENT_BINARY_DIR}/override.json) rapids_cpm_init(OVERRIDE "${CMAKE_CURRENT_BINARY_DIR}/override_ignored.json") @@ -41,7 +45,9 @@ include("${rapids-cmake-dir}/cpm/detail/package_details.cmake") rapids_cpm_package_details_internal(nvbench version repository tag src_subdir shallow exclude) if(NOT version STREQUAL "custom_version") - message(FATAL_ERROR "custom version field was ignored. ${version} found instead of custom_version" + message( + FATAL_ERROR + "custom version field was ignored. ${version} found instead of custom_version" ) endif() if(NOT repository STREQUAL "my_url") diff --git a/testing/cpm/cpm_nvbench-conda.cmake b/testing/cpm/cpm_nvbench-conda.cmake index a926af33..afe7c3a2 100644 --- a/testing/cpm/cpm_nvbench-conda.cmake +++ b/testing/cpm/cpm_nvbench-conda.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -22,8 +22,9 @@ set(ENV{CONDA_PREFIX} "/opt/conda/prefix") rapids_cpm_init() rapids_cpm_nvbench() -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/use_fmt.cpp" - [=[ +file( + WRITE "${CMAKE_CURRENT_BINARY_DIR}/use_fmt.cpp" + [=[ #include #include @@ -41,7 +42,8 @@ NVBENCH_BENCH_TYPES(nvbench_distinct, NVBENCH_TYPE_AXES(data_type)) .add_int64_axis("NumRows", {10'000, 100'000, 1'000'000, 10'000'000}); int main() { return 0; } -]=]) +]=] +) add_library(uses_fmt SHARED "${CMAKE_CURRENT_BINARY_DIR}/use_fmt.cpp") target_link_libraries(uses_fmt PRIVATE nvbench::nvbench) diff --git a/testing/cpm/cpm_nvcomp-always-download-proprietary_binary.cmake b/testing/cpm/cpm_nvcomp-always-download-proprietary_binary.cmake index c2246642..cc7c04e0 100644 --- a/testing/cpm/cpm_nvcomp-always-download-proprietary_binary.cmake +++ b/testing/cpm/cpm_nvcomp-always-download-proprietary_binary.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -15,8 +15,9 @@ if(TARGET nvcomp::nvcomp) endif() # Need to write out an nvcomp override file -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json + [=[ { "packages": { "nvcomp": { @@ -36,7 +37,8 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json } } } -]=]) +]=] +) rapids_cpm_package_override(${CMAKE_CURRENT_BINARY_DIR}/override.json) # diff --git a/testing/cpm/cpm_nvcomp-invalid-arch.cmake b/testing/cpm/cpm_nvcomp-invalid-arch.cmake index 392c90ee..2bf67280 100644 --- a/testing/cpm/cpm_nvcomp-invalid-arch.cmake +++ b/testing/cpm/cpm_nvcomp-invalid-arch.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -17,7 +17,9 @@ set(CMAKE_SYSTEM_PROCESSOR "i686") # Don't do this outside of tests rapids_cpm_nvcomp(USE_PROPRIETARY_BINARY ON DOWNLOAD_ONLY ON) if(nvcomp_proprietary_binary) - message(FATAL_ERROR "Shouldn't have found a pre-built version of nvcomp for a non-existent CMAKE_SYSTEM_PROCESSOR key" + message( + FATAL_ERROR + "Shouldn't have found a pre-built version of nvcomp for a non-existent CMAKE_SYSTEM_PROCESSOR key" ) endif() if(NOT EXISTS "${nvcomp_SOURCE_DIR}/CMakeLists.txt") diff --git a/testing/cpm/cpm_nvcomp-override-clears-proprietary_binary.cmake b/testing/cpm/cpm_nvcomp-override-clears-proprietary_binary.cmake index 41b54403..4a111136 100644 --- a/testing/cpm/cpm_nvcomp-override-clears-proprietary_binary.cmake +++ b/testing/cpm/cpm_nvcomp-override-clears-proprietary_binary.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -15,8 +15,9 @@ if(TARGET nvcomp::nvcomp) endif() # Need to write out an nvcomp override file -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json + [=[ { "packages": { "nvcomp": { @@ -25,7 +26,8 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json } } } -]=]) +]=] +) rapids_cpm_package_override(${CMAKE_CURRENT_BINARY_DIR}/override.json) # diff --git a/testing/cpm/cpm_nvcomp-proprietary_binary-lib-location-common.cmake b/testing/cpm/cpm_nvcomp-proprietary_binary-lib-location-common.cmake index bd2d4e00..2cf459ff 100644 --- a/testing/cpm/cpm_nvcomp-proprietary_binary-lib-location-common.cmake +++ b/testing/cpm/cpm_nvcomp-proprietary_binary-lib-location-common.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -14,8 +14,13 @@ if(TARGET nvcomp::nvcomp) message(FATAL_ERROR "Expected nvcomp::nvcomp not to exist") endif() -rapids_cpm_nvcomp(USE_PROPRIETARY_BINARY ON BUILD_EXPORT_SET nvcomp-targets - INSTALL_EXPORT_SET nvcomp-targets) +rapids_cpm_nvcomp( + USE_PROPRIETARY_BINARY ON + BUILD_EXPORT_SET + nvcomp-targets + INSTALL_EXPORT_SET + nvcomp-targets +) if(NOT nvcomp_proprietary_binary) message(FATAL_ERROR "Ignored nvcomp override file failed to get proprietary binary version") @@ -23,15 +28,20 @@ endif() # Check the contents of the nvcomp cmake files to ensure that every line containing "_IMPORT_PREFIX" # also contains "${CMAKE_INSTALL_LIBDIR}" -set(nvcomp_list_of_target_files "nvcomp-targets-dynamic-release.cmake" - "nvcomp-targets-static-release.cmake") +set( + nvcomp_list_of_target_files + "nvcomp-targets-dynamic-release.cmake" + "nvcomp-targets-static-release.cmake" +) if(nvcomp_VERSION VERSION_LESS "5.0") list(APPEND nvcomp_list_of_target_files "nvcomp-targets-common-release.cmake") endif() foreach(filename IN LISTS nvcomp_list_of_target_files) - file(STRINGS - "${CMAKE_CURRENT_BINARY_DIR}/_deps/nvcomp_proprietary_binary-src/${CMAKE_INSTALL_LIBDIR}/cmake/nvcomp/${filename}" - nvcomp_targets_release_contents) + file( + STRINGS + "${CMAKE_CURRENT_BINARY_DIR}/_deps/nvcomp_proprietary_binary-src/${CMAKE_INSTALL_LIBDIR}/cmake/nvcomp/${filename}" + nvcomp_targets_release_contents + ) foreach(line IN LISTS nvcomp_targets_release_contents) string(FIND "${line}" "_IMPORT_PREFIX" _IMPORT_PREFIX_INDEX) if(_IMPORT_PREFIX_INDEX EQUAL -1) @@ -46,16 +56,20 @@ foreach(filename IN LISTS nvcomp_list_of_target_files) endforeach() # Install and check the install directory. -add_custom_target(install_project ALL COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" - --prefix check_nvcomp_lib_dir/install/) +add_custom_target( + install_project + ALL + COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --prefix check_nvcomp_lib_dir/install/ +) # Need to capture the install directory based on the binary dir of this project, not the subproject # used for testing. set(expected_install_dir "${CMAKE_BINARY_DIR}/check_nvcomp_lib_dir/install/") # Add a custom command that verifies that the expect files have been installed for each component -file(WRITE "${CMAKE_BINARY_DIR}/check_nvcomp_lib_dir/CMakeLists.txt" - " +file( + WRITE "${CMAKE_BINARY_DIR}/check_nvcomp_lib_dir/CMakeLists.txt" + " cmake_minimum_required(VERSION 3.30.4) project(verify_install_targets LANGUAGES CXX) @@ -71,11 +85,15 @@ file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/stub.cpp\" \" \") add_library(uses_nvcomp SHARED stub.cpp) target_link_libraries(uses_nvcomp PRIVATE nvcomp::nvcomp) -") +" +) -add_custom_target(verify_nvcomp_lib_dir ALL - COMMAND ${CMAKE_COMMAND} -E rm -rf - "${CMAKE_BINARY_DIR}/check_nvcomp_lib_dir/build" - COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/check_nvcomp_lib_dir" - -B="${CMAKE_BINARY_DIR}/install/build") +add_custom_target( + verify_nvcomp_lib_dir + ALL + COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/check_nvcomp_lib_dir/build" + COMMAND + ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/check_nvcomp_lib_dir" + -B="${CMAKE_BINARY_DIR}/install/build" +) add_dependencies(verify_nvcomp_lib_dir install_project) diff --git a/testing/cpm/cpm_nvcomp-simple.cmake b/testing/cpm/cpm_nvcomp-simple.cmake index 267bb3a1..49eab444 100644 --- a/testing/cpm/cpm_nvcomp-simple.cmake +++ b/testing/cpm/cpm_nvcomp-simple.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -21,7 +21,9 @@ endif() rapids_cpm_nvcomp() if(nvcomp_proprietary_binary) - message(FATAL_ERROR "Ignored no explicit enabling of `USE_PROPRIETARY_BINARY` and brought in the binary version" + message( + FATAL_ERROR + "Ignored no explicit enabling of `USE_PROPRIETARY_BINARY` and brought in the binary version" ) endif() diff --git a/testing/cpm/cpm_nvtx-build-config-subdir/CMakeLists.txt b/testing/cpm/cpm_nvtx-build-config-subdir/CMakeLists.txt index dbd24f87..90bbac6c 100644 --- a/testing/cpm/cpm_nvtx-build-config-subdir/CMakeLists.txt +++ b/testing/cpm/cpm_nvtx-build-config-subdir/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -17,8 +17,9 @@ add_subdirectory(subdir1) add_subdirectory(subdir2) # Add a custom command that verifies that we can use targets that link to nvtx3 -file(WRITE "${CMAKE_BINARY_DIR}/check_uses_nvtx_dir/CMakeLists.txt" - " +file( + WRITE "${CMAKE_BINARY_DIR}/check_uses_nvtx_dir/CMakeLists.txt" + " cmake_minimum_required(VERSION 3.30.4) project(verify_nvtx LANGUAGES CXX) @@ -31,9 +32,14 @@ endif() file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/stub.cpp\" \" \") add_library(uses_nvtx SHARED stub.cpp) target_link_libraries(uses_nvtx PRIVATE uses-nvtx3::uses-nvtx3-cpp) -") +" +) -add_custom_target(verify_build_config ALL - COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/check_uses_nvtx_dir/build" - COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/check_uses_nvtx_dir" - -B="${CMAKE_BINARY_DIR}/check_uses_nvtx_dir/build") +add_custom_target( + verify_build_config + ALL + COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/check_uses_nvtx_dir/build" + COMMAND + ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/check_uses_nvtx_dir" + -B="${CMAKE_BINARY_DIR}/check_uses_nvtx_dir/build" +) diff --git a/testing/cpm/cpm_nvtx-build-config-subdir/subdir2/CMakeLists.txt b/testing/cpm/cpm_nvtx-build-config-subdir/subdir2/CMakeLists.txt index 575b77f7..4a59d1b2 100644 --- a/testing/cpm/cpm_nvtx-build-config-subdir/subdir2/CMakeLists.txt +++ b/testing/cpm/cpm_nvtx-build-config-subdir/subdir2/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -11,5 +11,10 @@ add_library(uses-nvtx3-cpp INTERFACE) target_link_libraries(uses-nvtx3-cpp INTERFACE nvtx3::nvtx3-cpp) install(TARGETS uses-nvtx3-cpp EXPORT uses-nvtx3-exports) -rapids_export(BUILD uses-nvtx3 EXPORT_SET uses-nvtx3-exports GLOBAL_TARGETS uses-nvtx3-cpp - NAMESPACE uses-nvtx3::) +rapids_export( + BUILD + uses-nvtx3 + EXPORT_SET uses-nvtx3-exports + GLOBAL_TARGETS uses-nvtx3-cpp + NAMESPACE uses-nvtx3:: +) diff --git a/testing/cpm/cpm_nvtx-build-config-works.cmake b/testing/cpm/cpm_nvtx-build-config-works.cmake index 4d183077..6069d0e0 100644 --- a/testing/cpm/cpm_nvtx-build-config-works.cmake +++ b/testing/cpm/cpm_nvtx-build-config-works.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -11,8 +11,9 @@ rapids_cpm_init() rapids_cpm_nvtx3(BUILD_EXPORT_SET test) # Add a custom command that verifies that the expect files have been installed for each component -file(WRITE "${CMAKE_BINARY_DIR}/check_nvtx_dir/CMakeLists.txt" - " +file( + WRITE "${CMAKE_BINARY_DIR}/check_nvtx_dir/CMakeLists.txt" + " cmake_minimum_required(VERSION 3.30.4) project(verify_nvtx LANGUAGES CXX) @@ -22,9 +23,12 @@ find_package(nvtx3 REQUIRED) file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/stub.cpp\" \" \") add_library(uses_nvtx SHARED stub.cpp) target_link_libraries(uses_nvtx PRIVATE nvtx3::nvtx3-cpp) -") +" +) -add_custom_target(verify_build_config ALL - COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/check_nvtx_dir/build" - COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/check_nvtx_dir" - -B="${CMAKE_BINARY_DIR}/build") +add_custom_target( + verify_build_config + ALL + COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/check_nvtx_dir/build" + COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/check_nvtx_dir" -B="${CMAKE_BINARY_DIR}/build" +) diff --git a/testing/cpm/cpm_nvtx-install-config-subdir/CMakeLists.txt b/testing/cpm/cpm_nvtx-install-config-subdir/CMakeLists.txt index 1fc6a954..6650d8b3 100644 --- a/testing/cpm/cpm_nvtx-install-config-subdir/CMakeLists.txt +++ b/testing/cpm/cpm_nvtx-install-config-subdir/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -17,8 +17,9 @@ add_subdirectory(subdir1) add_subdirectory(subdir2) # Add a custom command that verifies that we can use targets that link to nvtx3 -file(WRITE "${CMAKE_BINARY_DIR}/check_uses_nvtx_dir/CMakeLists.txt" - " +file( + WRITE "${CMAKE_BINARY_DIR}/check_uses_nvtx_dir/CMakeLists.txt" + " cmake_minimum_required(VERSION 3.30.4) project(verify_nvtx LANGUAGES CXX) @@ -31,10 +32,15 @@ endif() file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/stub.cpp\" \" \") add_library(uses_nvtx SHARED stub.cpp) target_link_libraries(uses_nvtx PRIVATE uses-nvtx3::uses-nvtx3-cpp) -") +" +) -add_custom_target(verify_build_config ALL - COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --prefix ./install/ - COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/check_uses_nvtx_dir/build" - COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/check_uses_nvtx_dir" - -B="${CMAKE_BINARY_DIR}/check_uses_nvtx_dir/build") +add_custom_target( + verify_build_config + ALL + COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --prefix ./install/ + COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/check_uses_nvtx_dir/build" + COMMAND + ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/check_uses_nvtx_dir" + -B="${CMAKE_BINARY_DIR}/check_uses_nvtx_dir/build" +) diff --git a/testing/cpm/cpm_nvtx-install-config-subdir/subdir2/CMakeLists.txt b/testing/cpm/cpm_nvtx-install-config-subdir/subdir2/CMakeLists.txt index ce9a5093..6282a9d1 100644 --- a/testing/cpm/cpm_nvtx-install-config-subdir/subdir2/CMakeLists.txt +++ b/testing/cpm/cpm_nvtx-install-config-subdir/subdir2/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -11,5 +11,10 @@ add_library(uses-nvtx3-cpp INTERFACE) target_link_libraries(uses-nvtx3-cpp INTERFACE nvtx3::nvtx3-cpp) install(TARGETS uses-nvtx3-cpp EXPORT uses-nvtx3-exports) -rapids_export(INSTALL uses-nvtx3 EXPORT_SET uses-nvtx3-exports GLOBAL_TARGETS uses-nvtx3-cpp - NAMESPACE uses-nvtx3::) +rapids_export( + INSTALL + uses-nvtx3 + EXPORT_SET uses-nvtx3-exports + GLOBAL_TARGETS uses-nvtx3-cpp + NAMESPACE uses-nvtx3:: +) diff --git a/testing/cpm/cpm_nvtx-install-config-works.cmake b/testing/cpm/cpm_nvtx-install-config-works.cmake index 9fc87eb3..35f10f54 100644 --- a/testing/cpm/cpm_nvtx-install-config-works.cmake +++ b/testing/cpm/cpm_nvtx-install-config-works.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -11,8 +11,9 @@ rapids_cpm_init() rapids_cpm_nvtx3(INSTALL_EXPORT_SET test) # Add a custom command that verifies that the expect files have been installed for each component -file(WRITE "${CMAKE_BINARY_DIR}/check_nvtx_dir/CMakeLists.txt" - " +file( + WRITE "${CMAKE_BINARY_DIR}/check_nvtx_dir/CMakeLists.txt" + " cmake_minimum_required(VERSION 3.30.4) project(verify_nvtx LANGUAGES CXX) @@ -22,10 +23,13 @@ find_package(nvtx3 REQUIRED) file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/stub.cpp\" \" \") add_library(uses_nvtx SHARED stub.cpp) target_link_libraries(uses_nvtx PRIVATE nvtx3::nvtx3-cpp) -") +" +) -add_custom_target(verify_build_config ALL - COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --prefix ./install/ - COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/check_nvtx_dir/build" - COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/check_nvtx_dir" - -B="${CMAKE_BINARY_DIR}/build") +add_custom_target( + verify_build_config + ALL + COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --prefix ./install/ + COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/check_nvtx_dir/build" + COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/check_nvtx_dir" -B="${CMAKE_BINARY_DIR}/build" +) diff --git a/testing/cpm/cpm_package_override-add-new-project.cmake b/testing/cpm/cpm_package_override-add-new-project.cmake index 0de830dd..19aec00c 100644 --- a/testing/cpm/cpm_package_override-add-new-project.cmake +++ b/testing/cpm/cpm_package_override-add-new-project.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -11,8 +11,9 @@ include(${rapids-cmake-dir}/cpm/package_override.cmake) rapids_cpm_init() # Need to write out an override file -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json + [=[ { "packages": { "custom_package_never_in_rapids" : { @@ -24,7 +25,8 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json } } } - ]=]) + ]=] +) rapids_cpm_package_override(${CMAKE_CURRENT_BINARY_DIR}/override.json) diff --git a/testing/cpm/cpm_package_override-before-init.cmake b/testing/cpm/cpm_package_override-before-init.cmake index 9f2f96cb..78640732 100644 --- a/testing/cpm/cpm_package_override-before-init.cmake +++ b/testing/cpm/cpm_package_override-before-init.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -8,8 +8,9 @@ include(${rapids-cmake-dir}/cpm/init.cmake) include(${rapids-cmake-dir}/cpm/package_override.cmake) # Need to write out an override file -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/simple_override.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/simple_override.json + [=[ { "packages": { "nvbench": { @@ -19,7 +20,8 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/simple_override.json } } } - ]=]) + ]=] +) rapids_cpm_package_override(${CMAKE_CURRENT_BINARY_DIR}/simple_override.json) rapids_cpm_init() @@ -29,7 +31,9 @@ include("${rapids-cmake-dir}/cpm/detail/package_details.cmake") rapids_cpm_package_details_internal(nvbench version repository tag src_subdir shallow exclude) if(NOT version STREQUAL "custom_version") - message(FATAL_ERROR "custom version field was ignored. ${version} found instead of custom_version" + message( + FATAL_ERROR + "custom version field was ignored. ${version} found instead of custom_version" ) endif() if(NOT repository STREQUAL "my_url2") diff --git a/testing/cpm/cpm_package_override-defaults-with-different-casing-warning.cmake b/testing/cpm/cpm_package_override-defaults-with-different-casing-warning.cmake index 4299066a..39d744aa 100644 --- a/testing/cpm/cpm_package_override-defaults-with-different-casing-warning.cmake +++ b/testing/cpm/cpm_package_override-defaults-with-different-casing-warning.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -9,6 +9,9 @@ set(rmm_string "RAPIDS-CMake is assuming the override rMm is meant for the rmm package") set(gtest_string "RAPIDS-CMake is assuming the override gtest is meant for the GTest package") +function(_message) +endfunction() + function(message mode content) if(mode STREQUAL "AUTHOR_WARNING") if(content MATCHES "${rmm_string}") @@ -29,8 +32,9 @@ include(${rapids-cmake-dir}/cpm/package_override.cmake) rapids_cpm_init() # Need to write out an override file -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json + [=[ { "packages": { "rMm": { @@ -43,7 +47,8 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json } } } - ]=]) + ]=] +) rapids_cpm_package_override(${CMAKE_CURRENT_BINARY_DIR}/override.json) include("${rapids-cmake-dir}/cpm/detail/package_details.cmake") diff --git a/testing/cpm/cpm_package_override-defaults-with-different-casing.cmake b/testing/cpm/cpm_package_override-defaults-with-different-casing.cmake index df842a30..5952cb41 100644 --- a/testing/cpm/cpm_package_override-defaults-with-different-casing.cmake +++ b/testing/cpm/cpm_package_override-defaults-with-different-casing.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -9,8 +9,9 @@ include(${rapids-cmake-dir}/cpm/init.cmake) include(${rapids-cmake-dir}/cpm/package_override.cmake) # Need to write out a default file -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/default.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/default.json + [=[ { "packages": { "rmm": { @@ -25,13 +26,15 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/default.json } } } - ]=]) + ]=] +) rapids_cpm_init(CUSTOM_DEFAULT_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/default.json") # Need to write out an override file -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json + [=[ { "packages": { "rMm": { @@ -44,7 +47,8 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json } } } - ]=]) + ]=] +) rapids_cpm_package_override(${CMAKE_CURRENT_BINARY_DIR}/override.json) @@ -53,14 +57,18 @@ if(NOT version STREQUAL "3.00.A1") message(FATAL_ERROR "custom version field was removed. ${version} was found instead") endif() if(NOT tag MATCHES "3.00.A1") - message(FATAL_ERROR "custom version field not used when computing git_tag value. ${tag} was found instead" + message( + FATAL_ERROR + "custom version field not used when computing git_tag value. ${tag} was found instead" ) endif() if(NOT exclude MATCHES "OFF") message(FATAL_ERROR "default value of exclude not found. ${exclude} was found instead") endif() if(CPM_DOWNLOAD_ALL) - message(FATAL_ERROR "CPM_DOWNLOAD_ALL should be false by default when an override exists that doesn't modify url or tag" + message( + FATAL_ERROR + "CPM_DOWNLOAD_ALL should be false by default when an override exists that doesn't modify url or tag" ) endif() @@ -75,6 +83,8 @@ if(NOT exclude MATCHES "ON") message(FATAL_ERROR "override should have changed exclude value. ${exclude} was found instead") endif() if(NOT CPM_DOWNLOAD_ALL) - message(FATAL_ERROR "CPM_DOWNLOAD_ALL should be set to true when an override exists with a custom repository" + message( + FATAL_ERROR + "CPM_DOWNLOAD_ALL should be set to true when an override exists with a custom repository" ) endif() diff --git a/testing/cpm/cpm_package_override-empty-patches.cmake b/testing/cpm/cpm_package_override-empty-patches.cmake index db43612f..7b3c0e46 100644 --- a/testing/cpm/cpm_package_override-empty-patches.cmake +++ b/testing/cpm/cpm_package_override-empty-patches.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -10,8 +10,9 @@ include(${rapids-cmake-dir}/cpm/package_override.cmake) rapids_cpm_init() # Need to write out an override file -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json + [=[ { "packages": { "rmm": { @@ -25,7 +26,8 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json } } } - ]=]) + ]=] +) rapids_cpm_package_override(${CMAKE_CURRENT_BINARY_DIR}/override.json) diff --git a/testing/cpm/cpm_package_override-empty.cmake b/testing/cpm/cpm_package_override-empty.cmake index 1e21ac1b..06eaccdc 100644 --- a/testing/cpm/cpm_package_override-empty.cmake +++ b/testing/cpm/cpm_package_override-empty.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -10,13 +10,15 @@ include(${rapids-cmake-dir}/cpm/package_override.cmake) rapids_cpm_init() # Need to write out an override file -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json + [=[ { "packages": { } } - ]=]) + ]=] +) # Verify that the override can be consumed without errors rapids_cpm_package_override(${CMAKE_CURRENT_BINARY_DIR}/override.json) diff --git a/testing/cpm/cpm_package_override-env-var-support.cmake b/testing/cpm/cpm_package_override-env-var-support.cmake index 089a5920..672a0b43 100644 --- a/testing/cpm/cpm_package_override-env-var-support.cmake +++ b/testing/cpm/cpm_package_override-env-var-support.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -10,8 +10,9 @@ set(ENV{rapids_version} custom_env_version) set(ENV{rapids_user} custom_env_user) # Need to write out an override file -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json + [=[ { "packages": { "nvbench": { @@ -21,7 +22,8 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json } } } - ]=]) + ]=] +) rapids_cpm_init(OVERRIDE "${CMAKE_CURRENT_BINARY_DIR}/override.json") @@ -30,11 +32,15 @@ include("${rapids-cmake-dir}/cpm/detail/package_details.cmake") rapids_cpm_package_details_internal(nvbench version repository tag src_subdir shallow exclude) if(NOT version STREQUAL "custom_env_version") - message(FATAL_ERROR "custom version field was ignored. ${version} found instead of custom_env_version" + message( + FATAL_ERROR + "custom version field was ignored. ${version} found instead of custom_env_version" ) endif() if(NOT repository STREQUAL "custom_env_user@gitlab.private.com") - message(FATAL_ERROR "custom git_url field was ignored. ${repository} found instead of custom_env_user@gitlab.private.com" + message( + FATAL_ERROR + "custom git_url field was ignored. ${repository} found instead of custom_env_user@gitlab.private.com" ) endif() if(NOT DEFINED CPM_DOWNLOAD_ALL) diff --git a/testing/cpm/cpm_package_override-multiple-cmake-var.cmake b/testing/cpm/cpm_package_override-multiple-cmake-var.cmake index be3c6014..252774bf 100644 --- a/testing/cpm/cpm_package_override-multiple-cmake-var.cmake +++ b/testing/cpm/cpm_package_override-multiple-cmake-var.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -8,8 +8,9 @@ include(${rapids-cmake-dir}/cpm/init.cmake) include(${rapids-cmake-dir}/cpm/package_override.cmake) # Need to write out an override file -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override1.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/override1.json + [=[ { "packages": { "nvbench": { @@ -21,10 +22,12 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override1.json } } } - ]=]) + ]=] +) -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override2.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/override2.json + [=[ { "packages": { "rmm": { @@ -36,7 +39,8 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override2.json } } } - ]=]) + ]=] +) set(RAPIDS_CMAKE_CPM_OVERRIDE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/override1.json") rapids_cpm_init() @@ -53,12 +57,16 @@ if(NOT version STREQUAL "2.99") message(FATAL_ERROR "custom version field was removed. ${version} was found instead") endif() if(NOT tag MATCHES "2.99") - message(FATAL_ERROR "custom version field not used when computing git_tag value. ${tag} was found instead" + message( + FATAL_ERROR + "custom version field not used when computing git_tag value. ${tag} was found instead" ) endif() rapids_cpm_package_details_internal(rmm version repository tag src_subdir shallow exclude) if(NOT tag MATCHES "new_rmm_tag") - message(FATAL_ERROR "custom version field not used when computing git_tag value. ${tag} was found instead" + message( + FATAL_ERROR + "custom version field not used when computing git_tag value. ${tag} was found instead" ) endif() diff --git a/testing/cpm/cpm_package_override-multiple.cmake b/testing/cpm/cpm_package_override-multiple.cmake index 10d9483a..bff95161 100644 --- a/testing/cpm/cpm_package_override-multiple.cmake +++ b/testing/cpm/cpm_package_override-multiple.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -11,16 +11,38 @@ rapids_cpm_init() # Load the default values for nvbench and GTest projects include("${rapids-cmake-dir}/cpm/detail/package_details.cmake") -rapids_cpm_package_details_internal(nvbench nvbench_version nvbench_repository nvbench_tag - nvbench_src_dir nvbench_shallow nvbench_exclude) -rapids_cpm_package_details_internal(GTest GTest_version GTest_repository GTest_tag GTest_src_dir - GTest_shallow GTest_exclude) -rapids_cpm_package_details_internal(rmm rmm_version rmm_repository rmm_tag rmm_src_dir rmm_shallow - rmm_exclude) +rapids_cpm_package_details_internal( + nvbench + nvbench_version + nvbench_repository + nvbench_tag + nvbench_src_dir + nvbench_shallow + nvbench_exclude +) +rapids_cpm_package_details_internal( + GTest + GTest_version + GTest_repository + GTest_tag + GTest_src_dir + GTest_shallow + GTest_exclude +) +rapids_cpm_package_details_internal( + rmm + rmm_version + rmm_repository + rmm_tag + rmm_src_dir + rmm_shallow + rmm_exclude +) # Need to write out an override file -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override1.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/override1.json + [=[ { "packages": { "nvbench": { @@ -32,10 +54,12 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override1.json } } } - ]=]) + ]=] +) -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override2.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/override2.json + [=[ { "packages": { "rmm": { @@ -47,7 +71,8 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override2.json } } } - ]=]) + ]=] +) rapids_cpm_package_override(${CMAKE_CURRENT_BINARY_DIR}/override1.json) rapids_cpm_package_override(${CMAKE_CURRENT_BINARY_DIR}/override2.json) @@ -69,12 +94,16 @@ if(NOT version STREQUAL "2.99") message(FATAL_ERROR "custom version field was removed. ${version} was found instead") endif() if(NOT tag MATCHES "2.99") - message(FATAL_ERROR "custom version field not used when computing git_tag value. ${tag} was found instead" + message( + FATAL_ERROR + "custom version field not used when computing git_tag value. ${tag} was found instead" ) endif() rapids_cpm_package_details_internal(rmm version repository tag src_subdir shallow exclude) if(NOT tag MATCHES "new_rmm_tag") - message(FATAL_ERROR "custom version field not used when computing git_tag value. ${tag} was found instead" + message( + FATAL_ERROR + "custom version field not used when computing git_tag value. ${tag} was found instead" ) endif() diff --git a/testing/cpm/cpm_package_override-no-version-value.cmake b/testing/cpm/cpm_package_override-no-version-value.cmake index c4a1182b..381e5d0e 100644 --- a/testing/cpm/cpm_package_override-no-version-value.cmake +++ b/testing/cpm/cpm_package_override-no-version-value.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -10,8 +10,9 @@ include(${rapids-cmake-dir}/cpm/package_override.cmake) rapids_cpm_init() # Need to write out an override file -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json + [=[ { "packages": { "fake_package_no_version": { @@ -20,7 +21,8 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json } } } - ]=]) + ]=] +) rapids_cpm_package_override(${CMAKE_CURRENT_BINARY_DIR}/override.json) diff --git a/testing/cpm/cpm_package_override-obey-cpm-source-var.cmake b/testing/cpm/cpm_package_override-obey-cpm-source-var.cmake index 66f1d2c4..7a566326 100644 --- a/testing/cpm/cpm_package_override-obey-cpm-source-var.cmake +++ b/testing/cpm/cpm_package_override-obey-cpm-source-var.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -10,8 +10,9 @@ include(${rapids-cmake-dir}/cpm/package_override.cmake) rapids_cpm_init() # Need to write out an override file -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json + [=[ { "packages": { "rmm": { @@ -28,7 +29,8 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json } } } - ]=]) + ]=] +) set(CPM_rmm_SOURCE "${CMAKE_CURRENT_BINARY_DIR}") set(CPM_not_in_base_SOURCE "${CMAKE_CURRENT_BINARY_DIR}") @@ -53,7 +55,9 @@ unset(repository) unset(tag) rapids_cpm_package_details_internal(not_in_base version repository tag src_subdir shallow exclude) if(NOT (version AND repository AND tag)) - message(FATAL_ERROR "rapids_cpm_package_details should still have details for package that doesn't exist" + message( + FATAL_ERROR + "rapids_cpm_package_details should still have details for package that doesn't exist" ) endif() diff --git a/testing/cpm/cpm_package_override-patches.cmake b/testing/cpm/cpm_package_override-patches.cmake index feb959c6..2f1c5f6f 100644 --- a/testing/cpm/cpm_package_override-patches.cmake +++ b/testing/cpm/cpm_package_override-patches.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -10,8 +10,9 @@ include(${rapids-cmake-dir}/cpm/package_override.cmake) rapids_cpm_init() # Need to write out an override file -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json + [=[ { "packages": { "rmm": { @@ -25,7 +26,8 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json } } } - ]=]) + ]=] +) rapids_cpm_package_override(${CMAKE_CURRENT_BINARY_DIR}/override.json) diff --git a/testing/cpm/cpm_package_override-simple.cmake b/testing/cpm/cpm_package_override-simple.cmake index b40fc1f3..f56c6fec 100644 --- a/testing/cpm/cpm_package_override-simple.cmake +++ b/testing/cpm/cpm_package_override-simple.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -8,8 +8,9 @@ include(${rapids-cmake-dir}/cpm/init.cmake) include(${rapids-cmake-dir}/cpm/package_override.cmake) # Need to write out a default file -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/default.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/default.json + [=[ { "packages": { "rmm": { @@ -24,13 +25,15 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/default.json } } } - ]=]) + ]=] +) rapids_cpm_init(CUSTOM_DEFAULT_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/default.json") # Need to write out an override file -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json + [=[ { "packages": { "rmm": { @@ -43,7 +46,8 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json } } } - ]=]) + ]=] +) rapids_cpm_package_override(${CMAKE_CURRENT_BINARY_DIR}/override.json) @@ -55,14 +59,18 @@ if(NOT version STREQUAL "3.00.A1") message(FATAL_ERROR "custom version field was removed. ${version} was found instead") endif() if(NOT tag MATCHES "3.00.A1") - message(FATAL_ERROR "custom version field not used when computing git_tag value. ${tag} was found instead" + message( + FATAL_ERROR + "custom version field not used when computing git_tag value. ${tag} was found instead" ) endif() if(NOT exclude MATCHES "OFF") message(FATAL_ERROR "default value of exclude not found. ${exclude} was found instead") endif() if(CPM_DOWNLOAD_ALL) - message(FATAL_ERROR "CPM_DOWNLOAD_ALL should be false by default when an override exists that doesn't modify url or tag" + message( + FATAL_ERROR + "CPM_DOWNLOAD_ALL should be false by default when an override exists that doesn't modify url or tag" ) endif() @@ -77,6 +85,8 @@ if(NOT exclude MATCHES "ON") message(FATAL_ERROR "override should have changed exclude value. ${exclude} was found instead") endif() if(NOT CPM_DOWNLOAD_ALL) - message(FATAL_ERROR "CPM_DOWNLOAD_ALL should be set to true when an override exists with a custom repository" + message( + FATAL_ERROR + "CPM_DOWNLOAD_ALL should be set to true when an override exists with a custom repository" ) endif() diff --git a/testing/cpm/cpm_package_override-source-subdir.cmake b/testing/cpm/cpm_package_override-source-subdir.cmake index 70ca105a..5f3a3188 100644 --- a/testing/cpm/cpm_package_override-source-subdir.cmake +++ b/testing/cpm/cpm_package_override-source-subdir.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -12,8 +12,9 @@ include(${rapids-cmake-dir}/cpm/find.cmake) include(${rapids-cmake-dir}/cpm/package_override.cmake) # Need to write out a default file -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/default.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/default.json + [=[ { "packages": { "zstd": { @@ -23,19 +24,28 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/default.json } } } - ]=]) + ]=] +) rapids_cpm_init(CUSTOM_DEFAULT_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/default.json") set(CPM_DOWNLOAD_ALL ON) # required so we don't find a local installed version of zstd -rapids_cpm_find(zstd 1.5.7 - GLOBAL_TARGETS zstd - CPM_ARGS - GIT_REPOSITORY https://github.com/facebook/zstd.git - GIT_TAG v1.5.7 - GIT_SHALLOW FALSE SOURCE_SUBDIR build/cmake - OPTIONS "ZSTD_BUILD_STATIC ON" "ZSTD_BUILD_SHARED OFF" "ZSTD_BUILD_TESTS OFF" - "ZSTD_BUILD_PROGRAMS OFF" "BUILD_SHARED_LIBS OFF") +rapids_cpm_find( + zstd + 1.5.7 + GLOBAL_TARGETS zstd + CPM_ARGS + GIT_REPOSITORY https://github.com/facebook/zstd.git + GIT_TAG v1.5.7 + GIT_SHALLOW FALSE + SOURCE_SUBDIR build/cmake + OPTIONS + "ZSTD_BUILD_STATIC ON" + "ZSTD_BUILD_SHARED OFF" + "ZSTD_BUILD_TESTS OFF" + "ZSTD_BUILD_PROGRAMS OFF" + "BUILD_SHARED_LIBS OFF" +) if(NOT TARGET libzstd_static) message(FATAL_ERROR "source_subdir in override was ignored for `rapids_cpm_find`") diff --git a/testing/cpm/cpm_proprietary-url-ctk-version-find-ctk.cmake b/testing/cpm/cpm_proprietary-url-ctk-version-find-ctk.cmake index cc2de900..50e1c341 100644 --- a/testing/cpm/cpm_proprietary-url-ctk-version-find-ctk.cmake +++ b/testing/cpm/cpm_proprietary-url-ctk-version-find-ctk.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -12,8 +12,9 @@ include(${rapids-cmake-dir}/cpm/detail/package_info.cmake) rapids_cpm_init() # Need to write out an override file with a proprietary blob url -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json + [=[ { "packages": { "test_binary": { @@ -27,7 +28,8 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json } } } -]=]) +]=] +) rapids_cpm_package_override(${CMAKE_CURRENT_BINARY_DIR}/override.json) # Verify that the placeholders are evaluated correctly from `enable_language(CUDA)` diff --git a/testing/cpm/cpm_proprietary-url-ctk-version.cmake b/testing/cpm/cpm_proprietary-url-ctk-version.cmake index 84711653..dc05c270 100644 --- a/testing/cpm/cpm_proprietary-url-ctk-version.cmake +++ b/testing/cpm/cpm_proprietary-url-ctk-version.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -12,8 +12,9 @@ include(${rapids-cmake-dir}/cpm/detail/package_info.cmake) rapids_cpm_init() # Need to write out an override file with a proprietary blob url -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json + [=[ { "packages": { "test_binary": { @@ -27,7 +28,8 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json } } } -]=]) +]=] +) rapids_cpm_package_override(${CMAKE_CURRENT_BINARY_DIR}/override.json) # Verify that the placeholders are evaluated correctly from `find_package(CUDAToolkit)` diff --git a/testing/cpm/cpm_proprietary-url-no-ctk-parsing.cmake b/testing/cpm/cpm_proprietary-url-no-ctk-parsing.cmake index 42ce9a90..a7a192e8 100644 --- a/testing/cpm/cpm_proprietary-url-no-ctk-parsing.cmake +++ b/testing/cpm/cpm_proprietary-url-no-ctk-parsing.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -12,8 +12,9 @@ include(${rapids-cmake-dir}/cpm/detail/package_info.cmake) rapids_cpm_init() # Need to write out an override file with a proprietary blob url -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json - [=[ +file( + WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json + [=[ { "packages": { "test_binary": { @@ -27,7 +28,8 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json } } } -]=]) +]=] +) rapids_cpm_package_override(${CMAKE_CURRENT_BINARY_DIR}/override.json) rapids_cpm_package_info(test_binary VERSION_VAR version) @@ -35,6 +37,8 @@ rapids_cpm_get_proprietary_binary_url(test_binary ${version} nvcomp_url) # Verify that we didn't go searching for the CUDAToolkit if(TARGET CUDA::cudart_static OR TARGET CUDA::cudart) - message(FATAL_ERROR "test_binary didn't use the cuda toolkit placeholder, but searching for it still occurred" + message( + FATAL_ERROR + "test_binary didn't use the cuda toolkit placeholder, but searching for it still occurred" ) endif() diff --git a/testing/cpm/make_fake_project_build_dir_with_config.cmake b/testing/cpm/make_fake_project_build_dir_with_config.cmake index 8c569d92..bf850eb7 100644 --- a/testing/cpm/make_fake_project_build_dir_with_config.cmake +++ b/testing/cpm/make_fake_project_build_dir_with_config.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -12,10 +12,15 @@ function(make_fake_project_build_dir_with_config name version config_file versio set(build_dir "${CMAKE_CURRENT_BINARY_DIR}/${name}-build/") file(MAKE_DIRECTORY ${build_dir}) - configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/${config_file}" - "${build_dir}/${config_file}" - INSTALL_DESTINATION "${build_dir}/${config_file}") + configure_package_config_file( + "${CMAKE_CURRENT_SOURCE_DIR}/${config_file}.in" + "${build_dir}/${config_file}" + INSTALL_DESTINATION "${build_dir}/${config_file}" + ) - write_basic_package_version_file("${build_dir}/${version_file}" VERSION ${version} - COMPATIBILITY SameMajorVersion) + write_basic_package_version_file( + "${build_dir}/${version_file}" + VERSION ${version} + COMPATIBILITY SameMajorVersion + ) endfunction() diff --git a/testing/cpm/verify_generated_pins.cmake b/testing/cpm/verify_generated_pins.cmake index 87773ccb..61eace25 100644 --- a/testing/cpm/verify_generated_pins.cmake +++ b/testing/cpm/verify_generated_pins.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -9,8 +9,14 @@ function(verify_generated_pins target_name) set(_rapids_options) set(_rapids_one_value PIN_FILE) set(_rapids_multi_value PROJECTS PROJECTS_NOT_EXIST SOURCE_SUBDIR_PROJECTS) - cmake_parse_arguments(PARSE_ARGV 1 _RAPIDS "${_rapids_options}" "${_rapids_one_value}" - "${_rapids_multi_value}") + cmake_parse_arguments( + PARSE_ARGV + 1 + _RAPIDS + "${_rapids_options}" + "${_rapids_one_value}" + "${_rapids_multi_value}" + ) if(NOT DEFINED _RAPIDS_PROJECTS) message(FATAL_ERROR "verify_generated_pins must be called with `PROJECTS` to verify") @@ -25,20 +31,22 @@ function(verify_generated_pins target_name) message(STATUS "Projects not in list: ${_RAPIDS_PROJECTS_NOT_EXIST}") foreach(proj IN LISTS _RAPIDS_PROJECTS) if(NOT CPM_PACKAGE_${proj}_SOURCE_DIR) - message(FATAL_ERROR "Attempting to verify a project ( ${proj} ) that was not cloned as part of this build" + message( + FATAL_ERROR + "Attempting to verify a project ( ${proj} ) that was not cloned as part of this build" ) endif() endforeach() - add_custom_target(${target_name} ALL - COMMAND ${CMAKE_COMMAND} - "-S${CMAKE_CURRENT_FUNCTION_LIST_DIR}/verify_generated_pins/" - "-B${CMAKE_BINARY_DIR}/${target_name}_verify_build" - "-Drapids-cmake-dir=${rapids-cmake-dir}" - "-Dpinned_versions_file=${_RAPIDS_PIN_FILE}" - "-Dprojects-to-verify=${_RAPIDS_PROJECTS}" - "-Dprojects-with-subdirs=${_RAPIDS_SOURCE_SUBDIR_PROJECTS}" - "-Dprojects-not-in-list=${_RAPIDS_PROJECTS_NOT_EXIST}" - VERBATIM) - + add_custom_target( + ${target_name} + ALL + COMMAND + ${CMAKE_COMMAND} "-S${CMAKE_CURRENT_FUNCTION_LIST_DIR}/verify_generated_pins/" + "-B${CMAKE_BINARY_DIR}/${target_name}_verify_build" "-Drapids-cmake-dir=${rapids-cmake-dir}" + "-Dpinned_versions_file=${_RAPIDS_PIN_FILE}" "-Dprojects-to-verify=${_RAPIDS_PROJECTS}" + "-Dprojects-with-subdirs=${_RAPIDS_SOURCE_SUBDIR_PROJECTS}" + "-Dprojects-not-in-list=${_RAPIDS_PROJECTS_NOT_EXIST}" + VERBATIM + ) endfunction() diff --git a/testing/cpm/verify_generated_pins/CMakeLists.txt b/testing/cpm/verify_generated_pins/CMakeLists.txt index 44204034..73476e6f 100644 --- a/testing/cpm/verify_generated_pins/CMakeLists.txt +++ b/testing/cpm/verify_generated_pins/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -21,8 +21,15 @@ endif() # Get the baseline before the override is added foreach(proj IN LISTS projects-to-verify) - rapids_cpm_package_details_internal(${proj} ${proj}_version ${proj}_repository ${proj}_tag - ${proj}_src_dir ${proj}_shallow ${proj}_exclude) + rapids_cpm_package_details_internal( + ${proj} + ${proj}_version + ${proj}_repository + ${proj}_tag + ${proj}_src_dir + ${proj}_shallow + ${proj}_exclude + ) endforeach() # Verify that the pinned_versions is valid json by using it @@ -37,19 +44,34 @@ endmacro() foreach(proj IN LISTS projects-to-verify) # Verify that each git_tag is now different. - rapids_cpm_package_details_internal(${proj} ${proj}_version ${proj}_repository pin_${proj}_tag - pin_${proj}_src_dir pin_${proj}_shallow ${proj}_exclude) + rapids_cpm_package_details_internal( + ${proj} + ${proj}_version + ${proj}_repository + pin_${proj}_tag + pin_${proj}_src_dir + pin_${proj}_shallow + ${proj}_exclude + ) # 160 bits for SHA-1, 256 bits for SHA-256 string(LENGTH "${${proj}_tag}" tag_length) - if(pin_${proj}_tag STREQUAL ${proj}_tag - AND NOT (${proj}_tag MATCHES "^[0-9a-f]+$" AND (tag_length EQUAL 40 OR tag_length EQUAL 64))) + if( + pin_${proj}_tag STREQUAL ${proj}_tag + AND NOT (${proj}_tag MATCHES "^[0-9a-f]+$" AND (tag_length EQUAL 40 OR tag_length EQUAL 64)) + ) _get_json_data() - message(FATAL_ERROR "pinned ${proj} tag (${pin_${proj}_tag}) should differ compared to baseline ${${proj}_tag}\npinned_versions.json:\n${pinned_versions}\nversions.json:\n${default_versions}" + message( + FATAL_ERROR + "pinned ${proj} tag (${pin_${proj}_tag}) should differ compared to baseline ${${proj}_tag}\npinned_versions.json:\n${pinned_versions}\nversions.json:\n${default_versions}" ) - elseif(NOT pin_${proj}_tag STREQUAL ${proj}_tag - AND (${proj}_tag MATCHES "^[0-9a-f]+$" AND (tag_length EQUAL 40 OR tag_length EQUAL 64))) + elseif( + NOT pin_${proj}_tag STREQUAL ${proj}_tag + AND (${proj}_tag MATCHES "^[0-9a-f]+$" AND (tag_length EQUAL 40 OR tag_length EQUAL 64)) + ) _get_json_data() - message(FATAL_ERROR "pinned ${proj} tag (${pin_${proj}_tag}) should be the same as baseline ${${proj}_tag}\npinned_versions.json:\n${pinned_versions}\nversions.json:\n${default_versions}" + message( + FATAL_ERROR + "pinned ${proj} tag (${pin_${proj}_tag}) should be the same as baseline ${${proj}_tag}\npinned_versions.json:\n${pinned_versions}\nversions.json:\n${default_versions}" ) endif() @@ -60,7 +82,9 @@ foreach(proj IN LISTS projects-to-verify) # Everything should have shallow marked as false so that clones by SHA1 work if(pin_${proj}_shallow) _get_json_data() - message(FATAL_ERROR "pin_${proj}_shallow is expected to be false, but got ${pin_${proj}_shallow}\npinned_versions.json:\n${pinned_versions}\nversions.json:\n${default_versions}" + message( + FATAL_ERROR + "pin_${proj}_shallow is expected to be false, but got ${pin_${proj}_shallow}\npinned_versions.json:\n${pinned_versions}\nversions.json:\n${default_versions}" ) endif() endforeach() @@ -68,8 +92,14 @@ endforeach() foreach(proj IN LISTS projects-not-in-list) # Verify that we don't have entries for these rapids_cpm_package_details_internal( - ${proj} pin_${proj}_version ${proj}_repository pin_${proj}_tag pin_${proj}_src_dir - ${proj}_shallow ${proj}_exclude) + ${proj} + pin_${proj}_version + ${proj}_repository + pin_${proj}_tag + pin_${proj}_src_dir + ${proj}_shallow + ${proj}_exclude + ) if(pin_${proj}_version) message(FATAL_ERROR "${proj} shouldn't be in override, it was a system installed package") endif() diff --git a/testing/cuda/CMakeLists.txt b/testing/cuda/CMakeLists.txt index c00c6154..0cf8689c 100644 --- a/testing/cuda/CMakeLists.txt +++ b/testing/cuda/CMakeLists.txt @@ -1,15 +1,21 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= add_cmake_config_test(rapids-cuda.cmake) -add_cmake_config_test(enable_fatbin_compression-invalid-tuning-flag.cmake SHOULD_FAIL - "rapids_cuda_enable_fatbin_compression `TUNE_FOR`") -add_cmake_config_test(enable_fatbin_compression-no-arguments.cmake SHOULD_FAIL - "rapids_cuda_enable_fatbin_compression requires") +add_cmake_config_test( + enable_fatbin_compression-invalid-tuning-flag.cmake + SHOULD_FAIL + "rapids_cuda_enable_fatbin_compression `TUNE_FOR`" +) +add_cmake_config_test( + enable_fatbin_compression-no-arguments.cmake + SHOULD_FAIL + "rapids_cuda_enable_fatbin_compression requires" +) add_cmake_config_test(enable_fatbin_compression-target.cmake) add_cmake_config_test(enable_fatbin_compression-var.cmake) diff --git a/testing/cuda/enable_fatbin_compression-target.cmake b/testing/cuda/enable_fatbin_compression-target.cmake index 173ba3c3..f96acbda 100644 --- a/testing/cuda/enable_fatbin_compression-target.cmake +++ b/testing/cuda/enable_fatbin_compression-target.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -32,7 +32,9 @@ foreach(suffix mode option IN ZIP_LISTS name_suffix modes compile_options) message(FATAL_ERROR "${target} missing the compress-all compile flag") endif() if(NOT compile_opts MATCHES "--compress-mode=${option}") - message(FATAL_ERROR "${target} missing the proper compress-mode flag of ${option} instead has ${compile_opts}" + message( + FATAL_ERROR + "${target} missing the proper compress-mode flag of ${option} instead has ${compile_opts}" ) endif() endforeach() @@ -51,14 +53,18 @@ foreach(target property IN ZIP_LISTS targets properties) get_target_property(compile_opts_a ${target} ${property}) get_target_property(compile_opts_b ${target}_rapids ${property}) if(NOT compile_opts_a STREQUAL compile_opts_b) - message(FATAL_ERROR "rapids_cuda_enable_fatbin_compression without any TUNE_FOR should match 'rapids'" + message( + FATAL_ERROR + "rapids_cuda_enable_fatbin_compression without any TUNE_FOR should match 'rapids'" ) endif() if(NOT compile_opts_a MATCHES "-Xfatbin=-compress-all") message(FATAL_ERROR "${target} missing the compress-all compile flag") endif() - if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0.0 AND NOT compile_opts_a MATCHES - "--compress-mode") + if( + CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0.0 + AND NOT compile_opts_a MATCHES "--compress-mode" + ) message(FATAL_ERROR "${target} missing the compress-mode compile flag") endif() endforeach() diff --git a/testing/cuda/enable_fatbin_compression-var.cmake b/testing/cuda/enable_fatbin_compression-var.cmake index ea0fb059..ed34fcc8 100644 --- a/testing/cuda/enable_fatbin_compression-var.cmake +++ b/testing/cuda/enable_fatbin_compression-var.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -21,22 +21,24 @@ endforeach() # Validate all the targets now have the proper values foreach(suffix mode option IN ZIP_LISTS name_suffix modes compile_options) - foreach(var IN ITEMS not_yet_${suffix} exists_${suffix}) if(NOT ${var} MATCHES "-Xfatbin=-compress-all") message(FATAL_ERROR "${var} missing the compress-all compile flag") endif() if(NOT ${var} MATCHES "--compress-mode=${option}") - message(FATAL_ERROR "${var} missing the proper compress-mode flag of ${option} instead has ${compile_opts}" + message( + FATAL_ERROR + "${var} missing the proper compress-mode flag of ${option} instead has ${compile_opts}" ) endif() endforeach() if(NOT exists_${suffix} MATCHES "-extra-flag") - message(FATAL_ERROR "rapids_cuda_enable_fatbin_compression cleared existing values in a variable" + message( + FATAL_ERROR + "rapids_cuda_enable_fatbin_compression cleared existing values in a variable" ) endif() - endforeach() # Handle checking all the tune types that map to `rapids` @@ -48,14 +50,18 @@ foreach(var IN ITEMS not_yet exists) rapids_cuda_enable_fatbin_compression(VARIABLE ${var}_rapids TUNE_FOR rapids) if(NOT ${var} STREQUAL ${var}_rapids) - message(FATAL_ERROR "rapids_cuda_enable_fatbin_compression without any TUNE_FOR should match 'rapids'" + message( + FATAL_ERROR + "rapids_cuda_enable_fatbin_compression without any TUNE_FOR should match 'rapids'" ) endif() if(NOT ${var} MATCHES "-Xfatbin=-compress-all") message(FATAL_ERROR "${var} missing the compress-all compile flag") endif() - if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0.0 AND NOT ${var} MATCHES - "--compress-mode") + if( + CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0.0 + AND NOT ${var} MATCHES "--compress-mode" + ) message(FATAL_ERROR "${var} missing the compress-mode compile flag") endif() endforeach() diff --git a/testing/cuda/init_arch-existing-project-flags.cmake b/testing/cuda/init_arch-existing-project-flags.cmake index 70be6c86..bdf80b6b 100644 --- a/testing/cuda/init_arch-existing-project-flags.cmake +++ b/testing/cuda/init_arch-existing-project-flags.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -15,7 +15,9 @@ rapids_cuda_init_architectures(example) project(example LANGUAGES CUDA) if(NOT DEFINED file_A) - message(FATAL_ERROR "rapids_cuda_init_architectures can't overwrite existing `project()` include hooks" + message( + FATAL_ERROR + "rapids_cuda_init_architectures can't overwrite existing `project()` include hooks" ) endif() @@ -28,6 +30,8 @@ rapids_cuda_init_architectures(example2) project(example2 LANGUAGES CUDA) if(NOT DEFINED file_B) - message(FATAL_ERROR "rapids_cuda_init_architectures can't overwrite existing `project()` include hooks" + message( + FATAL_ERROR + "rapids_cuda_init_architectures can't overwrite existing `project()` include hooks" ) endif() diff --git a/testing/cuda/init_arch-native-no-gpu.cmake b/testing/cuda/init_arch-native-no-gpu.cmake index 0968de97..2f0bf736 100644 --- a/testing/cuda/init_arch-native-no-gpu.cmake +++ b/testing/cuda/init_arch-native-no-gpu.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -12,7 +12,9 @@ rapids_cuda_init_architectures(rapids-project) project(rapids-project LANGUAGES CUDA) if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES) - message(FATAL_ERROR "CMAKE_CUDA_ARCHITECTURES should exist after calling rapids_cuda_init_architectures()" + message( + FATAL_ERROR + "CMAKE_CUDA_ARCHITECTURES should exist after calling rapids_cuda_init_architectures()" ) endif() diff --git a/testing/cuda/init_arch-native-via-env.cmake b/testing/cuda/init_arch-native-via-env.cmake index 8dd219f5..56a270d4 100644 --- a/testing/cuda/init_arch-native-via-env.cmake +++ b/testing/cuda/init_arch-native-via-env.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -11,7 +11,9 @@ rapids_cuda_init_architectures(rapids-project) project(rapids-project LANGUAGES CUDA) if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES) - message(FATAL_ERROR "CMAKE_CUDA_ARCHITECTURES should exist after calling rapids_cuda_init_architectures()" + message( + FATAL_ERROR + "CMAKE_CUDA_ARCHITECTURES should exist after calling rapids_cuda_init_architectures()" ) endif() diff --git a/testing/cuda/init_arch-native.cmake b/testing/cuda/init_arch-native.cmake index 07bf2682..b50018b8 100644 --- a/testing/cuda/init_arch-native.cmake +++ b/testing/cuda/init_arch-native.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -11,7 +11,9 @@ rapids_cuda_init_architectures(rapids-project) project(rapids-project LANGUAGES CUDA) if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES) - message(FATAL_ERROR "CMAKE_CUDA_ARCHITECTURES should exist after calling rapids_cuda_init_architectures()" + message( + FATAL_ERROR + "CMAKE_CUDA_ARCHITECTURES should exist after calling rapids_cuda_init_architectures()" ) endif() diff --git a/testing/cuda/init_arch-rapids-via-env.cmake b/testing/cuda/init_arch-rapids-via-env.cmake index 8c16e7c9..6726ff6f 100644 --- a/testing/cuda/init_arch-rapids-via-env.cmake +++ b/testing/cuda/init_arch-rapids-via-env.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -12,7 +12,9 @@ rapids_cuda_init_architectures(rapids-project) project(rapids-project LANGUAGES CUDA) if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES) - message(FATAL_ERROR "CMAKE_CUDA_ARCHITECTURES should exist after calling rapids_cuda_init_architectures()" + message( + FATAL_ERROR + "CMAKE_CUDA_ARCHITECTURES should exist after calling rapids_cuda_init_architectures()" ) endif() diff --git a/testing/cuda/init_arch-rapids.cmake b/testing/cuda/init_arch-rapids.cmake index e17f74f8..7d32db6d 100644 --- a/testing/cuda/init_arch-rapids.cmake +++ b/testing/cuda/init_arch-rapids.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -11,7 +11,9 @@ rapids_cuda_init_architectures(rapids-project) project(rapids-project LANGUAGES CUDA) if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES) - message(FATAL_ERROR "CMAKE_CUDA_ARCHITECTURES should exist after calling rapids_cuda_init_architectures()" + message( + FATAL_ERROR + "CMAKE_CUDA_ARCHITECTURES should exist after calling rapids_cuda_init_architectures()" ) endif() diff --git a/testing/cuda/init_arch-user-over-env.cmake b/testing/cuda/init_arch-user-over-env.cmake index 1b7fe867..7cd29ad2 100644 --- a/testing/cuda/init_arch-user-over-env.cmake +++ b/testing/cuda/init_arch-user-over-env.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -19,6 +19,8 @@ if(CMAKE_CUDA_ARCHITECTURES STREQUAL "9000") endif() if(NOT CMAKE_CUDA_ARCHITECTURES STREQUAL "80-real") - message(FATAL_ERROR "rapids_cuda_init_architectures didn't preserve users CUDA_ARCHITECTURES value" + message( + FATAL_ERROR + "rapids_cuda_init_architectures didn't preserve users CUDA_ARCHITECTURES value" ) endif() diff --git a/testing/cuda/init_arch-user-via-env.cmake b/testing/cuda/init_arch-user-via-env.cmake index 86156a20..9a6546f9 100644 --- a/testing/cuda/init_arch-user-via-env.cmake +++ b/testing/cuda/init_arch-user-via-env.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -11,7 +11,9 @@ rapids_cuda_init_architectures(rapids-project) project(rapids-project LANGUAGES CUDA) if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES) - message(FATAL_ERROR "CMAKE_CUDA_ARCHITECTURES should exist after calling rapids_cuda_init_architectures()" + message( + FATAL_ERROR + "CMAKE_CUDA_ARCHITECTURES should exist after calling rapids_cuda_init_architectures()" ) endif() diff --git a/testing/cuda/init_arch-user.cmake b/testing/cuda/init_arch-user.cmake index 901f3933..5d8f29f6 100644 --- a/testing/cuda/init_arch-user.cmake +++ b/testing/cuda/init_arch-user.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -11,7 +11,9 @@ rapids_cuda_init_architectures(rapids-project) project(rapids-project LANGUAGES CUDA) if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES) - message(FATAL_ERROR "CMAKE_CUDA_ARCHITECTURES should exist after calling rapids_cuda_init_architectures()" + message( + FATAL_ERROR + "CMAKE_CUDA_ARCHITECTURES should exist after calling rapids_cuda_init_architectures()" ) endif() diff --git a/testing/cuda/set_arch-existing.cmake b/testing/cuda/set_arch-existing.cmake index 247dc8cc..3c02a7ef 100644 --- a/testing/cuda/set_arch-existing.cmake +++ b/testing/cuda/set_arch-existing.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -14,12 +14,16 @@ set(CMAKE_CUDA_ARCHITECTURES ${user_value}) rapids_cuda_set_architectures(RAPIDS) if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES) - message(FATAL_ERROR "CMAKE_CUDA_ARCHITECTURES should exist after calling rapids_cuda_set_architectures()" + message( + FATAL_ERROR + "CMAKE_CUDA_ARCHITECTURES should exist after calling rapids_cuda_set_architectures()" ) endif() if(CMAKE_CUDA_ARCHITECTURES STREQUAL user_value) - message(FATAL_ERROR "CMAKE_CUDA_ARCHITECTURES should be modified by calling rapids_cuda_set_architectures()" + message( + FATAL_ERROR + "CMAKE_CUDA_ARCHITECTURES should be modified by calling rapids_cuda_set_architectures()" ) endif() @@ -27,11 +31,15 @@ set(CMAKE_CUDA_ARCHITECTURES ${user_value}) rapids_cuda_set_architectures(NATIVE) if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES) - message(FATAL_ERROR "CMAKE_CUDA_ARCHITECTURES should exist after calling rapids_cuda_set_architectures()" + message( + FATAL_ERROR + "CMAKE_CUDA_ARCHITECTURES should exist after calling rapids_cuda_set_architectures()" ) endif() if(CMAKE_CUDA_ARCHITECTURES STREQUAL user_value) - message(FATAL_ERROR "CMAKE_CUDA_ARCHITECTURES should be modified by calling rapids_cuda_set_architectures()" + message( + FATAL_ERROR + "CMAKE_CUDA_ARCHITECTURES should be modified by calling rapids_cuda_set_architectures()" ) endif() diff --git a/testing/cuda/set_arch-invalid-mode.cmake b/testing/cuda/set_arch-invalid-mode.cmake index b7b8df24..ef3458b3 100644 --- a/testing/cuda/set_arch-invalid-mode.cmake +++ b/testing/cuda/set_arch-invalid-mode.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -12,6 +12,9 @@ rapids_cuda_set_architectures(invalid-mode) message(STATUS "CMAKE_CUDA_ARCHITECTURES: ${CMAKE_CUDA_ARCHITECTURES}") if(NOT CMAKE_CUDA_ARCHITECTURES STREQUAL user_value) - message(FATAL_ERROR "CMAKE_CUDA_ARCHITECTURES shouldn't be modified by " - "rapids_cuda_set_architectures() when past an invalid mode") + message( + FATAL_ERROR + "CMAKE_CUDA_ARCHITECTURES shouldn't be modified by " + "rapids_cuda_set_architectures() when past an invalid mode" + ) endif() diff --git a/testing/cuda/set_arch-rapids.cmake b/testing/cuda/set_arch-rapids.cmake index d7953916..4b8f6bdf 100644 --- a/testing/cuda/set_arch-rapids.cmake +++ b/testing/cuda/set_arch-rapids.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -10,7 +10,9 @@ enable_language(CUDA) rapids_cuda_set_architectures(RAPIDS) if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES) - message(FATAL_ERROR "CMAKE_CUDA_ARCHITECTURES should exist after calling rapids_cuda_set_architectures()" + message( + FATAL_ERROR + "CMAKE_CUDA_ARCHITECTURES should exist after calling rapids_cuda_set_architectures()" ) endif() diff --git a/testing/cuda/set_runtime-on-interface-target.cmake b/testing/cuda/set_runtime-on-interface-target.cmake index be19acc8..92aa685c 100644 --- a/testing/cuda/set_runtime-on-interface-target.cmake +++ b/testing/cuda/set_runtime-on-interface-target.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -11,6 +11,8 @@ rapids_cuda_set_runtime(uses_cuda USE_STATIC TRUE) get_target_property(linked_libs uses_cuda INTERFACE_LINK_LIBRARIES) if(NOT "$" IN_LIST linked_libs) - message(FATAL_ERROR "rapids_cuda_set_runtime shouldn't set CUDA::cudart_static in target linked libraries correctly" + message( + FATAL_ERROR + "rapids_cuda_set_runtime shouldn't set CUDA::cudart_static in target linked libraries correctly" ) endif() diff --git a/testing/cuda/validate-cuda-native.cmake b/testing/cuda/validate-cuda-native.cmake index 87fd2aa6..24e59d5d 100644 --- a/testing/cuda/validate-cuda-native.cmake +++ b/testing/cuda/validate-cuda-native.cmake @@ -1,13 +1,12 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= # The only thing we can test is that everything comes back appended with -real foreach(value IN LISTS CMAKE_CUDA_ARCHITECTURES) - # verify it ends with `-real` string(FIND ${value} "-real" location) if(location LESS "0") @@ -19,16 +18,19 @@ foreach(value IN LISTS CMAKE_CUDA_ARCHITECTURES) if(NOT location EQUAL "-1") message(FATAL_ERROR "No values in CMAKE_CUDA_ARCHITECTURES should have `real-real`") endif() - endforeach() if(NOT DEFINED CACHE{CMAKE_CUDA_ARCHITECTURES}) - message(FATAL_ERROR "rapids_cuda_set_architectures didn't make CMAKE_CUDA_ARCHITECTURES a cache variable" + message( + FATAL_ERROR + "rapids_cuda_set_architectures didn't make CMAKE_CUDA_ARCHITECTURES a cache variable" ) endif() -if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 12.8.0 AND CMAKE_CUDA_COMPILER_VERSION - VERSION_LESS 13.0.0) +if( + CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 12.8.0 + AND CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 13.0.0 +) if(NOT CMAKE_CUDA_FLAGS MATCHES "Wno-deprecated-gpu-targets") message(FATAL_ERROR "CMAKE_CUDA_FLAGS should have -Wno-deprecated-gpu-targets") endif() diff --git a/testing/cuda/validate-cuda-rapids.cmake b/testing/cuda/validate-cuda-rapids.cmake index 70ec424c..5f077fe8 100644 --- a/testing/cuda/validate-cuda-rapids.cmake +++ b/testing/cuda/validate-cuda-rapids.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -29,25 +29,35 @@ foreach(value IN LISTS CMAKE_CUDA_ARCHITECTURES) string(REPLACE "-real" "" value "${value}") if(value LESS previous_value) - message(FATAL_ERROR "CMAKE_CUDA_ARCHITECTURES values should be ordered lowest to highest." - "with lowest >= 70") + message( + FATAL_ERROR + "CMAKE_CUDA_ARCHITECTURES values should be ordered lowest to highest." + "with lowest >= 70" + ) endif() endforeach() if(last_value LESS previous_value) - message(FATAL_ERROR "CMAKE_CUDA_ARCHITECTURES values should be ordered lowest to highest." - "with lowest >= 70") + message( + FATAL_ERROR + "CMAKE_CUDA_ARCHITECTURES values should be ordered lowest to highest." + "with lowest >= 70" + ) endif() list(APPEND CMAKE_CUDA_ARCHITECTURES ${last_value}) if(NOT DEFINED CACHE{CMAKE_CUDA_ARCHITECTURES}) - message(FATAL_ERROR "rapids_cuda_set_architectures didn't make CMAKE_CUDA_ARCHITECTURES a cache variable" + message( + FATAL_ERROR + "rapids_cuda_set_architectures didn't make CMAKE_CUDA_ARCHITECTURES a cache variable" ) endif() -if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 12.8.0 AND CMAKE_CUDA_COMPILER_VERSION - VERSION_LESS 13.0.0) +if( + CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 12.8.0 + AND CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 13.0.0 +) if(NOT CMAKE_CUDA_FLAGS MATCHES "Wno-deprecated-gpu-targets") message(FATAL_ERROR "CMAKE_CUDA_FLAGS should have -Wno-deprecated-gpu-targets") endif() diff --git a/testing/cython-core/CMakeLists.txt b/testing/cython-core/CMakeLists.txt index 625b1354..1856982b 100644 --- a/testing/cython-core/CMakeLists.txt +++ b/testing/cython-core/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -8,8 +8,11 @@ add_cmake_config_test(rapids-cython-core.cmake) add_cmake_config_test(cython-core_init.cmake) -add_cmake_config_test(cython-core_create_modules_errors.cmake SHOULD_FAIL - "You must call rapids_cython_init before calling this function") +add_cmake_config_test( + cython-core_create_modules_errors.cmake + SHOULD_FAIL + "You must call rapids_cython_init before calling this function" +) add_cmake_build_test(cython-core_create_modules) add_cmake_config_test(cython-core_create_modules_with_library) diff --git a/testing/cython-core/cython-core_create_modules/CMakeLists.txt b/testing/cython-core/cython-core_create_modules/CMakeLists.txt index 08ee8461..f8ae7cd1 100644 --- a/testing/cython-core/cython-core_create_modules/CMakeLists.txt +++ b/testing/cython-core/cython-core_create_modules/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -27,8 +27,11 @@ endif() # Test that the dependency file was created properly. cmake_path(SET depfile NORMALIZE "${CMAKE_CURRENT_BINARY_DIR}/test.c.dep") add_custom_target(check_depfile_exists ALL DEPENDS test) -add_custom_command(TARGET check_depfile_exists - POST_BUILD - COMMAND ${CMAKE_COMMAND} -DDEPFILE="${depfile}" -P - ${CMAKE_CURRENT_SOURCE_DIR}/check_depfile_exists.cmake - COMMENT "Checking for existence of dependency file") +add_custom_command( + TARGET check_depfile_exists + POST_BUILD + COMMAND + ${CMAKE_COMMAND} -DDEPFILE="${depfile}" -P + ${CMAKE_CURRENT_SOURCE_DIR}/check_depfile_exists.cmake + COMMENT "Checking for existence of dependency file" +) diff --git a/testing/cython-core/cython-core_create_modules/check_depfile_exists.cmake b/testing/cython-core/cython-core_create_modules/check_depfile_exists.cmake index 93b04e20..c885a793 100644 --- a/testing/cython-core/cython-core_create_modules/check_depfile_exists.cmake +++ b/testing/cython-core/cython-core_create_modules/check_depfile_exists.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -10,6 +10,9 @@ if(NOT DEFINED DEPFILE) endif() if(NOT EXISTS "${DEPFILE}") - message(FATAL_ERROR "rapids_cython_create_modules didn't create the dependency file. " - "Expected dependency file: ${DEPFILE}") + message( + FATAL_ERROR + "rapids_cython_create_modules didn't create the dependency file. " + "Expected dependency file: ${DEPFILE}" + ) endif() diff --git a/testing/cython-core/cython-core_create_modules_component/CMakeLists.txt b/testing/cython-core/cython-core_create_modules_component/CMakeLists.txt index 66bc2c20..51e6082c 100644 --- a/testing/cython-core/cython-core_create_modules_component/CMakeLists.txt +++ b/testing/cython-core/cython-core_create_modules_component/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -23,11 +23,13 @@ get_property(_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(_multi_config) set(_config_arg --config $) endif() -add_custom_target(check ALL - COMMAND ${CMAKE_COMMAND} --install . --component Component1 --prefix - install-component1/ ${_config_arg} - COMMAND ${CMAKE_COMMAND} --install . --component Component2 --prefix - install-component2/ ${_config_arg} - COMMAND ${CMAKE_COMMAND} -P - ${CMAKE_CURRENT_SOURCE_DIR}/check_installed_components.cmake) +add_custom_target( + check + ALL + COMMAND + ${CMAKE_COMMAND} --install . --component Component1 --prefix install-component1/ ${_config_arg} + COMMAND + ${CMAKE_COMMAND} --install . --component Component2 --prefix install-component2/ ${_config_arg} + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/check_installed_components.cmake +) add_dependencies(check test1 test2) diff --git a/testing/cython-core/cython-core_create_modules_with_prefix/CMakeLists.txt b/testing/cython-core/cython-core_create_modules_with_prefix/CMakeLists.txt index 16eb9fd7..01f55540 100644 --- a/testing/cython-core/cython-core_create_modules_with_prefix/CMakeLists.txt +++ b/testing/cython-core/cython-core_create_modules_with_prefix/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -21,6 +21,8 @@ rapids_cython_create_modules() rapids_cython_create_modules(SOURCE_FILES test.pyx MODULE_PREFIX "test_") if(NOT TARGET test_test) - message(FATAL_ERROR "rapids_cython_create_modules didn't create the prefixed library target `test_test`" + message( + FATAL_ERROR + "rapids_cython_create_modules didn't create the prefixed library target `test_test`" ) endif() diff --git a/testing/cython-core/cython-core_find_prefix_paths/CMakeLists.txt b/testing/cython-core/cython-core_find_prefix_paths/CMakeLists.txt index bf158072..16be5247 100644 --- a/testing/cython-core/cython-core_find_prefix_paths/CMakeLists.txt +++ b/testing/cython-core/cython-core_find_prefix_paths/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -19,17 +19,23 @@ execute_process(COMMAND ${Python_EXECUTABLE} -m "venv" "${env_dir}") set(Python_EXECUTABLE "${env_dir}/bin/python") -execute_process(COMMAND "${Python_EXECUTABLE}" "-m" "pip" "install" "libucx-cu13") +execute_process( + COMMAND "${Python_EXECUTABLE}" "-m" "pip" "install" "libucx-cu13" +) rapids_cython_find_prefix_paths("${Python_EXECUTABLE}" prefix_paths) -set(_get_platlib - [=[ +set( + _get_platlib + [=[ import sysconfig print(sysconfig.get_path("platlib")) -]=]) +]=] +) -execute_process(COMMAND "${Python_EXECUTABLE}" "-c" "${_get_platlib}" - OUTPUT_VARIABLE site_packages_path) +execute_process( + COMMAND "${Python_EXECUTABLE}" "-c" "${_get_platlib}" + OUTPUT_VARIABLE site_packages_path +) string(STRIP "${site_packages_path}" site_packages_path) set(libucx_path "${site_packages_path}/libucx") diff --git a/testing/export/CMakeLists.txt b/testing/export/CMakeLists.txt index 71ddcec2..db0c33af 100644 --- a/testing/export/CMakeLists.txt +++ b/testing/export/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -21,14 +21,26 @@ add_cmake_build_test(export-verify-global-targets) add_cmake_build_test(export-verify-install-components) add_cmake_build_test(export-verify-no-namespace) -add_cmake_config_test(export-verify-bad-code-block-var.cmake SHOULD_FAIL - "FINAL_CODE_BLOCK variable `var_doesn't_exist` doesn't exist") -add_cmake_config_test(export-verify-missing-components.cmake SHOULD_FAIL - "is missing COMPONENTS as COMPONENTS_EXPORT_SET was provided") -add_cmake_config_test(export-verify-missing-components-export.cmake SHOULD_FAIL - "is missing COMPONENTS_EXPOR22T_SET as COMPONENTS was provided") -add_cmake_config_test(export-verify-bad-doc-var.cmake SHOULD_FAIL - "DOCUMENTATION variable `var_doesn't_exist` doesn't exist") +add_cmake_config_test( + export-verify-bad-code-block-var.cmake + SHOULD_FAIL + "FINAL_CODE_BLOCK variable `var_doesn't_exist` doesn't exist" +) +add_cmake_config_test( + export-verify-missing-components.cmake + SHOULD_FAIL + "is missing COMPONENTS as COMPONENTS_EXPORT_SET was provided" +) +add_cmake_config_test( + export-verify-missing-components-export.cmake + SHOULD_FAIL + "is missing COMPONENTS_EXPOR22T_SET as COMPONENTS was provided" +) +add_cmake_config_test( + export-verify-bad-doc-var.cmake + SHOULD_FAIL + "DOCUMENTATION variable `var_doesn't_exist` doesn't exist" +) add_cmake_config_test(export-verify-calendar-version-matching.cmake) add_cmake_config_test(export-verify-explicit-disabled-version.cmake) add_cmake_config_test(export-verify-explicit-major-version-only-matching.cmake) diff --git a/testing/export/export-verify-build-components-dependencies/CMakeLists.txt b/testing/export/export-verify-build-components-dependencies/CMakeLists.txt index 94a934a6..dc906ae6 100644 --- a/testing/export/export-verify-build-components-dependencies/CMakeLists.txt +++ b/testing/export/export-verify-build-components-dependencies/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -18,17 +18,21 @@ install(TARGETS fakeLib_c1 EXPORT fake_set_c1_export) include(${rapids-cmake-dir}/export/package.cmake) rapids_export_package(build CUDAToolkit fake_set_c1_export) -rapids_export(BUILD FakEProJecT - EXPORT_SET fake_set - COMPONENTS c1 - COMPONENTS_EXPORT_SET fake_set_c1_export - LANGUAGES CXX - NAMESPACE test::) +rapids_export( + BUILD + FakEProJecT + EXPORT_SET fake_set + COMPONENTS c1 + COMPONENTS_EXPORT_SET fake_set_c1_export + LANGUAGES CXX + NAMESPACE test:: +) # Add a custom command that generates a second project that verifies our component targets are # exported correctly -file(WRITE "${CMAKE_BINARY_DIR}/verify-1/CMakeLists.txt" - [=[ +file( + WRITE "${CMAKE_BINARY_DIR}/verify-1/CMakeLists.txt" + [=[ cmake_minimum_required(VERSION 3.20) project(verify_build_targets LANGUAGES CXX) set(nice_names c1-fake_set) @@ -38,17 +42,21 @@ foreach(nice_name IN ZIP_LISTS components export_sets) message(FATAL_ERROR "rapids_export failed to generate correct dependencies imports[fakeproject-${nice_names}-dependencies.cmake]") endif() endforeach() -]=]) +]=] +) -add_custom_target(verify_target_dependencies_files ALL - COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/verify-1/build" - COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/verify-1" - -B="${CMAKE_BINARY_DIR}/verify-1/build") +add_custom_target( + verify_target_dependencies_files + ALL + COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/verify-1/build" + COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/verify-1" -B="${CMAKE_BINARY_DIR}/verify-1/build" +) # Add a custom command that generates a second project that verifies our component targets are # exported correctly -file(WRITE "${CMAKE_BINARY_DIR}/verify-2/CMakeLists.txt" - [=[ +file( + WRITE "${CMAKE_BINARY_DIR}/verify-2/CMakeLists.txt" + [=[ cmake_minimum_required(VERSION 3.20) project(verify_build_targets LANGUAGES CXX) @@ -57,9 +65,12 @@ find_package(fakeproject COMPONENTS c1 REQUIRED) if(NOT TARGET CUDA::toolkit) message(FATAL_ERROR "rapids_export failed to generate correct dependencies imports") endif() -]=]) +]=] +) -add_custom_target(verify_target_dependencies_find ALL - COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/verify-2/build" - COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/verify-2" - -B="${CMAKE_BINARY_DIR}/verify-2/build") +add_custom_target( + verify_target_dependencies_find + ALL + COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/verify-2/build" + COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/verify-2" -B="${CMAKE_BINARY_DIR}/verify-2/build" +) diff --git a/testing/export/export-verify-build-components-targets/CMakeLists.txt b/testing/export/export-verify-build-components-targets/CMakeLists.txt index d90e07e3..c27b06fe 100644 --- a/testing/export/export-verify-build-components-targets/CMakeLists.txt +++ b/testing/export/export-verify-build-components-targets/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -18,16 +18,20 @@ install(TARGETS fakeLib_c1 EXPORT fake_set_c1) add_library(fakeLib_c2 INTERFACE) install(TARGETS fakeLib_c2 EXPORT fake_set_c2-exports) -rapids_export(BUILD fake - EXPORT_SET fake_set - COMPONENTS c1 c2 - COMPONENTS_EXPORT_SET fake_set_c1 fake_set_c2-exports - NAMESPACE test::) +rapids_export( + BUILD + fake + EXPORT_SET fake_set + COMPONENTS c1 c2 + COMPONENTS_EXPORT_SET fake_set_c1 fake_set_c2-exports + NAMESPACE test:: +) # Add a custom command that generates a second project that verifies our component targets are # exported correctly -file(WRITE "${CMAKE_BINARY_DIR}/verify-1/CMakeLists.txt" - [=[ +file( + WRITE "${CMAKE_BINARY_DIR}/verify-1/CMakeLists.txt" + [=[ cmake_minimum_required(VERSION 3.20) project(verify_build_targets LANGUAGES CXX) @@ -39,17 +43,21 @@ foreach(comp nice_name IN ZIP_LISTS components nice_names) message(FATAL_ERROR "rapids_export failed to generate correct component target of test::fakeLib_${comp}") endif() endforeach() -]=]) +]=] +) -add_custom_target(verify_target_component_files ALL - COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/verify-1/build" - COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/verify-1" - -B="${CMAKE_BINARY_DIR}/verify-1/build") +add_custom_target( + verify_target_component_files + ALL + COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/verify-1/build" + COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/verify-1" -B="${CMAKE_BINARY_DIR}/verify-1/build" +) # Add a custom command that generates a second project that verifies our component aren't brought in # with `find_package()` -file(WRITE "${CMAKE_BINARY_DIR}/verify-2/CMakeLists.txt" - [=[ +file( + WRITE "${CMAKE_BINARY_DIR}/verify-2/CMakeLists.txt" + [=[ cmake_minimum_required(VERSION 3.20) project(verify_build_targets LANGUAGES CXX) @@ -58,17 +66,21 @@ find_package(fake REQUIRED) if(TARGET test::fakeLib_c1 OR TARGET test::fakeLib_c2) message(FATAL_ERROR "incorrectly included generated components without COMPONENTS keyword to `find_package`") endif() -]=]) +]=] +) -add_custom_target(verify_target_find_package ALL - COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/verify-2/build" - COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/verify-2" - -B="${CMAKE_BINARY_DIR}/verify-2/build") +add_custom_target( + verify_target_find_package + ALL + COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/verify-2/build" + COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/verify-2" -B="${CMAKE_BINARY_DIR}/verify-2/build" +) # Add a custom command that generates a second project that verifies our component are brought in # with `find_package(COMPONENTS)` -file(WRITE "${CMAKE_BINARY_DIR}/verify-3/CMakeLists.txt" - [=[ +file( + WRITE "${CMAKE_BINARY_DIR}/verify-3/CMakeLists.txt" + [=[ cmake_minimum_required(VERSION 3.20) project(verify_build_targets LANGUAGES CXX) @@ -77,9 +89,12 @@ find_package(fake COMPONENTS c1 c2 REQUIRED) if(NOT (TARGET test::fakeLib_c1 AND TARGET test::fakeLib_c2)) message(FATAL_ERROR "find_package(COMPONENTS) failed to bring in components") endif() -]=]) +]=] +) -add_custom_target(verify_target_find_components ALL - COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/verify-3/build" - COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/verify-3" - -B="${CMAKE_BINARY_DIR}/verify-3/build") +add_custom_target( + verify_target_find_components + ALL + COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/verify-3/build" + COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/verify-3" -B="${CMAKE_BINARY_DIR}/verify-3/build" +) diff --git a/testing/export/export-verify-build-multiple-export-sets-to-single-component/CMakeLists.txt b/testing/export/export-verify-build-multiple-export-sets-to-single-component/CMakeLists.txt index 990c44e5..f427d03d 100644 --- a/testing/export/export-verify-build-multiple-export-sets-to-single-component/CMakeLists.txt +++ b/testing/export/export-verify-build-multiple-export-sets-to-single-component/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -18,16 +18,20 @@ install(TARGETS fakeLib_c1 EXPORT fake_c1-export) add_library(fakeLib_c1-lib INTERFACE) install(TARGETS fakeLib_c1-lib EXPORT fake-c1-lib-exports) -rapids_export(BUILD fake - EXPORT_SET fake_set - COMPONENTS c1 c1 - COMPONENTS_EXPORT_SET fake_c1-export fake-c1-lib-exports - NAMESPACE test::) +rapids_export( + BUILD + fake + EXPORT_SET fake_set + COMPONENTS c1 c1 + COMPONENTS_EXPORT_SET fake_c1-export fake-c1-lib-exports + NAMESPACE test:: +) # Add a custom command that generates a second project that verifies our component targets are # exported correctly -file(WRITE "${CMAKE_BINARY_DIR}/verify-1/CMakeLists.txt" - [=[ +file( + WRITE "${CMAKE_BINARY_DIR}/verify-1/CMakeLists.txt" + [=[ cmake_minimum_required(VERSION 3.20) project(verify_build_targets LANGUAGES CXX) @@ -38,17 +42,21 @@ foreach(export_set IN LISTS export_sets) message(FATAL_ERROR "rapids_export failed to generate correct component target of test::fakeLib_${export_set}") endif() endforeach() -]=]) +]=] +) -add_custom_target(verify_target_component_files ALL - COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/verify-1/build" - COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/verify-1" - -B="${CMAKE_BINARY_DIR}/verify-1/build") +add_custom_target( + verify_target_component_files + ALL + COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/verify-1/build" + COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/verify-1" -B="${CMAKE_BINARY_DIR}/verify-1/build" +) # Add a custom command that generates a second project that verifies our component aren't brought in # with `find_package()` -file(WRITE "${CMAKE_BINARY_DIR}/verify-2/CMakeLists.txt" - [=[ +file( + WRITE "${CMAKE_BINARY_DIR}/verify-2/CMakeLists.txt" + [=[ cmake_minimum_required(VERSION 3.20) project(verify_build_targets LANGUAGES CXX) @@ -57,17 +65,21 @@ find_package(fake REQUIRED) if(TARGET test::fakeLib_c1 OR TARGET test::fakeLib_c1-lib) message(FATAL_ERROR "incorrectly included generated components without COMPONENTS keyword to `find_package`") endif() -]=]) +]=] +) -add_custom_target(verify_target_find_package ALL - COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/verify-2/build" - COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/verify-2" - -B="${CMAKE_BINARY_DIR}/verify-2/build") +add_custom_target( + verify_target_find_package + ALL + COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/verify-2/build" + COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/verify-2" -B="${CMAKE_BINARY_DIR}/verify-2/build" +) # Add a custom command that generates a second project that verifies our component are brought in # with `find_package(COMPONENTS)` -file(WRITE "${CMAKE_BINARY_DIR}/verify-3/CMakeLists.txt" - [=[ +file( + WRITE "${CMAKE_BINARY_DIR}/verify-3/CMakeLists.txt" + [=[ cmake_minimum_required(VERSION 3.20) project(verify_build_targets LANGUAGES CXX) @@ -76,9 +88,12 @@ find_package(fake COMPONENTS c1 REQUIRED) if(NOT (TARGET test::fakeLib_c1 AND TARGET test::fakeLib_c1-lib)) message(FATAL_ERROR "find_package(COMPONENTS) failed to bring in components") endif() -]=]) +]=] +) -add_custom_target(verify_target_find_components ALL - COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/verify-3/build" - COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/verify-3" - -B="${CMAKE_BINARY_DIR}/verify-3/build") +add_custom_target( + verify_target_find_components + ALL + COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/verify-3/build" + COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/verify-3" -B="${CMAKE_BINARY_DIR}/verify-3/build" +) diff --git a/testing/export/export-verify-build-namespaces/CMakeLists.txt b/testing/export/export-verify-build-namespaces/CMakeLists.txt index 83b57c7e..5920dccd 100644 --- a/testing/export/export-verify-build-namespaces/CMakeLists.txt +++ b/testing/export/export-verify-build-namespaces/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -16,8 +16,9 @@ rapids_export(BUILD FakEProJecT EXPORT_SET fake_set LANGUAGES CXX NAMESPACE test # Add a custom command that generates a second project that verifies our target was exported with # the correct namespace -file(WRITE "${CMAKE_BINARY_DIR}/verify/CMakeLists.txt" - [=[ +file( + WRITE "${CMAKE_BINARY_DIR}/verify/CMakeLists.txt" + [=[ cmake_minimum_required(VERSION 3.30.4) project(verify_build_targets LANGUAGES CXX) message(STATUS "${CMAKE_CURRENT_LIST_DIR}/../fakeproject-targets.cmake") @@ -28,9 +29,12 @@ include("${CMAKE_CURRENT_LIST_DIR}/../fakeproject-targets.cmake") if(NOT TARGET test::fakeLib) message(FATAL_ERROR "rapids_export failed to generate correct namespace targets") endif() - ]=]) + ]=] +) -add_custom_target(verify_target_file ALL - COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/verify/build" - COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/verify" - -B="${CMAKE_BINARY_DIR}/verify/build") +add_custom_target( + verify_target_file + ALL + COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/verify/build" + COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/verify" -B="${CMAKE_BINARY_DIR}/verify/build" +) diff --git a/testing/export/export-verify-code-block/CMakeLists.txt b/testing/export/export-verify-code-block/CMakeLists.txt index 589a986e..a6476d18 100644 --- a/testing/export/export-verify-code-block/CMakeLists.txt +++ b/testing/export/export-verify-code-block/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -12,17 +12,20 @@ project(FakEProJecT LANGUAGES CXX VERSION 3.1.4) add_library(fakeLib INTERFACE) install(TARGETS fakeLib EXPORT fake_set) -set(code_block - [=[ +set( + code_block + [=[ set(code_block_variable "Unique String To Verify") -]=]) +]=] +) rapids_export(BUILD FakEProJecT EXPORT_SET fake_set NAMESPACE test:: FINAL_CODE_BLOCK code_block) # Add a custom command that generates a second project that verifies our target was exported with # the correct namespace -file(WRITE "${CMAKE_BINARY_DIR}/verify/CMakeLists.txt" - [=[ +file( + WRITE "${CMAKE_BINARY_DIR}/verify/CMakeLists.txt" + [=[ cmake_minimum_required(VERSION 3.30.4) project(verify_build_targets LANGUAGES CXX) message(STATUS "${CMAKE_CURRENT_LIST_DIR}/../fakeproject-config.cmake") @@ -35,9 +38,12 @@ include("${CMAKE_CURRENT_LIST_DIR}/../fakeproject-config.cmake") if(NOT code_block_variable STREQUAL "Unique String To Verify") message(FATAL_ERROR "rapids_export failed to generate correct final code block") endif() - ]=]) + ]=] +) -add_custom_target(verify_target_file ALL - COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/verify/build" - COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/verify" - -B="${CMAKE_BINARY_DIR}/verify/build") +add_custom_target( + verify_target_file + ALL + COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/verify/build" + COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/verify" -B="${CMAKE_BINARY_DIR}/verify/build" +) diff --git a/testing/export/export-verify-copyright-header.cmake b/testing/export/export-verify-copyright-header.cmake index 1bbcff73..012098ba 100644 --- a/testing/export/export-verify-copyright-header.cmake +++ b/testing/export/export-verify-copyright-header.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -23,7 +23,8 @@ rapids_export(BUILD FakEProJecT EXPORT_SET fake_set NAMESPACE test::) rapids_export(INSTALL FakEProJecT EXPORT_SET fake_set NAMESPACE test::) check_copyright_header("${CMAKE_BINARY_DIR}/fakeproject-config.cmake") -check_copyright_header("${CMAKE_BINARY_DIR}/rapids-cmake/fakeproject/export/fakeproject/fakeproject-config.cmake" +check_copyright_header( + "${CMAKE_BINARY_DIR}/rapids-cmake/fakeproject/export/fakeproject/fakeproject-config.cmake" ) check_copyright_header("${CMAKE_BINARY_DIR}/rapids-cmake/FakEProJecT/build/cpm_RaFT.cmake") check_copyright_header("${CMAKE_BINARY_DIR}/dependencies.cmake") diff --git a/testing/export/export-verify-doc-string/CMakeLists.txt b/testing/export/export-verify-doc-string/CMakeLists.txt index 5af2148d..b93b27ca 100644 --- a/testing/export/export-verify-doc-string/CMakeLists.txt +++ b/testing/export/export-verify-doc-string/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -12,17 +12,20 @@ project(FakEProJecT LANGUAGES CXX VERSION 3.1.4) add_library(fakeLib INTERFACE) install(TARGETS fakeLib EXPORT fake_set) -set(doc_string - [=[ +set( + doc_string + [=[ Unique String To Verify. -]=]) +]=] +) rapids_export(BUILD FakEProJecT EXPORT_SET fake_set NAMESPACE test:: DOCUMENTATION doc_string) # Add a custom command that generates a second project that verifies our target was exported with # the correct namespace -file(WRITE "${CMAKE_BINARY_DIR}/verify/CMakeLists.txt" - [=[ +file( + WRITE "${CMAKE_BINARY_DIR}/verify/CMakeLists.txt" + [=[ cmake_minimum_required(VERSION 3.30.4) project(verify_build_targets LANGUAGES CXX) message(STATUS "${CMAKE_CURRENT_LIST_DIR}/../fakeproject-config.cmake") @@ -34,9 +37,12 @@ string(FIND "${contents}" "Unique String To Verify" is_found) if(is_found EQUAL -1) message(FATAL_ERROR "rapids_export failed to generate correct doc string") endif() - ]=]) + ]=] +) -add_custom_target(verify_target_file ALL - COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/verify/build" - COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/verify" - -B="${CMAKE_BINARY_DIR}/verify/build") +add_custom_target( + verify_target_file + ALL + COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/verify/build" + COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/verify" -B="${CMAKE_BINARY_DIR}/verify/build" +) diff --git a/testing/export/export-verify-global-targets/CMakeLists.txt b/testing/export/export-verify-global-targets/CMakeLists.txt index ca273c5d..7340cf0c 100644 --- a/testing/export/export-verify-global-targets/CMakeLists.txt +++ b/testing/export/export-verify-global-targets/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -12,16 +12,20 @@ project(FakEProJecT LANGUAGES CXX VERSION 3.1.4) add_library(fakeLib INTERFACE) install(TARGETS fakeLib EXPORT fake_set) -rapids_export(BUILD FakEProJecT - GLOBAL_TARGETS fakeLib - EXPORT_SET fake_set - LANGUAGES CXX - NAMESPACE test::) +rapids_export( + BUILD + FakEProJecT + GLOBAL_TARGETS fakeLib + EXPORT_SET fake_set + LANGUAGES CXX + NAMESPACE test:: +) # Add a custom command that generates a second project that verifies our target was exported with # the correct namespace -file(WRITE "${CMAKE_BINARY_DIR}/verify/CMakeLists.txt" - [=[ +file( + WRITE "${CMAKE_BINARY_DIR}/verify/CMakeLists.txt" + [=[ cmake_minimum_required(VERSION 3.30.4) project(verify_build_targets LANGUAGES CXX) message(STATUS "${CMAKE_CURRENT_LIST_DIR}/../fakeproject-config.cmake") @@ -38,9 +42,12 @@ get_target_property(_is_global test::fakeLib IMPORTED_GLOBAL) if(NOT _is_global) message(FATAL_ERROR "rapids_export failed to mark target as global") endif() -]=]) +]=] +) -add_custom_target(verify_target_file ALL - COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/verify/build" - COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/verify" - -B="${CMAKE_BINARY_DIR}/verify/build") +add_custom_target( + verify_target_file + ALL + COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/verify/build" + COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/verify" -B="${CMAKE_BINARY_DIR}/verify/build" +) diff --git a/testing/export/export-verify-install-components/CMakeLists.txt b/testing/export/export-verify-install-components/CMakeLists.txt index dcc85fe8..2564a2da 100644 --- a/testing/export/export-verify-install-components/CMakeLists.txt +++ b/testing/export/export-verify-install-components/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -24,24 +24,28 @@ add_library(fakeLib_c2_lib INTERFACE) install(TARGETS fakeLib_c2_lib EXPORT fake_c2-lib_exports) set(CMAKE_INSTALL_LIBDIR "lib64") -rapids_export(INSTALL fake - EXPORT_SET fake_set - COMPONENTS c1 c2 c2 - COMPONENTS_EXPORT_SET fake_c1_export fake_c2_exports fake_c2-lib_exports - NAMESPACE test::) +rapids_export( + INSTALL + fake + EXPORT_SET fake_set + COMPONENTS c1 c2 c2 + COMPONENTS_EXPORT_SET fake_c1_export fake_c2_exports fake_c2-lib_exports + NAMESPACE test:: +) # Add a custom command that install each component into a different temp location -add_custom_target(install_each_component_files ALL - COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --component fake --prefix - install/fake/ - COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --component c1 --prefix - install/c1/ - COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --component c2 --prefix - install/c2/) +add_custom_target( + install_each_component_files + ALL + COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --component fake --prefix install/fake/ + COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --component c1 --prefix install/c1/ + COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --component c2 --prefix install/c2/ +) # Add a custom command that verifies that the expect files have been installed for each component -file(WRITE "${CMAKE_BINARY_DIR}/install/CMakeLists.txt" - [=[ +file( + WRITE "${CMAKE_BINARY_DIR}/install/CMakeLists.txt" + [=[ cmake_minimum_required(VERSION 3.20) project(verify_install_targets LANGUAGES CXX) @@ -64,10 +68,13 @@ foreach(file IN LISTS fake_files c1_files c2_files) message(FATAL_ERROR "rapids_export(COMPONENTS) failed to install ${file}") endif() endforeach() -]=]) +]=] +) -add_custom_target(verify_install_components ALL - COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/install/build" - COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/install" - -B="${CMAKE_BINARY_DIR}/install/build") +add_custom_target( + verify_install_components + ALL + COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/install/build" + COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/install" -B="${CMAKE_BINARY_DIR}/install/build" +) add_dependencies(verify_install_components install_each_component_files) diff --git a/testing/export/export-verify-missing-components.cmake b/testing/export/export-verify-missing-components.cmake index d8f885a9..86b61d54 100644 --- a/testing/export/export-verify-missing-components.cmake +++ b/testing/export/export-verify-missing-components.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -15,5 +15,10 @@ install(TARGETS fakeLib EXPORT fake_set) add_library(fakeLib_c1 INTERFACE) install(TARGETS fakeLib_c1 EXPORT fake_set_c1) -rapids_export(BUILD FakEProJecT EXPORT_SET fake_set COMPONENTS_EXPORT_SET fake_set_c1 - NAMESPACE test::) +rapids_export( + BUILD + FakEProJecT + EXPORT_SET fake_set + COMPONENTS_EXPORT_SET fake_set_c1 + NAMESPACE test:: +) diff --git a/testing/export/export-verify-no-namespace/CMakeLists.txt b/testing/export/export-verify-no-namespace/CMakeLists.txt index 2db36c60..245fdb01 100644 --- a/testing/export/export-verify-no-namespace/CMakeLists.txt +++ b/testing/export/export-verify-no-namespace/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -18,8 +18,9 @@ rapids_export(BUILD FakEProJecT EXPORT_SET fake_set LANGUAGES CXX) # Add a custom command that generates a second project that verifies our target was exported with # the correct namespace -file(WRITE "${CMAKE_BINARY_DIR}/verify/CMakeLists.txt" - [=[ +file( + WRITE "${CMAKE_BINARY_DIR}/verify/CMakeLists.txt" + [=[ cmake_minimum_required(VERSION 3.30.4) project(verify_build_targets LANGUAGES CXX) message(STATUS "${CMAKE_CURRENT_LIST_DIR}/../fakeproject-targets.cmake") @@ -33,9 +34,12 @@ endif() if(NOT TARGET namespacefor2only) message(FATAL_ERROR "rapids_export failed to generate correct namespace targets") endif() - ]=]) + ]=] +) -add_custom_target(verify_target_file ALL - COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/verify/build" - COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/verify" - -B="${CMAKE_BINARY_DIR}/verify/build") +add_custom_target( + verify_target_file + ALL + COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/verify/build" + COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/verify" -B="${CMAKE_BINARY_DIR}/verify/build" +) diff --git a/testing/export/export_component-build/CMakeLists.txt b/testing/export/export_component-build/CMakeLists.txt index 51eb6304..1d8bfb8f 100644 --- a/testing/export/export_component-build/CMakeLists.txt +++ b/testing/export/export_component-build/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -19,8 +19,9 @@ rapids_export_component(BUILD fakeproject component1 fake_set fake_set test::c1: # Add a custom command that generates a second project that verifies our component targets are # exported correctly -file(WRITE "${CMAKE_BINARY_DIR}/verify-1/CMakeLists.txt" - [=[ +file( + WRITE "${CMAKE_BINARY_DIR}/verify-1/CMakeLists.txt" + [=[ cmake_minimum_required(VERSION 3.20) project(verify_build_targets LANGUAGES CXX) @@ -44,9 +45,12 @@ if(NOT TARGET CUDA::toolkit) message(FATAL_ERROR "rapids_export failed to write a correct `CUDAToolkit` dependency") endif() -]=]) +]=] +) -add_custom_target(verify_target_component_files ALL - COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/verify-1/build" - COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/verify-1" - -B="${CMAKE_BINARY_DIR}/verify-1/build") +add_custom_target( + verify_target_component_files + ALL + COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/verify-1/build" + COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/verify-1" -B="${CMAKE_BINARY_DIR}/verify-1/build" +) diff --git a/testing/export/export_cpm-build-possible-dir.cmake b/testing/export/export_cpm-build-possible-dir.cmake index c0410b52..72a0b34e 100644 --- a/testing/export/export_cpm-build-possible-dir.cmake +++ b/testing/export/export_cpm-build-possible-dir.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -27,8 +27,13 @@ endif() # Verify in-valid dir is ignored set(also_fake_cpm_package_DIR OFF) set(also_fake_cpm_package_BINARY_DIR /binary/dir/path/) -rapids_export_cpm(BUILD also_fake_cpm_package test_export_set CPM_ARGS VERSION 2.0 - GLOBAL_TARGETS ABC::ABC ABC::CBA) +rapids_export_cpm( + BUILD + also_fake_cpm_package + test_export_set + CPM_ARGS VERSION 2.0 + GLOBAL_TARGETS ABC::ABC ABC::CBA +) set(path "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/build/cpm_also_fake_cpm_package.cmake") if(NOT EXISTS "${path}") message(FATAL_ERROR "rapids_export_cpm failed to generate a CPM configuration") diff --git a/testing/export/export_cpm-build.cmake b/testing/export/export_cpm-build.cmake index d2592f34..11640370 100644 --- a/testing/export/export_cpm-build.cmake +++ b/testing/export/export_cpm-build.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -8,8 +8,13 @@ include(${rapids-cmake-dir}/export/cpm.cmake) rapids_export_cpm(build FAKE_CPM_PACKAGE test_export_set CPM_ARGS FAKE_PACKAGE_ARGS TRUE) -rapids_export_cpm(BUILD SECOND_FAKE_CPM_PACKAGE test_export_set CPM_ARGS VERSION 2.0 - GLOBAL_TARGETS ABC::ABC ABC::CBA) +rapids_export_cpm( + BUILD + SECOND_FAKE_CPM_PACKAGE + test_export_set + CPM_ARGS VERSION 2.0 + GLOBAL_TARGETS ABC::ABC ABC::CBA +) if(NOT TARGET rapids_export_build_test_export_set) message(FATAL_ERROR "rapids_export_cpm failed to generate target for build") @@ -21,7 +26,9 @@ if(NOT FAKE_CPM_PACKAGE IN_LIST packages) message(FATAL_ERROR "rapids_export_cpm failed to record FAKE_CPM_PACKAGE needs to be exported") endif() if(NOT SECOND_FAKE_CPM_PACKAGE IN_LIST packages) - message(FATAL_ERROR "rapids_export_cpm failed to record SECOND_FAKE_CPM_PACKAGE needs to be exported" + message( + FATAL_ERROR + "rapids_export_cpm failed to record SECOND_FAKE_CPM_PACKAGE needs to be exported" ) endif() @@ -41,8 +48,12 @@ if(NOT requires_cpm) endif() # Verify that cpm configuration files exist -if(NOT EXISTS "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/build/cpm_FAKE_CPM_PACKAGE.cmake" - OR NOT EXISTS - "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/build/cpm_SECOND_FAKE_CPM_PACKAGE.cmake") +if( + NOT EXISTS "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/build/cpm_FAKE_CPM_PACKAGE.cmake" + OR + NOT + EXISTS + "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/build/cpm_SECOND_FAKE_CPM_PACKAGE.cmake" +) message(FATAL_ERROR "rapids_export_cpm failed to generate a CPM configuration") endif() diff --git a/testing/export/export_cpm-install.cmake b/testing/export/export_cpm-install.cmake index 0fc14786..6321a03d 100644 --- a/testing/export/export_cpm-install.cmake +++ b/testing/export/export_cpm-install.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -8,8 +8,13 @@ include(${rapids-cmake-dir}/export/cpm.cmake) rapids_export_cpm(INSTALL RaFT fake_set CPM_ARGS FAKE_PACKAGE_ARGS TRUE) -rapids_export_cpm(install RMM fake_set CPM_ARGS VERSION 2.0 FAKE_PACKAGE_ARGS FALSE - GLOBAL_TARGETS RMM::RMM_POOL) +rapids_export_cpm( + install + RMM + fake_set + CPM_ARGS VERSION 2.0 FAKE_PACKAGE_ARGS FALSE + GLOBAL_TARGETS RMM::RMM_POOL +) if(NOT TARGET rapids_export_install_fake_set) message(FATAL_ERROR "rapids_export_cpm failed to generate target for install") @@ -37,7 +42,9 @@ if(NOT requires_cpm) endif() # Verify that cpm configuration files exist -if(NOT EXISTS "${CMAKE_BINARY_DIR}/rapids-cmake/fake_set/install/cpm_RaFT.cmake" - OR NOT EXISTS "${CMAKE_BINARY_DIR}/rapids-cmake/fake_set/install/cpm_RMM.cmake") +if( + NOT EXISTS "${CMAKE_BINARY_DIR}/rapids-cmake/fake_set/install/cpm_RaFT.cmake" + OR NOT EXISTS "${CMAKE_BINARY_DIR}/rapids-cmake/fake_set/install/cpm_RMM.cmake" +) message(FATAL_ERROR "rapids_export_cpm failed to generate a CPM configuration") endif() diff --git a/testing/export/export_cpm-options-escaped.cmake b/testing/export/export_cpm-options-escaped.cmake index a3717bea..a7051cd4 100644 --- a/testing/export/export_cpm-options-escaped.cmake +++ b/testing/export/export_cpm-options-escaped.cmake @@ -1,18 +1,30 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= include(${rapids-cmake-dir}/export/cpm.cmake) -rapids_export_cpm(build FAKE_CPM_PACKAGE test_export_set - CPM_ARGS NAME FAKE_CPM_PACKAGE VERSION 1.0 OPTIONS "FAKE_PACKAGE_OPTION_A TRUE" - "FAKE_PACKAGE_OPTION_B FALSE") +rapids_export_cpm( + build + FAKE_CPM_PACKAGE + test_export_set + CPM_ARGS + NAME FAKE_CPM_PACKAGE + VERSION 1.0 + OPTIONS "FAKE_PACKAGE_OPTION_A TRUE" "FAKE_PACKAGE_OPTION_B FALSE" +) -rapids_export_cpm(install FAKE_CPM_PACKAGE test_export_set - CPM_ARGS NAME FAKE_CPM_PACKAGE VERSION 1.0 OPTIONS "FAKE_PACKAGE_OPTION_A TRUE" - "FAKE_PACKAGE_OPTION_B FALSE") +rapids_export_cpm( + install + FAKE_CPM_PACKAGE + test_export_set + CPM_ARGS + NAME FAKE_CPM_PACKAGE + VERSION 1.0 + OPTIONS "FAKE_PACKAGE_OPTION_A TRUE" "FAKE_PACKAGE_OPTION_B FALSE" +) if(NOT EXISTS "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/build/cpm_FAKE_CPM_PACKAGE.cmake") message(FATAL_ERROR "rapids_export_cpm(BUILD) failed to generate a CPM configuration") @@ -24,19 +36,24 @@ endif() # We need to validate both of the files all CPM args in quotes # -set(to_match_string - [=["NAME;FAKE_CPM_PACKAGE;VERSION;1.0;OPTIONS;FAKE_PACKAGE_OPTION_A TRUE;FAKE_PACKAGE_OPTION_B FALSE"]=] +set( + to_match_string + [=["NAME;FAKE_CPM_PACKAGE;VERSION;1.0;OPTIONS;FAKE_PACKAGE_OPTION_A TRUE;FAKE_PACKAGE_OPTION_B FALSE"]=] ) -file(READ "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/build/cpm_FAKE_CPM_PACKAGE.cmake" - contents) +file( + READ "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/build/cpm_FAKE_CPM_PACKAGE.cmake" + contents +) string(FIND "${contents}" "${to_match_string}" is_found) if(is_found EQUAL -1) message(FATAL_ERROR "rapids_export_cpm(BUILD) failed to preserve quotes around CPM arguments") endif() -file(READ "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/install/cpm_FAKE_CPM_PACKAGE.cmake" - contents) +file( + READ "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/install/cpm_FAKE_CPM_PACKAGE.cmake" + contents +) string(FIND "${contents}" "${to_match_string}" is_found) if(is_found EQUAL -1) message(FATAL_ERROR "rapids_export_cpm(INSTALL) failed to preserve quotes around CPM arguments") diff --git a/testing/export/export_package-build-post-find-code.cmake b/testing/export/export_package-build-post-find-code.cmake index 133e4010..d7a8f51d 100644 --- a/testing/export/export_package-build-post-find-code.cmake +++ b/testing/export/export_package-build-post-find-code.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -10,24 +10,39 @@ include(${rapids-cmake-dir}/export/detail/post_find_package_code.cmake) rapids_export_package(BUILD FAKE_PACKAGE test_export_set VERSION 22.08) rapids_export_post_find_package_code(BUILD FAKE_PACKAGE "set(a ON)" EXPORT_SET test_export_set) rapids_export_post_find_package_code( - bUILd FAKE_PACKAGE [=[ + bUILd + FAKE_PACKAGE + [=[ set(b ON) -set(c ON)]=] EXPORT_SET test_export_set) -rapids_export_post_find_package_code(build FAKE_PACKAGE "set(d ON);set(e ON)" EXPORT_SET - test_export_set) +set(c ON)]=] + EXPORT_SET test_export_set +) +rapids_export_post_find_package_code( + build + FAKE_PACKAGE + "set(d ON);set(e ON)" + EXPORT_SET test_export_set +) include(${rapids-cmake-dir}/export/write_dependencies.cmake) -rapids_export_write_dependencies(BUILD test_export_set - "${CMAKE_CURRENT_BINARY_DIR}/install_export_set.cmake") +rapids_export_write_dependencies( + BUILD + test_export_set + "${CMAKE_CURRENT_BINARY_DIR}/install_export_set.cmake" +) -set(to_match - [=[if(FAKE_PACKAGE_FOUND)_set(a ON)_set(b ON)_set(c ON)_set(d ON)_set(e ON)__endif()]=]) +set( + to_match + [=[if(FAKE_PACKAGE_FOUND)_set(a ON)_set(b ON)_set(c ON)_set(d ON)_set(e ON)__endif()]=] +) file(STRINGS "${CMAKE_CURRENT_BINARY_DIR}/install_export_set.cmake" contents NEWLINE_CONSUME) string(REPLACE "\n" "_" contents "${contents}") string(FIND "${contents}" "${to_match}" is_found) if(is_found EQUAL -1) - message(FATAL_ERROR "rapids_export_write_dependencies(BUILD) failed to record rapids_export_post_find_package_code" + message( + FATAL_ERROR + "rapids_export_write_dependencies(BUILD) failed to record rapids_export_post_find_package_code" ) endif() diff --git a/testing/export/export_package-build-with-components-and-version.cmake b/testing/export/export_package-build-with-components-and-version.cmake index d152a3c6..b0bf961d 100644 --- a/testing/export/export_package-build-with-components-and-version.cmake +++ b/testing/export/export_package-build-with-components-and-version.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2018-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -19,7 +19,9 @@ set(to_match_string [=[22.08 QUIET]=]) file(READ "${path}" contents) string(FIND "${contents}" "${to_match_string}" is_found) if(is_found EQUAL -1) - message(FATAL_ERROR "rapids_export_package failed to generate a find_package configuration with version" + message( + FATAL_ERROR + "rapids_export_package failed to generate a find_package configuration with version" ) endif() @@ -27,6 +29,8 @@ endif() set(to_match_string [=[COMPONENTS comp1)]=]) string(FIND "${contents}" "${to_match_string}" is_found) if(is_found EQUAL -1) - message(FATAL_ERROR "rapids_export_package failed to generate a find_package configuration with COMPONENTS" + message( + FATAL_ERROR + "rapids_export_package failed to generate a find_package configuration with COMPONENTS" ) endif() diff --git a/testing/export/export_package-build-with-components.cmake b/testing/export/export_package-build-with-components.cmake index 4e38b993..4e786934 100644 --- a/testing/export/export_package-build-with-components.cmake +++ b/testing/export/export_package-build-with-components.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2018-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -19,6 +19,8 @@ set(to_match_string [=[COMPONENTS comp1;comp2;comp3)]=]) file(READ "${path}" contents) string(FIND "${contents}" "${to_match_string}" is_found) if(is_found EQUAL -1) - message(FATAL_ERROR "rapids_export_package failed to generate a find_package configuration with COMPONENTS" + message( + FATAL_ERROR + "rapids_export_package failed to generate a find_package configuration with COMPONENTS" ) endif() diff --git a/testing/export/export_package-build-with-empty-components.cmake b/testing/export/export_package-build-with-empty-components.cmake index 8f57f57d..1c024365 100644 --- a/testing/export/export_package-build-with-empty-components.cmake +++ b/testing/export/export_package-build-with-empty-components.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2018-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -19,6 +19,8 @@ set(to_match_string [=[COMPONENTS)]=]) file(READ "${path}" contents) string(FIND "${contents}" "${to_match_string}" is_found) if(NOT is_found EQUAL -1) - message(FATAL_ERROR "rapids_export_package generated a find_package configuration with COMPONENTS" + message( + FATAL_ERROR + "rapids_export_package generated a find_package configuration with COMPONENTS" ) endif() diff --git a/testing/export/export_package-build-with-version.cmake b/testing/export/export_package-build-with-version.cmake index 6ae0ab98..2cd1a799 100644 --- a/testing/export/export_package-build-with-version.cmake +++ b/testing/export/export_package-build-with-version.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2018-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -19,6 +19,8 @@ set(to_match_string [=[22.08 QUIET)]=]) file(READ "${path}" contents) string(FIND "${contents}" "${to_match_string}" is_found) if(is_found EQUAL -1) - message(FATAL_ERROR "rapids_export_package failed to generate a find_package configuration with version" + message( + FATAL_ERROR + "rapids_export_package failed to generate a find_package configuration with version" ) endif() diff --git a/testing/export/export_package-build.cmake b/testing/export/export_package-build.cmake index 5dba2e9b..49b62d0f 100644 --- a/testing/export/export_package-build.cmake +++ b/testing/export/export_package-build.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -29,7 +29,9 @@ if(NOT "ZLIB::ZLIB" IN_LIST global_targets) endif() # Verify that temp package configuration files exist -if(NOT EXISTS "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/build/package_ZLIB.cmake" - OR NOT EXISTS "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/build/package_PNG.cmake") +if( + NOT EXISTS "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/build/package_ZLIB.cmake" + OR NOT EXISTS "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/build/package_PNG.cmake" +) message(FATAL_ERROR "rapids_export_package failed to generate a find_package configuration") endif() diff --git a/testing/export/export_package-install-post-find-code.cmake b/testing/export/export_package-install-post-find-code.cmake index 8cacd9b0..fcf955da 100644 --- a/testing/export/export_package-install-post-find-code.cmake +++ b/testing/export/export_package-install-post-find-code.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -17,8 +17,11 @@ if(NOT a) endif() include(${rapids-cmake-dir}/export/write_dependencies.cmake) -rapids_export_write_dependencies(INSTALL test_export_set - "${CMAKE_CURRENT_BINARY_DIR}/install_export_set.cmake") +rapids_export_write_dependencies( + INSTALL + test_export_set + "${CMAKE_CURRENT_BINARY_DIR}/install_export_set.cmake" +) set(to_match [=[if(FAKE_PACKAGE_FOUND)_set(a ON)__endif()]=]) @@ -27,6 +30,8 @@ string(REPLACE "\n" "_" contents "${contents}") string(FIND "${contents}" "${to_match}" is_found) if(is_found EQUAL -1) - message(FATAL_ERROR "rapids_export_write_dependencies(INSTALL) failed to record rapids_export_post_find_package_code" + message( + FATAL_ERROR + "rapids_export_write_dependencies(INSTALL) failed to record rapids_export_post_find_package_code" ) endif() diff --git a/testing/export/export_package-install-with-components-and-version.cmake b/testing/export/export_package-install-with-components-and-version.cmake index 92a3f88f..39ea2b52 100644 --- a/testing/export/export_package-install-with-components-and-version.cmake +++ b/testing/export/export_package-install-with-components-and-version.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2018-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -19,7 +19,9 @@ set(to_match_string [=[14.7.2 QUIET]=]) file(READ "${path}" contents) string(FIND "${contents}" "${to_match_string}" is_found) if(is_found EQUAL -1) - message(FATAL_ERROR "rapids_export_package failed to generate a find_package configuration with version" + message( + FATAL_ERROR + "rapids_export_package failed to generate a find_package configuration with version" ) endif() @@ -27,6 +29,8 @@ endif() set(to_match_string [=[COMPONENTS abc;def)]=]) string(FIND "${contents}" "${to_match_string}" is_found) if(is_found EQUAL -1) - message(FATAL_ERROR "rapids_export_package failed to generate a find_package configuration with COMPONENTS" + message( + FATAL_ERROR + "rapids_export_package failed to generate a find_package configuration with COMPONENTS" ) endif() diff --git a/testing/export/export_package-install-with-components.cmake b/testing/export/export_package-install-with-components.cmake index 3c237224..c8e1fee4 100644 --- a/testing/export/export_package-install-with-components.cmake +++ b/testing/export/export_package-install-with-components.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2018-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -19,6 +19,8 @@ set(to_match_string [=[14.7.2 QUIET)]=]) file(READ "${path}" contents) string(FIND "${contents}" "${to_match_string}" is_found) if(is_found EQUAL -1) - message(FATAL_ERROR "rapids_export_package failed to generate a find_package configuration with version" + message( + FATAL_ERROR + "rapids_export_package failed to generate a find_package configuration with version" ) endif() diff --git a/testing/export/export_package-install-with-version.cmake b/testing/export/export_package-install-with-version.cmake index 1643d0e9..066994f4 100644 --- a/testing/export/export_package-install-with-version.cmake +++ b/testing/export/export_package-install-with-version.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2018-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -19,6 +19,8 @@ set(to_match_string [=[COMPONENTS 14.7.2)]=]) file(READ "${path}" contents) string(FIND "${contents}" "${to_match_string}" is_found) if(is_found EQUAL -1) - message(FATAL_ERROR "rapids_export_package failed to generate a find_package configuration with COMPONENTS" + message( + FATAL_ERROR + "rapids_export_package failed to generate a find_package configuration with COMPONENTS" ) endif() diff --git a/testing/export/export_package-install.cmake b/testing/export/export_package-install.cmake index e5f01abb..d9c335ea 100644 --- a/testing/export/export_package-install.cmake +++ b/testing/export/export_package-install.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -32,13 +32,17 @@ if(NOT "PNG::PNG_V2" IN_LIST global_targets) endif() # Verify that temp install package configuration files exist -if(NOT EXISTS "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/install/package_ZLIB.cmake" - OR NOT EXISTS "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/install/package_PNG.cmake") +if( + NOT EXISTS "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/install/package_ZLIB.cmake" + OR NOT EXISTS "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/install/package_PNG.cmake" +) message(FATAL_ERROR "rapids_export_package failed to generate a find_package configuration") endif() # Verify that temp build package configuration files don't exist -if(EXISTS "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/build/package_ZLIB.cmake" - OR EXISTS "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/build/package_PNG.cmake") +if( + EXISTS "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/build/package_ZLIB.cmake" + OR EXISTS "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/build/package_PNG.cmake" +) message(FATAL_ERROR "rapids_export_package(INSTALL) generated temp files in the wrong directory") endif() diff --git a/testing/export/export_package-multiple-export_sets.cmake b/testing/export/export_package-multiple-export_sets.cmake index 3d7139f2..bd1cb8fc 100644 --- a/testing/export/export_package-multiple-export_sets.cmake +++ b/testing/export/export_package-multiple-export_sets.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -17,11 +17,15 @@ get_target_property(global_targets1 rapids_export_build_export1 GLOBAL_TARGETS) get_target_property(global_targets2 rapids_export_build_export2 GLOBAL_TARGETS) if(NOT packages1 STREQUAL packages2) - message(FATAL_ERROR "rapids_export_package failed to record same package is in multiple export sets" + message( + FATAL_ERROR + "rapids_export_package failed to record same package is in multiple export sets" ) endif() if(NOT global_targets1 STREQUAL global_targets2) - message(FATAL_ERROR "rapids_export_package failed to record same target is in multiple export sets" + message( + FATAL_ERROR + "rapids_export_package failed to record same target is in multiple export sets" ) endif() diff --git a/testing/export/write_dependencies-cpm-preserve-options.cmake b/testing/export/write_dependencies-cpm-preserve-options.cmake index 6bee1762..ba46dbea 100644 --- a/testing/export/write_dependencies-cpm-preserve-options.cmake +++ b/testing/export/write_dependencies-cpm-preserve-options.cmake @@ -1,15 +1,19 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= include(${rapids-cmake-dir}/export/cpm.cmake) include(${rapids-cmake-dir}/export/write_dependencies.cmake) -rapids_export_cpm(INSTALL RMM test_set CPM_ARGS NAME RMM VERSION 2.0 OPTIONS - "FAKE_PACKAGE_ARGS FALSE" - GLOBAL_TARGETS RMM::RMM_POOL) +rapids_export_cpm( + INSTALL + RMM + test_set + CPM_ARGS NAME RMM VERSION 2.0 OPTIONS "FAKE_PACKAGE_ARGS FALSE" + GLOBAL_TARGETS RMM::RMM_POOL +) rapids_export_write_dependencies(install test_set "${CMAKE_CURRENT_BINARY_DIR}/export_set.cmake") @@ -19,6 +23,8 @@ set(to_match_string [=["NAME;RMM;VERSION;2.0;OPTIONS;FAKE_PACKAGE_ARGS FALSE"]=] file(READ "${CMAKE_CURRENT_BINARY_DIR}/export_set.cmake" contents) string(FIND "${contents}" "${to_match_string}" is_found) if(is_found EQUAL -1) - message(FATAL_ERROR "rapids_export_write_dependencies(BUILD) failed to preserve quotes around CPM arguments" + message( + FATAL_ERROR + "rapids_export_write_dependencies(BUILD) failed to preserve quotes around CPM arguments" ) endif() diff --git a/testing/export/write_dependencies-duplicate-cpm-and-package.cmake b/testing/export/write_dependencies-duplicate-cpm-and-package.cmake index 9c49bbcf..473d079f 100644 --- a/testing/export/write_dependencies-duplicate-cpm-and-package.cmake +++ b/testing/export/write_dependencies-duplicate-cpm-and-package.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -8,8 +8,13 @@ include(${rapids-cmake-dir}/export/cpm.cmake) include(${rapids-cmake-dir}/export/package.cmake) include(${rapids-cmake-dir}/export/write_dependencies.cmake) -rapids_export_cpm(INSTALL RMM test_set CPM_ARGS RMM VERSION 2.0 FAKE_PACKAGE_ARGS FALSE - GLOBAL_TARGETS RMM::RMM_POOL) +rapids_export_cpm( + INSTALL + RMM + test_set + CPM_ARGS RMM VERSION 2.0 FAKE_PACKAGE_ARGS FALSE + GLOBAL_TARGETS RMM::RMM_POOL +) rapids_export_package(install RMM test_set) rapids_export_package(install ZLIB test_set) @@ -33,11 +38,15 @@ foreach(line IN LISTS text) endforeach() if(NOT cpm_command_count EQUAL 1) - message(FATAL_ERROR "Incorrect number of CPMFindPackage entries found. Expected 1, counted ${cpm_command_count}" + message( + FATAL_ERROR + "Incorrect number of CPMFindPackage entries found. Expected 1, counted ${cpm_command_count}" ) endif() if(NOT find_dependency_command_count EQUAL 2) - message(FATAL_ERROR "Incorrect number of find_dependency entries found. Expected 2, counted ${find_dependency_command_count}" + message( + FATAL_ERROR + "Incorrect number of find_dependency entries found. Expected 2, counted ${find_dependency_command_count}" ) endif() diff --git a/testing/export/write_dependencies-duplicate-cpm.cmake b/testing/export/write_dependencies-duplicate-cpm.cmake index d0ab1140..e95fba78 100644 --- a/testing/export/write_dependencies-duplicate-cpm.cmake +++ b/testing/export/write_dependencies-duplicate-cpm.cmake @@ -1,19 +1,29 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= include(${rapids-cmake-dir}/export/cpm.cmake) include(${rapids-cmake-dir}/export/write_dependencies.cmake) -rapids_export_cpm(INSTALL RMM test_set CPM_ARGS VERSION 2.0 FAKE_PACKAGE_ARGS FALSE - GLOBAL_TARGETS RMM::RMM_POOL) +rapids_export_cpm( + INSTALL + RMM + test_set + CPM_ARGS VERSION 2.0 FAKE_PACKAGE_ARGS FALSE + GLOBAL_TARGETS RMM::RMM_POOL +) rapids_export_cpm(INSTALL Thrust test_set CPM_ARGS VERSION 12.0 GLOBAL_TARGETS Thrust::Thrust) -rapids_export_cpm(INSTALL RMM test_set CPM_ARGS VERSION 2.0 FAKE_PACKAGE_ARGS FALSE - GLOBAL_TARGETS RMM::RMM) +rapids_export_cpm( + INSTALL + RMM + test_set + CPM_ARGS VERSION 2.0 FAKE_PACKAGE_ARGS FALSE + GLOBAL_TARGETS RMM::RMM +) rapids_export_write_dependencies(install test_set "${CMAKE_CURRENT_BINARY_DIR}/export_set.cmake") @@ -47,10 +57,11 @@ foreach(line IN LISTS text) message(FATAL_ERROR "Duplicate entries found in targets to promote to global") endif() endif() - endforeach() if(NOT find_package_count EQUAL 2) - message(FATAL_ERROR "Too many CPMFindPackage entries found. Expected 2, counted ${find_package_count}" + message( + FATAL_ERROR + "Too many CPMFindPackage entries found. Expected 2, counted ${find_package_count}" ) endif() diff --git a/testing/export/write_dependencies-duplicate-packages.cmake b/testing/export/write_dependencies-duplicate-packages.cmake index 74d4c6a9..078c1745 100644 --- a/testing/export/write_dependencies-duplicate-packages.cmake +++ b/testing/export/write_dependencies-duplicate-packages.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -48,5 +48,4 @@ foreach(line IN LISTS text) message(FATAL_ERROR "Duplicate entries found in targets to promote to global") endif() endif() - endforeach() diff --git a/testing/export/write_dependencies-multiple-directories/A/CMakeLists.txt b/testing/export/write_dependencies-multiple-directories/A/CMakeLists.txt index ef14fa5b..38888a2f 100644 --- a/testing/export/write_dependencies-multiple-directories/A/CMakeLists.txt +++ b/testing/export/write_dependencies-multiple-directories/A/CMakeLists.txt @@ -1,8 +1,13 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= -rapids_export_cpm(build FAKE_CPM_PACKAGE test_export_set CPM_ARGS FAKE_PACKAGE_ARGS TRUE - GLOBAL_TARGETS ABC::ABC) +rapids_export_cpm( + build + FAKE_CPM_PACKAGE + test_export_set + CPM_ARGS FAKE_PACKAGE_ARGS TRUE + GLOBAL_TARGETS ABC::ABC +) diff --git a/testing/export/write_dependencies-multiple-directories/B/CMakeLists.txt b/testing/export/write_dependencies-multiple-directories/B/CMakeLists.txt index 9fc1e89a..28d81096 100644 --- a/testing/export/write_dependencies-multiple-directories/B/CMakeLists.txt +++ b/testing/export/write_dependencies-multiple-directories/B/CMakeLists.txt @@ -1,8 +1,13 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= -rapids_export_cpm(BUILD SECOND_FAKE_CPM_PACKAGE test_export_set CPM_ARGS VERSION 2.0 - GLOBAL_TARGETS ABC::ABC ABC::CBA) +rapids_export_cpm( + BUILD + SECOND_FAKE_CPM_PACKAGE + test_export_set + CPM_ARGS VERSION 2.0 + GLOBAL_TARGETS ABC::ABC ABC::CBA +) diff --git a/testing/export/write_dependencies-multiple-directories/CMakeLists.txt b/testing/export/write_dependencies-multiple-directories/CMakeLists.txt index ce4c09fb..4f440013 100644 --- a/testing/export/write_dependencies-multiple-directories/CMakeLists.txt +++ b/testing/export/write_dependencies-multiple-directories/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -26,7 +26,9 @@ if(NOT FAKE_CPM_PACKAGE IN_LIST packages) message(FATAL_ERROR "rapids_export_cpm failed to record FAKE_CPM_PACKAGE needs to be exported") endif() if(NOT SECOND_FAKE_CPM_PACKAGE IN_LIST packages) - message(FATAL_ERROR "rapids_export_cpm failed to record SECOND_FAKE_CPM_PACKAGE needs to be exported" + message( + FATAL_ERROR + "rapids_export_cpm failed to record SECOND_FAKE_CPM_PACKAGE needs to be exported" ) endif() @@ -52,8 +54,12 @@ if(NOT requires_cpm) endif() # Verify that cpm configuration files exist -if(NOT EXISTS "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/build/cpm_FAKE_CPM_PACKAGE.cmake" - OR NOT EXISTS - "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/build/cpm_SECOND_FAKE_CPM_PACKAGE.cmake") +if( + NOT EXISTS "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/build/cpm_FAKE_CPM_PACKAGE.cmake" + OR + NOT + EXISTS + "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/build/cpm_SECOND_FAKE_CPM_PACKAGE.cmake" +) message(FATAL_ERROR "rapids_export_cpm failed to generate a CPM configuration") endif() diff --git a/testing/export/write_dependencies-root-dirs.cmake b/testing/export/write_dependencies-root-dirs.cmake index 473d380d..2a8bd04d 100644 --- a/testing/export/write_dependencies-root-dirs.cmake +++ b/testing/export/write_dependencies-root-dirs.cmake @@ -1,20 +1,32 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= include(${rapids-cmake-dir}/export/find_package_root.cmake) include(${rapids-cmake-dir}/export/write_dependencies.cmake) -rapids_export_find_package_root(BUILD RMM [=[${CMAKE_CURRENT_LIST_DIR}/fake/build/path]=] - EXPORT_SET test_set) -rapids_export_write_dependencies(build test_set - "${CMAKE_CURRENT_BINARY_DIR}/build_export_set.cmake") +rapids_export_find_package_root( + BUILD + RMM + [=[${CMAKE_CURRENT_LIST_DIR}/fake/build/path]=] + EXPORT_SET test_set +) +rapids_export_write_dependencies( + build + test_set + "${CMAKE_CURRENT_BINARY_DIR}/build_export_set.cmake" +) rapids_export_find_package_root(BUILD RMM "/bad/install/path" EXPORT_SET ${unknown_var}) # ignored -rapids_export_find_package_root(BUILD RMM "/bad/install/path2" EXPORT_SET test_set - CONDITION unknown_var) # ignored +rapids_export_find_package_root( + BUILD + RMM + "/bad/install/path2" + EXPORT_SET test_set + CONDITION unknown_var +) # ignored # Parse the `build_export_set.cmake` file for correct escaped args to # `rapids_export_find_package_root` calls @@ -22,30 +34,44 @@ set(build_to_match_string [=[set(RMM_ROOT "${CMAKE_CURRENT_LIST_DIR}/fake/build/ file(READ "${CMAKE_CURRENT_BINARY_DIR}/build_export_set.cmake" contents) string(FIND "${contents}" "${build_to_match_string}" is_found) if(is_found EQUAL -1) - message(FATAL_ERROR "rapids_export_write_dependencies(BUILD) failed to preserve variables in the directory path to rapids_export_find_package_root" + message( + FATAL_ERROR + "rapids_export_write_dependencies(BUILD) failed to preserve variables in the directory path to rapids_export_find_package_root" ) endif() rapids_export_find_package_root(install RMM "/first/install/path" EXPORT_SET test_set) rapids_export_find_package_root(INSTALL RMM "/second/install/path" EXPORT_SET test_set) set(to_install FALSE) -rapids_export_find_package_root(INSTALL RMM "/bad/install/path" EXPORT_SET test_set - CONDITION to_install) # ignored +rapids_export_find_package_root( + INSTALL + RMM + "/bad/install/path" + EXPORT_SET test_set + CONDITION to_install +) # ignored rapids_export_find_package_root(install PKG2 "/pkg2/install/path" EXPORT_SET test_set) -rapids_export_write_dependencies(INSTALL test_set - "${CMAKE_CURRENT_BINARY_DIR}/install_export_set.cmake") +rapids_export_write_dependencies( + INSTALL + test_set + "${CMAKE_CURRENT_BINARY_DIR}/install_export_set.cmake" +) set(install_to_match_string_1 [=[set(RMM_ROOT "/first/install/path;/second/install/path"]=]) set(install_to_match_string_2 [=[set(PKG2_ROOT "/pkg2/install/path"]=]) file(READ "${CMAKE_CURRENT_BINARY_DIR}/install_export_set.cmake" contents) string(FIND "${contents}" "${install_to_match_string_1}" is_found) if(is_found EQUAL -1) - message(FATAL_ERROR "rapids_export_write_dependencies(INSTALL) failed to record all RMM_ROOT rapids_export_find_package_root commands" + message( + FATAL_ERROR + "rapids_export_write_dependencies(INSTALL) failed to record all RMM_ROOT rapids_export_find_package_root commands" ) endif() string(FIND "${contents}" "${install_to_match_string_2}" is_found) if(is_found EQUAL -1) - message(FATAL_ERROR "rapids_export_write_dependencies(INSTALL) failed to record all PKG2 rapids_export_find_package_root commands" + message( + FATAL_ERROR + "rapids_export_write_dependencies(INSTALL) failed to record all PKG2 rapids_export_find_package_root commands" ) endif() diff --git a/testing/export/write_language-multiple-nested-enables/A/B/D/CMakeLists.txt b/testing/export/write_language-multiple-nested-enables/A/B/D/CMakeLists.txt index 1828ea74..21801c44 100644 --- a/testing/export/write_language-multiple-nested-enables/A/B/D/CMakeLists.txt +++ b/testing/export/write_language-multiple-nested-enables/A/B/D/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -8,6 +8,7 @@ include(${rapids-cmake-dir}/export/write_language.cmake) function(enable_nested_language file_path) + # gersemi: ignore # replicates CPM including the file include("${file_path}") endfunction() diff --git a/testing/export/write_language-multiple-nested-enables/A/C/CMakeLists.txt b/testing/export/write_language-multiple-nested-enables/A/C/CMakeLists.txt index 27c8c60f..9507e15f 100644 --- a/testing/export/write_language-multiple-nested-enables/A/C/CMakeLists.txt +++ b/testing/export/write_language-multiple-nested-enables/A/C/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -8,6 +8,7 @@ include(${rapids-cmake-dir}/export/write_language.cmake) function(enable_nested_language file_path) + # gersemi: ignore # replicates CPM including the file include("${file_path}") endfunction() diff --git a/testing/find/CMakeLists.txt b/testing/find/CMakeLists.txt index 84d738dd..35aa14f9 100644 --- a/testing/find/CMakeLists.txt +++ b/testing/find/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -24,17 +24,26 @@ add_cmake_config_test(find_package-version-explicit-failed.cmake) add_cmake_config_test(find_package-version-explicit.cmake) add_cmake_config_test(find_package-version-none.cmake) -add_cmake_config_test(find_package-version-required-explicit-failed.cmake SHOULD_FAIL - "but required is exact version \"99999999999\"") +add_cmake_config_test( + find_package-version-required-explicit-failed.cmake + SHOULD_FAIL + "but required is exact version \"99999999999\"" +) add_cmake_config_test(find_generate_module-build) add_cmake_config_test(find_generate_module-install) add_cmake_config_test(find_generate_module-header-only) add_cmake_config_test(find_generate_module-code-blocks) -add_cmake_config_test(find_generate_module-back-initial-code-block-var.cmake SHOULD_FAIL - "INITIAL_CODE_BLOCK variable `var_doesn't_exist` doesn't exist") -add_cmake_config_test(find_generate_module-back-final-code-block-var.cmake SHOULD_FAIL - "FINAL_CODE_BLOCK variable `var_doesn't_exist` doesn't exist") +add_cmake_config_test( + find_generate_module-back-initial-code-block-var.cmake + SHOULD_FAIL + "INITIAL_CODE_BLOCK variable `var_doesn't_exist` doesn't exist" +) +add_cmake_config_test( + find_generate_module-back-final-code-block-var.cmake + SHOULD_FAIL + "FINAL_CODE_BLOCK variable `var_doesn't_exist` doesn't exist" +) add_cmake_config_test(find_generate_module-verify-copyright-header.cmake) diff --git a/testing/find/find_generate_module-back-final-code-block-var.cmake b/testing/find/find_generate_module-back-final-code-block-var.cmake index 267be9f8..34cf1e3f 100644 --- a/testing/find/find_generate_module-back-final-code-block-var.cmake +++ b/testing/find/find_generate_module-back-final-code-block-var.cmake @@ -1,11 +1,14 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= include(${rapids-cmake-dir}/find/generate_module.cmake) -rapids_find_generate_module(RapidsTest HEADER_NAMES rapids-cmake-test-header_only.hpp - FINAL_CODE_BLOCK var_doesn't_exist - INSTALL_EXPORT_SET test_set) +rapids_find_generate_module( + RapidsTest + HEADER_NAMES rapids-cmake-test-header_only.hpp + FINAL_CODE_BLOCK var_doesn't_exist + INSTALL_EXPORT_SET test_set +) diff --git a/testing/find/find_generate_module-back-initial-code-block-var.cmake b/testing/find/find_generate_module-back-initial-code-block-var.cmake index 3b25d46d..94cd3690 100644 --- a/testing/find/find_generate_module-back-initial-code-block-var.cmake +++ b/testing/find/find_generate_module-back-initial-code-block-var.cmake @@ -1,11 +1,14 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= include(${rapids-cmake-dir}/find/generate_module.cmake) -rapids_find_generate_module(RapidsTest HEADER_NAMES rapids-cmake-test-header_only.hpp - INITIAL_CODE_BLOCK var_doesn't_exist - INSTALL_EXPORT_SET test_set) +rapids_find_generate_module( + RapidsTest + HEADER_NAMES rapids-cmake-test-header_only.hpp + INITIAL_CODE_BLOCK var_doesn't_exist + INSTALL_EXPORT_SET test_set +) diff --git a/testing/find/find_generate_module-build/CMakeLists.txt b/testing/find/find_generate_module-build/CMakeLists.txt index 87a9fc58..e977d667 100644 --- a/testing/find/find_generate_module-build/CMakeLists.txt +++ b/testing/find/find_generate_module-build/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -12,12 +12,14 @@ project(rapids-test-project LANGUAGES CXX) set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}") # Generate the find module -rapids_find_generate_module(RapidsTest - HEADER_NAMES rapids-cmake-test-header.h - LIBRARY_NAMES rapids-cmake-test - VERSION 42 - INCLUDE_SUFFIXES rapids-cmake - BUILD_EXPORT_SET test_set) +rapids_find_generate_module( + RapidsTest + HEADER_NAMES rapids-cmake-test-header.h + LIBRARY_NAMES rapids-cmake-test + VERSION 42 + INCLUDE_SUFFIXES rapids-cmake + BUILD_EXPORT_SET test_set +) find_package(RapidsTest REQUIRED) @@ -37,7 +39,9 @@ get_target_property(release_lib RapidsTest::RapidsTest IMPORTED_LOCATION_RELEASE get_target_property(debug_lib RapidsTest::RapidsTest IMPORTED_LOCATION_DEBUG) if(NOT IS_DIRECTORY "${include_dir}") - message(FATAL_ERROR "rapids_find_generate_module failed to generate correct include dir search logic" + message( + FATAL_ERROR + "rapids_find_generate_module failed to generate correct include dir search logic" ) endif() @@ -46,6 +50,8 @@ if(NOT EXISTS "${release_lib}") endif() if(NOT EXISTS "${debug_lib}") - message(FATAL_ERROR "rapids_find_generate_module failed to generate correct debug/versioned library search logic" + message( + FATAL_ERROR + "rapids_find_generate_module failed to generate correct debug/versioned library search logic" ) endif() diff --git a/testing/find/find_generate_module-code-blocks/CMakeLists.txt b/testing/find/find_generate_module-code-blocks/CMakeLists.txt index 9c87cc2d..c42bce5c 100644 --- a/testing/find/find_generate_module-code-blocks/CMakeLists.txt +++ b/testing/find/find_generate_module-code-blocks/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -14,10 +14,13 @@ set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}") # Generate the find module set(initial_code_block [[set(RapidsTest_INITIAL_CODE_BLOCK TRUE)]]) set(final_code_block [[set(RapidsTest_FINAL_CODE_BLOCK TRUE)]]) -rapids_find_generate_module(RapidsTest - HEADER_NAMES rapids-cmake-test-header_only.hpp INITIAL_CODE_BLOCK - initial_code_block FINAL_CODE_BLOCK final_code_block - INSTALL_EXPORT_SET test_set) +rapids_find_generate_module( + RapidsTest + HEADER_NAMES rapids-cmake-test-header_only.hpp + INITIAL_CODE_BLOCK initial_code_block + FINAL_CODE_BLOCK final_code_block + INSTALL_EXPORT_SET test_set +) find_package(RapidsTest REQUIRED) diff --git a/testing/find/find_generate_module-header-only/CMakeLists.txt b/testing/find/find_generate_module-header-only/CMakeLists.txt index 90f817bb..1385bbcb 100644 --- a/testing/find/find_generate_module-header-only/CMakeLists.txt +++ b/testing/find/find_generate_module-header-only/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -12,8 +12,11 @@ project(rapids-test-project LANGUAGES CXX) set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}") # Generate the find module -rapids_find_generate_module(RapidsTest HEADER_NAMES rapids-cmake-test-header_only.hpp - INSTALL_EXPORT_SET test_set) +rapids_find_generate_module( + RapidsTest + HEADER_NAMES rapids-cmake-test-header_only.hpp + INSTALL_EXPORT_SET test_set +) find_package(RapidsTest REQUIRED) @@ -33,11 +36,15 @@ get_target_property(release_lib RapidsTest::RapidsTest IMPORTED_LOCATION_RELEASE get_target_property(debug_lib RapidsTest::RapidsTest IMPORTED_LOCATION_DEBUG) if(NOT IS_DIRECTORY "${include_dir}") - message(FATAL_ERROR "rapids_find_generate_module failed to generate correct include dir search logic" + message( + FATAL_ERROR + "rapids_find_generate_module failed to generate correct include dir search logic" ) endif() if(release_lib OR debug_lib) - message(FATAL_ERROR "rapids_find_generate_module incorrectly found libraries for a header only package" + message( + FATAL_ERROR + "rapids_find_generate_module incorrectly found libraries for a header only package" ) endif() diff --git a/testing/find/find_generate_module-install/CMakeLists.txt b/testing/find/find_generate_module-install/CMakeLists.txt index f3c93cad..5a5b6274 100644 --- a/testing/find/find_generate_module-install/CMakeLists.txt +++ b/testing/find/find_generate_module-install/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -12,11 +12,13 @@ project(rapids-test-project LANGUAGES CXX) set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}") # Generate the find module -rapids_find_generate_module(RapidsTest - HEADER_NAMES rapids-cmake-test-header.h - LIBRARY_NAMES rapids-cmake-test - INCLUDE_SUFFIXES rapids-cmake - INSTALL_EXPORT_SET test_set) +rapids_find_generate_module( + RapidsTest + HEADER_NAMES rapids-cmake-test-header.h + LIBRARY_NAMES rapids-cmake-test + INCLUDE_SUFFIXES rapids-cmake + INSTALL_EXPORT_SET test_set +) find_package(RapidsTest REQUIRED) @@ -37,7 +39,9 @@ get_target_property(debug_lib RapidsTest::RapidsTest IMPORTED_LOCATION_DEBUG) get_target_property(is_global RapidsTest::RapidsTest IMPORTED_GLOBAL) if(NOT IS_DIRECTORY "${include_dir}") - message(FATAL_ERROR "rapids_find_generate_module failed to generate correct include dir search logic" + message( + FATAL_ERROR + "rapids_find_generate_module failed to generate correct include dir search logic" ) endif() @@ -54,7 +58,10 @@ if(NOT is_global) endif() # verify header only lib -rapids_find_generate_module(RapidsTestHeaderOnly HEADER_NAMES rapids-cmake-test-header_only.hpp - INSTALL_EXPORT_SET test_set) +rapids_find_generate_module( + RapidsTestHeaderOnly + HEADER_NAMES rapids-cmake-test-header_only.hpp + INSTALL_EXPORT_SET test_set +) find_package(RapidsTest REQUIRED) diff --git a/testing/find/find_generate_module-verify-copyright-header.cmake b/testing/find/find_generate_module-verify-copyright-header.cmake index 9a37f915..547ceaa3 100644 --- a/testing/find/find_generate_module-verify-copyright-header.cmake +++ b/testing/find/find_generate_module-verify-copyright-header.cmake @@ -1,13 +1,16 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= include(${rapids-cmake-dir}/find/generate_module.cmake) include(${rapids-cmake-testing-dir}/utils/check_copyright_header.cmake) -rapids_find_generate_module(RapidsTest HEADER_NAMES rapids-cmake-test-header_only.hpp - INSTALL_EXPORT_SET test_set) +rapids_find_generate_module( + RapidsTest + HEADER_NAMES rapids-cmake-test-header_only.hpp + INSTALL_EXPORT_SET test_set +) check_copyright_header("${CMAKE_BINARY_DIR}/cmake/find_modules/FindRapidsTest.cmake") diff --git a/testing/find/find_package-components-failed.cmake b/testing/find/find_package-components-failed.cmake index 52a4f46a..deace429 100644 --- a/testing/find/find_package-components-failed.cmake +++ b/testing/find/find_package-components-failed.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -11,7 +11,9 @@ set(CMAKE_PREFIX_PATH "${rapids-cmake-testing-dir}/find/find_package-components/ rapids_find_package(FakeDependency 11 COMPONENTS AAAAA BUILD_EXPORT_SET test_export_set) if(FakeDependency_FOUND) - message(FATAL_ERROR "rapids_find_package recorded incorrect FOUND state for a failed find_package request" + message( + FATAL_ERROR + "rapids_find_package recorded incorrect FOUND state for a failed find_package request" ) endif() diff --git a/testing/find/find_package-components/CMakeLists.txt b/testing/find/find_package-components/CMakeLists.txt index 9aa4b997..71696168 100644 --- a/testing/find/find_package-components/CMakeLists.txt +++ b/testing/find/find_package-components/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -11,12 +11,23 @@ project(rapids-test-project LANGUAGES CXX) set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}") -rapids_find_package(FakeDependency 11 REQUIRED COMPONENTS A B C INSTALL_EXPORT_SET test_export_set - BUILD_EXPORT_SET test_export_set) +rapids_find_package( + FakeDependency + 11 + REQUIRED + COMPONENTS A B C + INSTALL_EXPORT_SET test_export_set + BUILD_EXPORT_SET test_export_set +) -if(NOT (DEFINED FakeDependency_A_FOUND AND DEFINED FakeDependency_B_FOUND AND DEFINED - FakeDependency_C_FOUND - )) +if( + NOT + ( + DEFINED FakeDependency_A_FOUND + AND DEFINED FakeDependency_B_FOUND + AND DEFINED FakeDependency_C_FOUND + ) +) message(FATAL_ERROR "rapids_find_package() failed to propagate COMPONENT A B C") endif() @@ -26,7 +37,9 @@ set(path "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/build/package_FakeDep file(READ "${path}" contents) string(FIND "${contents}" "${to_match_string}" is_found) if(is_found EQUAL -1) - message(FATAL_ERROR "rapids_find_package(BUILD) failed to preserve version information in exported file" + message( + FATAL_ERROR + "rapids_find_package(BUILD) failed to preserve version information in exported file" ) endif() @@ -34,6 +47,8 @@ set(path "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/install/package_FakeD file(READ "${path}" contents) string(FIND "${contents}" "${to_match_string}" is_found) if(is_found EQUAL -1) - message(FATAL_ERROR "rapids_find_package(INSTALL) failed to preserve version information in exported file" + message( + FATAL_ERROR + "rapids_find_package(INSTALL) failed to preserve version information in exported file" ) endif() diff --git a/testing/find/find_package-components/fakedependency-config.cmake b/testing/find/find_package-components/fakedependency-config.cmake index 736eb226..f9808257 100644 --- a/testing/find/find_package-components/fakedependency-config.cmake +++ b/testing/find/find_package-components/fakedependency-config.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -16,5 +16,8 @@ endforeach() include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(FakeDependency REASON_FAILURE_MESSAGE "${_FAIL_REASON}" - HANDLE_COMPONENTS) +find_package_handle_standard_args( + FakeDependency + REASON_FAILURE_MESSAGE "${_FAIL_REASON}" + HANDLE_COMPONENTS +) diff --git a/testing/find/find_package-no-variable-leak.cmake b/testing/find/find_package-no-variable-leak.cmake index 4e78151e..7552016c 100644 --- a/testing/find/find_package-no-variable-leak.cmake +++ b/testing/find/find_package-no-variable-leak.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -45,8 +45,16 @@ if(NOT normal_len EQUAL rapids_len) endif() track_normal_find_package(normal_len ZLIB) -track_rapids_find_package(rapids_len ZLIB INSTALL_EXPORT_SET test_export_set BUILD_EXPORT_SET - test_export_set GLOBAL_TARGETS ZLIB::ZLIB) +track_rapids_find_package( + rapids_len + ZLIB + INSTALL_EXPORT_SET + test_export_set + BUILD_EXPORT_SET + test_export_set + GLOBAL_TARGETS + ZLIB::ZLIB +) if(NOT normal_len EQUAL rapids_len) message(FATAL_ERROR "A complex rapids_find_package leaked variables!") diff --git a/testing/find/find_package-version-explicit-failed.cmake b/testing/find/find_package-version-explicit-failed.cmake index 7347d555..983b82db 100644 --- a/testing/find/find_package-version-explicit-failed.cmake +++ b/testing/find/find_package-version-explicit-failed.cmake @@ -1,13 +1,19 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= include(${rapids-cmake-dir}/find/package.cmake) -rapids_find_package(ZLIB 99999999999 EXACT CONFIG INSTALL_EXPORT_SET test_export_set - GLOBAL_TARGETS ZLIB::ZLIB) +rapids_find_package( + ZLIB + 99999999999 + EXACT + CONFIG + INSTALL_EXPORT_SET test_export_set + GLOBAL_TARGETS ZLIB::ZLIB +) if(ZLIB_FOUND) message(FATAL_ERROR "rapids_find_package should have reported a failed find") diff --git a/testing/find/find_package-version-explicit.cmake b/testing/find/find_package-version-explicit.cmake index 5b0a2337..843f6017 100644 --- a/testing/find/find_package-version-explicit.cmake +++ b/testing/find/find_package-version-explicit.cmake @@ -1,13 +1,18 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= include(${rapids-cmake-dir}/find/package.cmake) -rapids_find_package(CUDAToolkit 11 REQUIRED INSTALL_EXPORT_SET test_export_set - BUILD_EXPORT_SET test_export_set) +rapids_find_package( + CUDAToolkit + 11 + REQUIRED + INSTALL_EXPORT_SET test_export_set + BUILD_EXPORT_SET test_export_set +) set(to_match_string "find_package(CUDAToolkit 11 QUIET)") @@ -15,7 +20,9 @@ set(path "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/build/package_CUDAToo file(READ "${path}" contents) string(FIND "${contents}" "${to_match_string}" is_found) if(is_found EQUAL -1) - message(FATAL_ERROR "rapids_find_package(BUILD) failed to preserve version information in exported file" + message( + FATAL_ERROR + "rapids_find_package(BUILD) failed to preserve version information in exported file" ) endif() @@ -23,6 +30,8 @@ set(path "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/install/package_CUDAT file(READ "${path}" contents) string(FIND "${contents}" "${to_match_string}" is_found) if(is_found EQUAL -1) - message(FATAL_ERROR "rapids_find_package(INSTALL) failed to preserve version information in exported file" + message( + FATAL_ERROR + "rapids_find_package(INSTALL) failed to preserve version information in exported file" ) endif() diff --git a/testing/find/find_package-version-none.cmake b/testing/find/find_package-version-none.cmake index c2fd7cff..385561a1 100644 --- a/testing/find/find_package-version-none.cmake +++ b/testing/find/find_package-version-none.cmake @@ -1,13 +1,17 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= include(${rapids-cmake-dir}/find/package.cmake) -rapids_find_package(CUDAToolkit REQUIRED INSTALL_EXPORT_SET test_export_set - BUILD_EXPORT_SET test_export_set) +rapids_find_package( + CUDAToolkit + REQUIRED + INSTALL_EXPORT_SET test_export_set + BUILD_EXPORT_SET test_export_set +) # no version specified at find time, verify none recorded If we record the found version we break # things like CUDA backwards runtime compat @@ -17,7 +21,9 @@ set(path "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/build/package_CUDAToo file(READ "${path}" contents) string(FIND "${contents}" "${to_match_string}" is_found) if(is_found EQUAL -1) - message(FATAL_ERROR "rapids_find_package(BUILD) failed to preserve version information in exported file" + message( + FATAL_ERROR + "rapids_find_package(BUILD) failed to preserve version information in exported file" ) endif() @@ -25,6 +31,8 @@ set(path "${CMAKE_BINARY_DIR}/rapids-cmake/test_export_set/install/package_CUDAT file(READ "${path}" contents) string(FIND "${contents}" "${to_match_string}" is_found) if(is_found EQUAL -1) - message(FATAL_ERROR "rapids_find_package(INSTALL) failed to preserve version information in exported file" + message( + FATAL_ERROR + "rapids_find_package(INSTALL) failed to preserve version information in exported file" ) endif() diff --git a/testing/find/find_package-version-required-explicit-failed.cmake b/testing/find/find_package-version-required-explicit-failed.cmake index f1945fd9..8df38649 100644 --- a/testing/find/find_package-version-required-explicit-failed.cmake +++ b/testing/find/find_package-version-required-explicit-failed.cmake @@ -1,10 +1,16 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= include(${rapids-cmake-dir}/find/package.cmake) -rapids_find_package(ZLIB 99999999999 EXACT REQUIRED INSTALL_EXPORT_SET test_export_set - GLOBAL_TARGETS ZLIB::ZLIB) +rapids_find_package( + ZLIB + 99999999999 + EXACT + REQUIRED + INSTALL_EXPORT_SET test_export_set + GLOBAL_TARGETS ZLIB::ZLIB +) diff --git a/testing/test/CMakeLists.txt b/testing/test/CMakeLists.txt index 4214a9c6..7c290d15 100644 --- a/testing/test/CMakeLists.txt +++ b/testing/test/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -18,13 +18,19 @@ add_cmake_config_test(gpu_requirements-zero-gpu.cmake) add_cmake_config_test(gpu_requirements-max-percent.cmake) add_cmake_config_test(gpu_requirements-min-percent.cmake) add_cmake_config_test(gpu_requirements-multi.cmake) -add_cmake_config_test(gpu_requirements-negative-percent.cmake SHOULD_FAIL - "${percent_error_message}") +add_cmake_config_test( + gpu_requirements-negative-percent.cmake + SHOULD_FAIL + "${percent_error_message}" +) add_cmake_config_test(gpu_requirements-negative-gpu.cmake SHOULD_FAIL "${gpu_error_message}") add_cmake_config_test(gpu_requirements-no-gpus.cmake SHOULD_FAIL "${gpu_missing_message}") add_cmake_config_test(gpu_requirements-no-percent.cmake) -add_cmake_config_test(gpu_requirements-over-max-percent.cmake SHOULD_FAIL - "${percent_error_message}") +add_cmake_config_test( + gpu_requirements-over-max-percent.cmake + SHOULD_FAIL + "${percent_error_message}" +) add_cmake_config_test(gpu_requirements-single.cmake) add_cmake_config_test(gpu_requirements-zero-percent.cmake SHOULD_FAIL "${percent_error_message}") @@ -40,14 +46,20 @@ add_cmake_build_test(install_relocatable-simple.cmake) add_cmake_build_test(install_relocatable-installed-tests-run) add_cmake_build_test(install_relocatable-installed-tests-run-lazy-msg) add_cmake_build_test(install_relocatable-with-gtest_discover_tests.cmake NO_DEV_ERRORS) -add_cmake_config_test(install_relocatable-wrong-component.cmake SHOULD_FAIL - "${wrong_component_message}") +add_cmake_config_test( + install_relocatable-wrong-component.cmake + SHOULD_FAIL + "${wrong_component_message}" +) add_cmake_ctest_test(add-impossible-allocation SHOULD_FAIL "Insufficient resources for test") add_cmake_config_test(add-with-install-component.cmake) add_cmake_config_test(add-with-install-target.cmake) -add_cmake_config_test(add-with-install-target-missing.cmake SHOULD_FAIL - "rapids_add_test given INSTALL_TARGET \"noexist\", which does not exist") +add_cmake_config_test( + add-with-install-target-missing.cmake + SHOULD_FAIL + "rapids_add_test given INSTALL_TARGET \"noexist\", which does not exist" +) add_cmake_config_test(add-with-no-gpus.cmake) add_cmake_ctest_test(add-no-cuda-toolkit) diff --git a/testing/test/add-multi-jobs-single-gpu/CMakeLists.txt b/testing/test/add-multi-jobs-single-gpu/CMakeLists.txt index 69f15fac..ad105db3 100644 --- a/testing/test/add-multi-jobs-single-gpu/CMakeLists.txt +++ b/testing/test/add-multi-jobs-single-gpu/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -22,6 +22,10 @@ enable_testing() foreach(v RANGE 5) # this way all our tests can reside on the same gpu - rapids_test_add(NAME concurrent_test_${v} COMMAND verify_multi_concurrent ${v} GPUS 1 - PERCENT 1${v}) + rapids_test_add( + NAME concurrent_test_${v} + COMMAND verify_multi_concurrent ${v} + GPUS 1 + PERCENT 1${v} + ) endforeach() diff --git a/testing/test/add-with-install-component.cmake b/testing/test/add-with-install-component.cmake index 3a426ff1..6935f835 100644 --- a/testing/test/add-with-install-component.cmake +++ b/testing/test/add-with-install-component.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -26,6 +26,8 @@ endif() # Verify that `verify_alloc` is marked as to be installed get_target_property(names rapids_test_install_testing TARGETS_TO_INSTALL) if(NOT "verify_alloc" IN_LIST names) - message(FATAL_ERROR "Failed to record `verify_alloc` as a target to be installed in the testing component" + message( + FATAL_ERROR + "Failed to record `verify_alloc` as a target to be installed in the testing component" ) endif() diff --git a/testing/test/add-with-install-target-missing.cmake b/testing/test/add-with-install-target-missing.cmake index fd78da04..9e70a6d7 100644 --- a/testing/test/add-with-install-target-missing.cmake +++ b/testing/test/add-with-install-target-missing.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -15,5 +15,10 @@ file(WRITE "${CMAKE_BINARY_DIR}/main.cu" "int main(){return 0;}") add_executable(verify_alloc "${CMAKE_BINARY_DIR}/main.cu") enable_testing() -rapids_test_add(NAME simple_test COMMAND verify_alloc GPUS 1 - INSTALL_COMPONENT_SET testing INSTALL_TARGET noexist) +rapids_test_add( + NAME simple_test + COMMAND verify_alloc + GPUS 1 + INSTALL_COMPONENT_SET testing + INSTALL_TARGET noexist +) diff --git a/testing/test/add-with-install-target.cmake b/testing/test/add-with-install-target.cmake index 16c41b14..f1a63dee 100644 --- a/testing/test/add-with-install-target.cmake +++ b/testing/test/add-with-install-target.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -15,8 +15,13 @@ file(WRITE "${CMAKE_BINARY_DIR}/main.cu" "int main(){return 0;}") add_executable(verify_alloc "${CMAKE_BINARY_DIR}/main.cu") enable_testing() -rapids_test_add(NAME simple_test COMMAND ${CMAKE_COMMAND} -E env verify_alloc GPUS 1 - INSTALL_COMPONENT_SET testing INSTALL_TARGET verify_alloc) +rapids_test_add( + NAME simple_test + COMMAND ${CMAKE_COMMAND} -E env verify_alloc + GPUS 1 + INSTALL_COMPONENT_SET testing + INSTALL_TARGET verify_alloc +) # Verify that we have recorded `simple_test` as part of the `testing` component get_target_property(names rapids_test_install_testing TESTS_TO_RUN) @@ -27,6 +32,8 @@ endif() # Verify that `verify_alloc` is marked as to be installed get_target_property(names rapids_test_install_testing TARGETS_TO_INSTALL) if(NOT "verify_alloc" IN_LIST names) - message(FATAL_ERROR "Failed to record `verify_alloc` as a target to be installed in the testing component" + message( + FATAL_ERROR + "Failed to record `verify_alloc` as a target to be installed in the testing component" ) endif() diff --git a/testing/test/add-with-no-gpus.cmake b/testing/test/add-with-no-gpus.cmake index cacaab64..5489d572 100644 --- a/testing/test/add-with-no-gpus.cmake +++ b/testing/test/add-with-no-gpus.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -19,6 +19,8 @@ rapids_test_add(NAME simple_test COMMAND verify_alloc INSTALL_COMPONENT_SET test get_test_property(simple_test RESOURCE_GROUPS value) if(value) - message(FATAL_ERROR "Unexpected RESOURCE_GROUPS test property value(${value}) found, should not be set" + message( + FATAL_ERROR + "Unexpected RESOURCE_GROUPS test property value(${value}) found, should not be set" ) endif() diff --git a/testing/test/generate_resource_spec-no-gpus/CMakeLists.txt b/testing/test/generate_resource_spec-no-gpus/CMakeLists.txt index 9c9ad068..e3a441e6 100644 --- a/testing/test/generate_resource_spec-no-gpus/CMakeLists.txt +++ b/testing/test/generate_resource_spec-no-gpus/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -13,8 +13,10 @@ enable_testing() rapids_test_generate_resource_spec(DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/spec.json) -add_test(NAME read_spec_file COMMAND ${CMAKE_COMMAND} -P - ${CMAKE_CURRENT_SOURCE_DIR}/read_spec_file.cmake) +add_test( + NAME read_spec_file + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/read_spec_file.cmake +) set_tests_properties(read_spec_file PROPERTIES FIXTURES_REQUIRED resource_spec) # Set the visible device list to invalid device ids so we have zero visible set_tests_properties(generate_resource_spec PROPERTIES ENVIRONMENT CUDA_VISIBLE_DEVICES=-1) @@ -24,7 +26,10 @@ get_property(_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(_multi_config) set(_config_arg -C $) endif() -add_custom_target(run_tests ALL - COMMAND ${CMAKE_CTEST_COMMAND} --test-dir ${CMAKE_CURRENT_BINARY_DIR} - --no-tests=error -V ${_config_arg}) +add_custom_target( + run_tests + ALL + COMMAND + ${CMAKE_CTEST_COMMAND} --test-dir ${CMAKE_CURRENT_BINARY_DIR} --no-tests=error -V ${_config_arg} +) add_dependencies(run_tests generate_ctest_json) diff --git a/testing/test/generate_resource_spec-no-gpus/read_spec_file.cmake b/testing/test/generate_resource_spec-no-gpus/read_spec_file.cmake index bae7e67c..8cb1a238 100644 --- a/testing/test/generate_resource_spec-no-gpus/read_spec_file.cmake +++ b/testing/test/generate_resource_spec-no-gpus/read_spec_file.cmake @@ -1,11 +1,13 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/spec.json") - message(FATAL_ERROR "rapids_test_generate_resource_spec failed to write out the requested spec file" + message( + FATAL_ERROR + "rapids_test_generate_resource_spec failed to write out the requested spec file" ) endif() diff --git a/testing/test/generate_resource_spec-simple.cmake b/testing/test/generate_resource_spec-simple.cmake index f996586b..abed3604 100644 --- a/testing/test/generate_resource_spec-simple.cmake +++ b/testing/test/generate_resource_spec-simple.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -12,11 +12,15 @@ set(CTEST_RESOURCE_SPEC_FILE "sentinel file") rapids_test_generate_resource_spec(DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/spec.json) if(NOT CTEST_RESOURCE_SPEC_FILE STREQUAL "sentinel file") - message(FATAL_ERROR "CTEST_RESOURCE_SPEC_FILE shouldn't be modified by calling rapids_test_generate_resource_spec" + message( + FATAL_ERROR + "CTEST_RESOURCE_SPEC_FILE shouldn't be modified by calling rapids_test_generate_resource_spec" ) endif() if(NOT TEST generate_resource_spec) - message(FATAL_ERROR "rapids_test_generate_resource_spec failed to create the generate_resource_spec test" + message( + FATAL_ERROR + "rapids_test_generate_resource_spec failed to create the generate_resource_spec test" ) endif() diff --git a/testing/test/gpu_requirements-multi.cmake b/testing/test/gpu_requirements-multi.cmake index e402a5e0..e6ee8387 100644 --- a/testing/test/gpu_requirements-multi.cmake +++ b/testing/test/gpu_requirements-multi.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -12,6 +12,8 @@ rapids_test_gpu_requirements(fake_test GPUS 12 PERCENT 25) get_test_property(fake_test RESOURCE_GROUPS value) if(NOT value STREQUAL "12,gpus:25") - message(FATAL_ERROR "Unexpected RESOURCE_GROUPS test property value after rapids_test_gpu_requirements" + message( + FATAL_ERROR + "Unexpected RESOURCE_GROUPS test property value after rapids_test_gpu_requirements" ) endif() diff --git a/testing/test/gpu_requirements-no-percent.cmake b/testing/test/gpu_requirements-no-percent.cmake index 074d9492..e344adb5 100644 --- a/testing/test/gpu_requirements-no-percent.cmake +++ b/testing/test/gpu_requirements-no-percent.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -12,6 +12,8 @@ rapids_test_gpu_requirements(fake_test GPUS 9) get_test_property(fake_test RESOURCE_GROUPS value) if(NOT value STREQUAL "9,gpus:100") - message(FATAL_ERROR "Unexpected RESOURCE_GROUPS test property value(${value}) after rapids_test_gpu_requirements" + message( + FATAL_ERROR + "Unexpected RESOURCE_GROUPS test property value(${value}) after rapids_test_gpu_requirements" ) endif() diff --git a/testing/test/gpu_requirements-single.cmake b/testing/test/gpu_requirements-single.cmake index 970dd0a6..d77681a9 100644 --- a/testing/test/gpu_requirements-single.cmake +++ b/testing/test/gpu_requirements-single.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -12,6 +12,8 @@ rapids_test_gpu_requirements(fake_test GPUS 1 PERCENT 4) get_test_property(fake_test RESOURCE_GROUPS value) if(NOT value STREQUAL "1,gpus:4") - message(FATAL_ERROR "Unexpected RESOURCE_GROUPS test property value after rapids_test_gpu_requirements" + message( + FATAL_ERROR + "Unexpected RESOURCE_GROUPS test property value after rapids_test_gpu_requirements" ) endif() diff --git a/testing/test/init-existing-specfile.cmake b/testing/test/init-existing-specfile.cmake index 1f7cb617..1afcf588 100644 --- a/testing/test/init-existing-specfile.cmake +++ b/testing/test/init-existing-specfile.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -12,6 +12,8 @@ set(CTEST_RESOURCE_SPEC_FILE "sentinel file") rapids_test_init() if(NOT CTEST_RESOURCE_SPEC_FILE STREQUAL "sentinel file") - message(FATAL_ERROR "CTEST_RESOURCE_SPEC_FILE shouldn't be modified if already set before calling rapids_test_init" + message( + FATAL_ERROR + "CTEST_RESOURCE_SPEC_FILE shouldn't be modified if already set before calling rapids_test_init" ) endif() diff --git a/testing/test/init-simple.cmake b/testing/test/init-simple.cmake index b63ad4d5..6a526416 100644 --- a/testing/test/init-simple.cmake +++ b/testing/test/init-simple.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -16,12 +16,16 @@ endif() get_test_property(generate_resource_spec FIXTURES_SETUP fixtures_setup) if(NOT fixtures_setup STREQUAL "resource_spec") - message(FATAL_ERROR "generate_resource_spec FIXTURES_SETUP property should be set to \"resource_spec\"" + message( + FATAL_ERROR + "generate_resource_spec FIXTURES_SETUP property should be set to \"resource_spec\"" ) endif() get_test_property(generate_resource_spec GENERATED_RESOURCE_SPEC_FILE grsf) if(NOT grsf STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/resource_spec.json") - message(FATAL_ERROR "generate_resource_spec FIXTURES_SETUP property should be set to \"${CMAKE_CURRENT_BINARY_DIR}/resource_spec.json\"" + message( + FATAL_ERROR + "generate_resource_spec FIXTURES_SETUP property should be set to \"${CMAKE_CURRENT_BINARY_DIR}/resource_spec.json\"" ) endif() diff --git a/testing/test/install_relocatable-complex/tests/CMakeLists.txt b/testing/test/install_relocatable-complex/tests/CMakeLists.txt index cea546b6..0adf49c4 100644 --- a/testing/test/install_relocatable-complex/tests/CMakeLists.txt +++ b/testing/test/install_relocatable-complex/tests/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -14,20 +14,27 @@ add_executable(verify_alloc ../main.cu) target_include_directories(verify_alloc PRIVATE "${rapids-cmake-dir}/../docs/cpp_code_snippets/") rapids_test_add(NAME verify_alloc COMMAND verify_alloc GPUS 1 INSTALL_COMPONENT_SET testing) -set_tests_properties(verify_alloc - PROPERTIES ENVIRONMENT - "STREAM_MODE=new_mode;LD_PRELOAD=$" - PASS_REGULAR_EXPRESSION "found a resource file") +set_tests_properties( + verify_alloc + PROPERTIES + ENVIRONMENT "STREAM_MODE=new_mode;LD_PRELOAD=$" + PASS_REGULAR_EXPRESSION "found a resource file" +) target_compile_features(verify_alloc PRIVATE cuda_std_17) -rapids_test_install_relocatable(INSTALL_COMPONENT_SET testing DESTINATION bin/testing - INCLUDE_IN_ALL) +rapids_test_install_relocatable( + INSTALL_COMPONENT_SET testing + DESTINATION bin/testing + INCLUDE_IN_ALL +) -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/verify_installed_CTestTestfile.cmake" - "set(installed_test_file \"${CMAKE_CURRENT_BINARY_DIR}/install/bin/testing/CTestTestfile.cmake\")" +file( + WRITE "${CMAKE_CURRENT_BINARY_DIR}/verify_installed_CTestTestfile.cmake" + "set(installed_test_file \"${CMAKE_CURRENT_BINARY_DIR}/install/bin/testing/CTestTestfile.cmake\")" ) -file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/verify_installed_CTestTestfile.cmake" - [==[ +file( + APPEND "${CMAKE_CURRENT_BINARY_DIR}/verify_installed_CTestTestfile.cmake" + [==[ file(READ "${installed_test_file}" contents) @@ -39,14 +46,15 @@ foreach(to_match IN LISTS properties_match_strings) message(FATAL_ERROR "${contents}\nFailed to generate a proper set of test properties") endif() endforeach() -]==]) - -add_custom_target(install_testing_component ALL - COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --prefix install/ - --config Debug - COMMAND ${CMAKE_COMMAND} -P - "${CMAKE_CURRENT_BINARY_DIR}/verify_installed_CTestTestfile.cmake" - COMMAND ${CMAKE_CTEST_COMMAND} --test-dir install/bin/testing -C Debug - --no-tests=error) +]==] +) + +add_custom_target( + install_testing_component + ALL + COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --prefix install/ --config Debug + COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/verify_installed_CTestTestfile.cmake" + COMMAND ${CMAKE_CTEST_COMMAND} --test-dir install/bin/testing -C Debug --no-tests=error +) add_dependencies(install_testing_component preload generate_ctest_json verify_alloc) diff --git a/testing/test/install_relocatable-include-in-all.cmake b/testing/test/install_relocatable-include-in-all.cmake index 1f6be673..cad91c0a 100644 --- a/testing/test/install_relocatable-include-in-all.cmake +++ b/testing/test/install_relocatable-include-in-all.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -14,13 +14,19 @@ enable_testing() rapids_test_init() rapids_test_add(NAME verify_ COMMAND ls GPUS 1 INSTALL_COMPONENT_SET testing) -rapids_test_install_relocatable(INSTALL_COMPONENT_SET testing DESTINATION bin/testing - INCLUDE_IN_ALL) +rapids_test_install_relocatable( + INSTALL_COMPONENT_SET testing + DESTINATION bin/testing + INCLUDE_IN_ALL +) -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/verify_cmake_install_rules.cmake" - "set(install_rules_file \"${CMAKE_CURRENT_BINARY_DIR}/cmake_install.cmake\")") -file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/verify_cmake_install_rules.cmake" - [=[ +file( + WRITE "${CMAKE_CURRENT_BINARY_DIR}/verify_cmake_install_rules.cmake" + "set(install_rules_file \"${CMAKE_CURRENT_BINARY_DIR}/cmake_install.cmake\")" +) +file( + APPEND "${CMAKE_CURRENT_BINARY_DIR}/verify_cmake_install_rules.cmake" + [=[ file(READ "${install_rules_file}" contents) set(exclude_from_all_string [===[if(CMAKE_INSTALL_COMPONENT STREQUAL "testing" OR NOT CMAKE_INSTALL_COMPONENT)]===]) @@ -28,17 +34,22 @@ string(FIND "${contents}" ${exclude_from_all_string} is_found) if(is_found EQUAL -1) message(FATAL_ERROR "`rapids_test_install_relocatable` failed to mark items as EXCLUDE_FROM_ALL") endif() -]=]) +]=] +) -add_custom_target(verify_install_rule ALL - COMMAND ${CMAKE_COMMAND} -P - "${CMAKE_CURRENT_BINARY_DIR}/verify_cmake_install_rules.cmake") +add_custom_target( + verify_install_rule + ALL + COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/verify_cmake_install_rules.cmake" +) -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/verify_installed_CTestTestfile.cmake" - "set(installed_test_file \"${CMAKE_CURRENT_BINARY_DIR}/install/bin/testing/CTestTestfile.cmake\")" +file( + WRITE "${CMAKE_CURRENT_BINARY_DIR}/verify_installed_CTestTestfile.cmake" + "set(installed_test_file \"${CMAKE_CURRENT_BINARY_DIR}/install/bin/testing/CTestTestfile.cmake\")" ) -file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/verify_installed_CTestTestfile.cmake" - [=[ +file( + APPEND "${CMAKE_CURRENT_BINARY_DIR}/verify_installed_CTestTestfile.cmake" + [=[ file(READ "${installed_test_file}" contents) set(add_test_match_string [===[add_test(generate_resource_spec ./generate_ctest_json "./resource_spec.json")]===]) @@ -46,16 +57,20 @@ string(FIND "${contents}" ${add_test_match_string} is_found) if(is_found EQUAL -1) message(FATAL_ERROR "Failed to generate a `execute_process` with escaped CTEST_RESOURCE_SPEC_FILE") endif() -]=]) +]=] +) set(_config_arg) get_property(_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(_multi_config) set(_config_arg --config $) endif() -add_custom_target(install_testing_component ALL - COMMAND ${CMAKE_COMMAND} --install "${CMAKE_CURRENT_BINARY_DIR}" --component - testing --prefix install/ ${_config_arg} - COMMAND ${CMAKE_COMMAND} -P - "${CMAKE_CURRENT_BINARY_DIR}/verify_installed_CTestTestfile.cmake") +add_custom_target( + install_testing_component + ALL + COMMAND + ${CMAKE_COMMAND} --install "${CMAKE_CURRENT_BINARY_DIR}" --component testing --prefix install/ + ${_config_arg} + COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/verify_installed_CTestTestfile.cmake" +) add_dependencies(install_testing_component generate_ctest_json) diff --git a/testing/test/install_relocatable-installed-tests-run-lazy-msg/CMakeLists.txt b/testing/test/install_relocatable-installed-tests-run-lazy-msg/CMakeLists.txt index 3eac4d0a..adea1369 100644 --- a/testing/test/install_relocatable-installed-tests-run-lazy-msg/CMakeLists.txt +++ b/testing/test/install_relocatable-installed-tests-run-lazy-msg/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -15,16 +15,16 @@ enable_testing() rapids_test_init() add_executable(verify_ main.cu) -rapids_test_add(NAME verify - COMMAND verify_ - GPUS 1 - PERCENT 100 - INSTALL_COMPONENT_SET testing) +rapids_test_add(NAME verify COMMAND verify_ GPUS 1 PERCENT 100 INSTALL_COMPONENT_SET testing) rapids_test_install_relocatable(INSTALL_COMPONENT_SET testing DESTINATION bin/tests/to_verify/) -add_custom_target(install_testing_component ALL - COMMAND ${CMAKE_COMMAND} --install "${CMAKE_CURRENT_BINARY_DIR}" --component - testing --prefix install/ - COMMAND ${CMAKE_CTEST_COMMAND} --test-dir install/bin/tests/to_verify/ - --output-on-failure --no-tests=error) +add_custom_target( + install_testing_component + ALL + COMMAND + ${CMAKE_COMMAND} --install "${CMAKE_CURRENT_BINARY_DIR}" --component testing --prefix install/ + COMMAND + ${CMAKE_CTEST_COMMAND} --test-dir install/bin/tests/to_verify/ --output-on-failure + --no-tests=error +) add_dependencies(install_testing_component verify_ generate_ctest_json) diff --git a/testing/test/install_relocatable-installed-tests-run/CMakeLists.txt b/testing/test/install_relocatable-installed-tests-run/CMakeLists.txt index f81e3077..a6726ea5 100644 --- a/testing/test/install_relocatable-installed-tests-run/CMakeLists.txt +++ b/testing/test/install_relocatable-installed-tests-run/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -14,16 +14,16 @@ enable_testing() rapids_test_init() add_executable(verify_ main.cu) -rapids_test_add(NAME verify - COMMAND verify_ - GPUS 1 - PERCENT 100 - INSTALL_COMPONENT_SET testing) +rapids_test_add(NAME verify COMMAND verify_ GPUS 1 PERCENT 100 INSTALL_COMPONENT_SET testing) rapids_test_install_relocatable(INSTALL_COMPONENT_SET testing DESTINATION bin/tests/to_verify/) -add_custom_target(install_testing_component ALL - COMMAND ${CMAKE_COMMAND} --install "${CMAKE_CURRENT_BINARY_DIR}" --component - testing --prefix install/ - COMMAND ${CMAKE_CTEST_COMMAND} --test-dir install/bin/tests/to_verify/ - --output-on-failure --no-tests=error) +add_custom_target( + install_testing_component + ALL + COMMAND + ${CMAKE_COMMAND} --install "${CMAKE_CURRENT_BINARY_DIR}" --component testing --prefix install/ + COMMAND + ${CMAKE_CTEST_COMMAND} --test-dir install/bin/tests/to_verify/ --output-on-failure + --no-tests=error +) add_dependencies(install_testing_component verify_ generate_ctest_json) diff --git a/testing/test/install_relocatable-labels.cmake b/testing/test/install_relocatable-labels.cmake index b7a0d171..8413957e 100644 --- a/testing/test/install_relocatable-labels.cmake +++ b/testing/test/install_relocatable-labels.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -17,11 +17,13 @@ set_tests_properties(verify_labels PROPERTIES LABELS "has_label") rapids_test_install_relocatable(INSTALL_COMPONENT_SET testing DESTINATION bin/testing) -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/verify_installed_CTestTestfile.cmake" - "set(installed_test_file \"${CMAKE_CURRENT_BINARY_DIR}/install/bin/testing/CTestTestfile.cmake\")" +file( + WRITE "${CMAKE_CURRENT_BINARY_DIR}/verify_installed_CTestTestfile.cmake" + "set(installed_test_file \"${CMAKE_CURRENT_BINARY_DIR}/install/bin/testing/CTestTestfile.cmake\")" ) -file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/verify_installed_CTestTestfile.cmake" - [==[ +file( + APPEND "${CMAKE_CURRENT_BINARY_DIR}/verify_installed_CTestTestfile.cmake" + [==[ file(READ "${installed_test_file}" contents) set(labels_match_string [===[PROPERTIES LABELS has_label]===]) @@ -29,16 +31,20 @@ string(FIND "${contents}" "${labels_match_string}" is_found) if(is_found EQUAL -1) message(FATAL_ERROR "Failed to record the LABELS property") endif() -]==]) +]==] +) set(_config_arg) get_property(_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(_multi_config) set(_config_arg --config $) endif() -add_custom_target(install_testing_component ALL - COMMAND ${CMAKE_COMMAND} --install "${CMAKE_CURRENT_BINARY_DIR}" --component - testing --prefix install/ ${_config_arg} - COMMAND ${CMAKE_COMMAND} -P - "${CMAKE_CURRENT_BINARY_DIR}/verify_installed_CTestTestfile.cmake") +add_custom_target( + install_testing_component + ALL + COMMAND + ${CMAKE_COMMAND} --install "${CMAKE_CURRENT_BINARY_DIR}" --component testing --prefix install/ + ${_config_arg} + COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/verify_installed_CTestTestfile.cmake" +) add_dependencies(install_testing_component generate_ctest_json) diff --git a/testing/test/install_relocatable-no-tests.cmake b/testing/test/install_relocatable-no-tests.cmake index 41d46e43..ff6446f4 100644 --- a/testing/test/install_relocatable-no-tests.cmake +++ b/testing/test/install_relocatable-no-tests.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -13,11 +13,14 @@ enable_testing() rapids_test_add(NAME verify_ COMMAND ls GPUS 1 INSTALL_COMPONENT_SET testing) rapids_test_install_relocatable(INSTALL_COMPONENT_SET testing DESTINATION bin/testing) -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/verify_cmake_install.cmake" - "set(install_rules_file \"${CMAKE_CURRENT_BINARY_DIR}/cmake_install.cmake\")") +file( + WRITE "${CMAKE_CURRENT_BINARY_DIR}/verify_cmake_install.cmake" + "set(install_rules_file \"${CMAKE_CURRENT_BINARY_DIR}/cmake_install.cmake\")" +) -file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/verify_cmake_install.cmake" - [=[ +file( + APPEND "${CMAKE_CURRENT_BINARY_DIR}/verify_cmake_install.cmake" + [=[ file(READ "${install_rules_file}" contents) set(bad_install_rule_match_string [===[rapids-cmake/generate_ctest_json")]===]) @@ -25,7 +28,10 @@ string(FIND "${contents}" ${bad_install_rule_match_string} is_found) if(NOT is_found EQUAL -1) message(FATAL_ERROR "`rapids_test_install_relocatable` trying to install files that don't exist") endif() -]=]) -add_custom_target(verify_install_files_valid ALL - COMMAND ${CMAKE_COMMAND} -P - "${CMAKE_CURRENT_BINARY_DIR}/verify_cmake_install.cmake") +]=] +) +add_custom_target( + verify_install_files_valid + ALL + COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/verify_cmake_install.cmake" +) diff --git a/testing/test/install_relocatable-simple.cmake b/testing/test/install_relocatable-simple.cmake index 9be86f2b..5ec67a91 100644 --- a/testing/test/install_relocatable-simple.cmake +++ b/testing/test/install_relocatable-simple.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -12,23 +12,28 @@ enable_language(CUDA) enable_testing() rapids_test_init() -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cu" - [=[ +file( + WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cu" + [=[ int main(int, char **) { return 0; } -]=]) +]=] +) add_executable(test_verify ${CMAKE_CURRENT_BINARY_DIR}/main.cu) rapids_test_add(NAME verify_ COMMAND test_verify GPUS 1 INSTALL_COMPONENT_SET testing) rapids_test_install_relocatable(INSTALL_COMPONENT_SET testing DESTINATION bin/testing) -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/verify_cmake_install.cmake" - "set(install_rules_file \"${CMAKE_CURRENT_BINARY_DIR}/cmake_install.cmake\")") -file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/verify_cmake_install.cmake" - [=[ +file( + WRITE "${CMAKE_CURRENT_BINARY_DIR}/verify_cmake_install.cmake" + "set(install_rules_file \"${CMAKE_CURRENT_BINARY_DIR}/cmake_install.cmake\")" +) +file( + APPEND "${CMAKE_CURRENT_BINARY_DIR}/verify_cmake_install.cmake" + [=[ file(READ "${install_rules_file}" contents) set(exclude_from_all_string [===[if(CMAKE_INSTALL_COMPONENT STREQUAL "testing")]===]) @@ -36,16 +41,21 @@ string(FIND "${contents}" ${exclude_from_all_string} is_found) if(is_found EQUAL -1) message(FATAL_ERROR "`rapids_test_install_relocatable` failed to mark items as EXCLUDE_FROM_ALL") endif() -]=]) -add_custom_target(verify_install_rule ALL - COMMAND ${CMAKE_COMMAND} -P - "${CMAKE_CURRENT_BINARY_DIR}/verify_cmake_install.cmake") +]=] +) +add_custom_target( + verify_install_rule + ALL + COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/verify_cmake_install.cmake" +) -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/verify_installed_CTestTestfile.cmake" - "set(installed_test_file \"${CMAKE_CURRENT_BINARY_DIR}/install/bin/testing/CTestTestfile.cmake\")" +file( + WRITE "${CMAKE_CURRENT_BINARY_DIR}/verify_installed_CTestTestfile.cmake" + "set(installed_test_file \"${CMAKE_CURRENT_BINARY_DIR}/install/bin/testing/CTestTestfile.cmake\")" ) -file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/verify_installed_CTestTestfile.cmake" - [==[ +file( + APPEND "${CMAKE_CURRENT_BINARY_DIR}/verify_installed_CTestTestfile.cmake" + [==[ file(READ "${installed_test_file}" contents) set(add_test_match_string [===[add_test(generate_resource_spec ./generate_ctest_json "./resource_spec.json")]===]) @@ -63,11 +73,15 @@ string(FIND "${contents}" ${properties_match_string} is_found) if(is_found EQUAL -1) message(FATAL_ERROR "${contents}\nFailed to generate an installed `GPU` requirements for verify_") endif() -]==]) +]==] +) -add_custom_target(install_testing_component ALL - COMMAND ${CMAKE_COMMAND} --install "${CMAKE_CURRENT_BINARY_DIR}" --component - testing --prefix install/ --config Debug - COMMAND ${CMAKE_COMMAND} -P - "${CMAKE_CURRENT_BINARY_DIR}/verify_installed_CTestTestfile.cmake") +add_custom_target( + install_testing_component + ALL + COMMAND + ${CMAKE_COMMAND} --install "${CMAKE_CURRENT_BINARY_DIR}" --component testing --prefix install/ + --config Debug + COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/verify_installed_CTestTestfile.cmake" +) add_dependencies(install_testing_component test_verify generate_ctest_json) diff --git a/testing/test/install_relocatable-with-gtest_discover_tests.cmake b/testing/test/install_relocatable-with-gtest_discover_tests.cmake index fc553f91..2b8c8caa 100644 --- a/testing/test/install_relocatable-with-gtest_discover_tests.cmake +++ b/testing/test/install_relocatable-with-gtest_discover_tests.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -18,8 +18,9 @@ rapids_cpm_gtest() enable_testing() rapids_test_init() -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" - [=[ +file( + WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + [=[ #include using Foo = ::testing::Test; @@ -32,7 +33,8 @@ int main(int argc, char *argv[]) ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } -]=]) +]=] +) add_executable(main ${CMAKE_CURRENT_BINARY_DIR}/main.cpp) target_link_libraries(main PRIVATE GTest::gtest) @@ -42,11 +44,13 @@ rapids_test_add(NAME main COMMAND main INSTALL_COMPONENT_SET testing) rapids_test_install_relocatable(INSTALL_COMPONENT_SET testing DESTINATION bin/testing) -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/verify_installed_CTestTestfile.cmake" - "set(installed_test_file \"${CMAKE_CURRENT_BINARY_DIR}/install/bin/testing/CTestTestfile.cmake\")" +file( + WRITE "${CMAKE_CURRENT_BINARY_DIR}/verify_installed_CTestTestfile.cmake" + "set(installed_test_file \"${CMAKE_CURRENT_BINARY_DIR}/install/bin/testing/CTestTestfile.cmake\")" ) -file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/verify_installed_CTestTestfile.cmake" - [==[ +file( + APPEND "${CMAKE_CURRENT_BINARY_DIR}/verify_installed_CTestTestfile.cmake" + [==[ file(READ "${installed_test_file}" contents) set(add_test_match_string [===[add_test(generate_resource_spec ./generate_ctest_json "./resource_spec.json")]===]) @@ -59,11 +63,15 @@ string(FIND "${contents}" ${add_test_match_string} is_found) if(is_found EQUAL -1) message(FATAL_ERROR "Failed to generate an installed `add_test` for main") endif() -]==]) +]==] +) -add_custom_target(install_testing_component ALL - COMMAND ${CMAKE_COMMAND} --install "${CMAKE_CURRENT_BINARY_DIR}" --component - testing --prefix install/ --config Debug - COMMAND ${CMAKE_COMMAND} -P - "${CMAKE_CURRENT_BINARY_DIR}/verify_installed_CTestTestfile.cmake") +add_custom_target( + install_testing_component + ALL + COMMAND + ${CMAKE_COMMAND} --install "${CMAKE_CURRENT_BINARY_DIR}" --component testing --prefix install/ + --config Debug + COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/verify_installed_CTestTestfile.cmake" +) add_dependencies(install_testing_component main) diff --git a/testing/test/install_relocatable-wrong-component.cmake b/testing/test/install_relocatable-wrong-component.cmake index af8104cb..9860b3c0 100644 --- a/testing/test/install_relocatable-wrong-component.cmake +++ b/testing/test/install_relocatable-wrong-component.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -11,5 +11,7 @@ enable_language(CUDA) rapids_test_init() rapids_test_install_relocatable(INSTALL_COMPONENT_SET wrong_component DESTINATION bin/testing) -rapids_test_install_relocatable(INSTALL_COMPONENT_SET another_wrong_component - DESTINATION bin/testing) +rapids_test_install_relocatable( + INSTALL_COMPONENT_SET another_wrong_component + DESTINATION bin/testing +) diff --git a/testing/test/no_add-with-no-resource-spec/CMakeLists.txt b/testing/test/no_add-with-no-resource-spec/CMakeLists.txt index 33443c6f..69dbf5b6 100644 --- a/testing/test/no_add-with-no-resource-spec/CMakeLists.txt +++ b/testing/test/no_add-with-no-resource-spec/CMakeLists.txt @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -25,5 +25,7 @@ add_test(NAME simple_test COMMAND verify_no_alloc) rapids_test_gpu_requirements(simple_test GPUS 1) # Validate that the test runs correctly -set_tests_properties(simple_test PROPERTIES PASS_REGULAR_EXPRESSION - "failed to have a resource file") +set_tests_properties( + simple_test + PROPERTIES PASS_REGULAR_EXPRESSION "failed to have a resource file" +) diff --git a/testing/utils/check_copyright_header.cmake b/testing/utils/check_copyright_header.cmake index 1e4d9ecc..55c49848 100644 --- a/testing/utils/check_copyright_header.cmake +++ b/testing/utils/check_copyright_header.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -10,21 +10,27 @@ function(check_copyright_header file) cmake_path(GET file EXTENSION LAST_ONLY file_ext) string(TIMESTAMP current_year "%Y" UTC) if(file_ext STREQUAL ".txt" OR file_ext STREQUAL ".cmake") - string(CONFIGURE [=[#============================================================================= + string( + CONFIGURE + [=[#============================================================================= # SPDX-FileCopyrightText: Copyright (c) @current_year@, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 #============================================================================= ]=] - expected_header - @ONLY) + expected_header + @ONLY + ) else() - string(CONFIGURE [=[/* + string( + CONFIGURE + [=[/* * SPDX-FileCopyrightText: Copyright (c) @current_year@, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ ]=] - expected_header - @ONLY) + expected_header + @ONLY + ) endif() string(LENGTH "${expected_header}" expected_header_length) diff --git a/testing/utils/cmake_detect_generators.cmake b/testing/utils/cmake_detect_generators.cmake index e53550b4..5cd95fe1 100644 --- a/testing/utils/cmake_detect_generators.cmake +++ b/testing/utils/cmake_detect_generators.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -18,7 +18,6 @@ Reports back what generators from the set of below are usable on the current mac #]=======================================================================] function(cmake_detect_generators generator_name_var fancy_name_var) - # See CMakeUnixFindMake and CMakeNinjaFindMake find_program(RAPIDS_TESTING_MAKE_GEN NAMES gmake make smake NAMES_PER_DIR) find_program(RAPIDS_TESTING_NINJA_GEN NAMES ninja-build ninja samu NAMES_PER_DIR) diff --git a/testing/utils/cmake_test.cmake b/testing/utils/cmake_test.cmake index dba3c289..11f089d4 100644 --- a/testing/utils/cmake_test.cmake +++ b/testing/utils/cmake_test.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -69,8 +69,11 @@ function(add_cmake_test mode source_or_dir) elseif(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${source_or_dir}") set(src_dir "${CMAKE_CURRENT_BINARY_DIR}/${test_name_stem}") set(test_cmake_file "${CMAKE_CURRENT_LIST_DIR}/${source_or_dir}") - configure_file("${CMAKE_CURRENT_FUNCTION_LIST_DIR}/project_template.cmake.in" - "${src_dir}/CMakeLists.txt" @ONLY) + configure_file( + "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/project_template.cmake.in" + "${src_dir}/CMakeLists.txt" + @ONLY + ) else() message(FATAL_ERROR "Unable to find a file or directory named: ${source_or_dir}") endif() @@ -78,9 +81,9 @@ function(add_cmake_test mode source_or_dir) set(extra_configure_flags "-DCMAKE_MESSAGE_LOG_LEVEL=DEBUG") if(NOT RAPIDS_TEST_NO_RAPIDS_CMAKE_HOOKS) - list(APPEND - extra_configure_flags - "-DCMAKE_PROJECT_INCLUDE_BEFORE=${PROJECT_SOURCE_DIR}/utils/emulate_fetching_rapids_cmake.cmake" + list( + APPEND extra_configure_flags + "-DCMAKE_PROJECT_INCLUDE_BEFORE=${PROJECT_SOURCE_DIR}/utils/emulate_fetching_rapids_cmake.cmake" ) endif() if(NOT (RAPIDS_TEST_NO_DEV_ERRORS OR RAPIDS_TEST_DISABLE_DEV_ERRORS)) @@ -100,37 +103,47 @@ function(add_cmake_test mode source_or_dir) endif() foreach(generator gen_name IN ZIP_LISTS supported_generators nice_gen_names) - set(test_name "${test_name_stem}-${gen_name}") set(build_dir "${CMAKE_CURRENT_BINARY_DIR}/${test_name}-build") if(mode STREQUAL "config") - add_test(NAME ${test_name} - COMMAND ${CMAKE_COMMAND} -S ${src_dir} -B ${build_dir} -G "${generator}" - ${extra_configure_flags} -Drapids-cmake-testing-dir=${PROJECT_SOURCE_DIR} - -Drapids-cmake-dir=${PROJECT_SOURCE_DIR}/../rapids-cmake) - + add_test( + NAME ${test_name} + COMMAND + ${CMAKE_COMMAND} -S ${src_dir} -B ${build_dir} -G "${generator}" ${extra_configure_flags} + -Drapids-cmake-testing-dir=${PROJECT_SOURCE_DIR} + -Drapids-cmake-dir=${PROJECT_SOURCE_DIR}/../rapids-cmake + ) elseif(mode STREQUAL "build") - add_test(NAME ${test_name}_configure - COMMAND ${CMAKE_COMMAND} -S ${src_dir} -B ${build_dir} -G "${generator}" - ${extra_configure_flags} -Drapids-cmake-testing-dir=${PROJECT_SOURCE_DIR} - -Drapids-cmake-dir=${PROJECT_SOURCE_DIR}/../rapids-cmake) + add_test( + NAME ${test_name}_configure + COMMAND + ${CMAKE_COMMAND} -S ${src_dir} -B ${build_dir} -G "${generator}" ${extra_configure_flags} + -Drapids-cmake-testing-dir=${PROJECT_SOURCE_DIR} + -Drapids-cmake-dir=${PROJECT_SOURCE_DIR}/../rapids-cmake + ) add_test(NAME ${test_name} COMMAND ${CMAKE_COMMAND} --build ${build_dir} -j3000) set_tests_properties(${test_name}_configure PROPERTIES FIXTURES_SETUP ${test_name}) set_tests_properties(${test_name} PROPERTIES FIXTURES_REQUIRED ${test_name}) elseif(mode STREQUAL "test") - add_test(NAME ${test_name}_configure - COMMAND ${CMAKE_COMMAND} -S ${src_dir} -B ${build_dir} -G "${generator}" - ${extra_configure_flags} -Drapids-cmake-testing-dir=${PROJECT_SOURCE_DIR} - -Drapids-cmake-dir=${PROJECT_SOURCE_DIR}/../rapids-cmake) + add_test( + NAME ${test_name}_configure + COMMAND + ${CMAKE_COMMAND} -S ${src_dir} -B ${build_dir} -G "${generator}" ${extra_configure_flags} + -Drapids-cmake-testing-dir=${PROJECT_SOURCE_DIR} + -Drapids-cmake-dir=${PROJECT_SOURCE_DIR}/../rapids-cmake + ) add_test(NAME ${test_name}_build COMMAND ${CMAKE_COMMAND} --build ${build_dir} -j3) set_tests_properties(${test_name}_build PROPERTIES DEPENDS ${test_name}_configure) - add_test(NAME ${test_name} COMMAND ${CMAKE_CTEST_COMMAND} -C Debug -j400 -VV - WORKING_DIRECTORY ${build_dir}) + add_test( + NAME ${test_name} + COMMAND ${CMAKE_CTEST_COMMAND} -C Debug -j400 -VV + WORKING_DIRECTORY ${build_dir} + ) set_tests_properties(${test_name}_configure PROPERTIES FIXTURES_SETUP ${test_name}) set_tests_properties(${test_name}_build PROPERTIES FIXTURES_SETUP ${test_name}) @@ -138,7 +151,9 @@ function(add_cmake_test mode source_or_dir) elseif(mode STREQUAL "install") message(FATAL_ERROR "install mode not yet implemented by add_cmake_build_test") else() - message(FATAL_ERROR "${mode} mode not one of the valid modes (config|build|install) by add_cmake_build_test" + message( + FATAL_ERROR + "${mode} mode not one of the valid modes (config|build|install) by add_cmake_build_test" ) endif() @@ -156,8 +171,10 @@ function(add_cmake_test mode source_or_dir) if(RAPIDS_TEST_SHOULD_FAIL) # Make sure we have a match set_tests_properties(${test_name} PROPERTIES WILL_FAIL ON) - set_tests_properties(${test_name} PROPERTIES FAIL_REGULAR_EXPRESSION - "${RAPIDS_TEST_SHOULD_FAIL}") + set_tests_properties( + ${test_name} + PROPERTIES FAIL_REGULAR_EXPRESSION "${RAPIDS_TEST_SHOULD_FAIL}" + ) else() # Error out if we detect any CMake syntax warnings set_tests_properties(${test_name} PROPERTIES FAIL_REGULAR_EXPRESSION "Syntax Warning") @@ -168,5 +185,4 @@ function(add_cmake_test mode source_or_dir) string(TOLOWER "${label_name}" lower_case_label) set_tests_properties(${test_name} PROPERTIES LABELS "${lower_case_label};${gen_name}") endforeach() - endfunction() diff --git a/testing/utils/emulate_fetching_rapids_cmake.cmake b/testing/utils/emulate_fetching_rapids_cmake.cmake index c2605570..fe01037d 100644 --- a/testing/utils/emulate_fetching_rapids_cmake.cmake +++ b/testing/utils/emulate_fetching_rapids_cmake.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -27,10 +27,13 @@ if(NOT _rapids_already_hooked) # construct a symlink from the source to the build dir so we get the latest local changes without # issue execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory "${scratch_dir}") - execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "${local-rapids-cmake-root}" - "${rapids-cmake_SOURCE_DIR}" - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" ECHO_OUTPUT_VARIABLE - ECHO_ERROR_VARIABLE) + execute_process( + COMMAND + ${CMAKE_COMMAND} -E create_symlink "${local-rapids-cmake-root}" "${rapids-cmake_SOURCE_DIR}" + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" + ECHO_OUTPUT_VARIABLE + ECHO_ERROR_VARIABLE + ) unset(scratch_dir) message(STATUS "${local-rapids-cmake-root} -> ${rapids-cmake_SOURCE_DIR}") diff --git a/testing/utils/setup_cpm_cache.cmake b/testing/utils/setup_cpm_cache.cmake index a91b9249..bca4ae3c 100644 --- a/testing/utils/setup_cpm_cache.cmake +++ b/testing/utils/setup_cpm_cache.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -15,11 +15,14 @@ function(setup_cpm_cache) set(build_dir "${CPM_SOURCE_CACHE}") # download all pre-configured rapids-cmake packages - execute_process(COMMAND ${CMAKE_COMMAND} -Drapids-cmake-dir=${PROJECT_SOURCE_DIR}/../rapids-cmake - -S ${src_dir} -B ${build_dir} -DCPM_SOURCE_CACHE=${CPM_SOURCE_CACHE} - -DCPM_DOWNLOAD_LOCATION=${CPM_DOWNLOAD_LOCATION} - WORKING_DIRECTORY ${src_dir} - OUTPUT_VARIABLE out_var) + execute_process( + COMMAND + ${CMAKE_COMMAND} -Drapids-cmake-dir=${PROJECT_SOURCE_DIR}/../rapids-cmake -S ${src_dir} -B + ${build_dir} -DCPM_SOURCE_CACHE=${CPM_SOURCE_CACHE} + -DCPM_DOWNLOAD_LOCATION=${CPM_DOWNLOAD_LOCATION} + WORKING_DIRECTORY ${src_dir} + OUTPUT_VARIABLE out_var + ) # Find the line in out_var that contains "CPM packages in cache set(packages) foreach(line IN LISTS out_var)