repo_id
stringlengths 21
96
| file_path
stringlengths 31
155
| content
stringlengths 1
92.9M
| __index_level_0__
int64 0
0
|
---|---|---|---|
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cython/create_modules_errors.cmake | #=============================================================================
# Copyright (c) 2022, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cython/create_modules.cmake)
# Test that a invocation without calling rapids_cython_init fails.
rapids_cython_create_modules(
SOURCE_FILES test.pyx
)
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cython/CMakeLists.txt | #=============================================================================
# Copyright (c) 2022, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
add_cmake_config_test(rapids-cython.cmake)
add_cmake_config_test(init.cmake)
add_cmake_config_test(create_modules_errors.cmake SHOULD_FAIL "You must call rapids_cython_init before calling this function")
add_cmake_config_test(create_modules)
add_cmake_config_test(create_modules_with_library)
add_cmake_config_test(create_modules_with_prefix)
add_cmake_config_test(add_rpath_entries)
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cython/init.cmake | #=============================================================================
# Copyright (c) 2022, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cython/init.cmake)
# Silence warning about running without scikit-build.
set(SKBUILD ON)
# Ensure that scikit-build's CMake files are discoverable. The glob is to
# capture the current git commit hash.
file(GLOB skbuild_resource_dir LIST_DIRECTORIES ON "${CPM_SOURCE_CACHE}/skbuild/*/skbuild/resources/cmake")
LIST(APPEND CMAKE_MODULE_PATH "${skbuild_resource_dir}")
# Test that rapids_cython_init initializes the expected variables.
rapids_cython_init()
if(NOT DEFINED RAPIDS_CYTHON_INITIALIZED)
message(FATAL_ERROR "rapids_cython_init didn't correctly set RAPIDS_CYTHON_INITIALIZED")
endif()
string(REGEX MATCHALL ".*--directive.*" matches "${CYTHON_FLAGS}")
list(LENGTH matches num_directives)
if(NOT CYTHON_FLAGS OR NOT num_directives EQUAL 1)
message(FATAL_ERROR "rapids_cython_init didn't correctly set CYTHON_FLAGS")
endif()
if(NOT COMMAND _set_python_extension_symbol_visibility)
message(FATAL_ERROR "rapids_cython_init didn't create the _set_python_extension_symbol_visibility command")
endif()
# Test that rapids_cython_init is idempotent.
rapids_cython_init()
string(REGEX MATCHALL ".*--directive.*" matches "${CYTHON_FLAGS}")
list(LENGTH matches num_directives)
if(NOT num_directives EQUAL 1)
message(FATAL_ERROR "rapids_cython_init is not idempotent, num_directives = ${num_directives}")
endif()
# Unset the cached CYTHON_FLAGS variable for future runs of the test to behave as expected.
unset(CYTHON_FLAGS CACHE)
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cython/rapids-cython.cmake | #=============================================================================
# Copyright (c) 2022, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/rapids-cython.cmake)
| 0 |
rapidsai_public_repos/rapids-cmake/testing/cython | rapidsai_public_repos/rapids-cmake/testing/cython/create_modules/CMakeLists.txt | #=============================================================================
# Copyright (c) 2022, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
cmake_minimum_required(VERSION 3.20)
include(${rapids-cmake-dir}/cython/create_modules.cmake)
include(${rapids-cmake-dir}/cython/init.cmake)
project(rapids_cython-create_modules LANGUAGES C CXX)
# Silence warning about running without scikit-build.
set(SKBUILD ON)
# Ensure that scikit-build's CMake files are discoverable. The glob is to
# capture the current git commit hash.
file(GLOB skbuild_resource_dir LIST_DIRECTORIES ON "${CPM_SOURCE_CACHE}/skbuild/*/skbuild/resources/cmake")
LIST(APPEND CMAKE_MODULE_PATH "${skbuild_resource_dir}")
rapids_cython_init()
# Test that an empty invocation works.
rapids_cython_create_modules()
# Test that a basic invocation with a single file works.
rapids_cython_create_modules(
SOURCE_FILES test.pyx
)
if(NOT TARGET test)
message(FATAL_ERROR "rapids_cython_create_modules didn't create the target `test`")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing/cython | rapidsai_public_repos/rapids-cmake/testing/cython/create_modules_with_library/CMakeLists.txt | #=============================================================================
# Copyright (c) 2022, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
cmake_minimum_required(VERSION 3.20)
include(${rapids-cmake-dir}/cython/create_modules.cmake)
include(${rapids-cmake-dir}/cython/init.cmake)
project(rapids_cython-create_modules LANGUAGES C CXX)
# Silence warning about running without scikit-build.
set(SKBUILD ON)
# Ensure that scikit-build's CMake files are discoverable. The glob is to
# capture the current git commit hash.
file(GLOB skbuild_resource_dir LIST_DIRECTORIES ON "${CPM_SOURCE_CACHE}/skbuild/*/skbuild/resources/cmake")
LIST(APPEND CMAKE_MODULE_PATH "${skbuild_resource_dir}")
rapids_cython_init()
# Test that we can specify a (fake) library.
add_library(rapids_cython_test_library test)
rapids_cython_create_modules(
SOURCE_FILES test.pyx
LINKED_LIBRARIES rapids_cython_test_library
)
| 0 |
rapidsai_public_repos/rapids-cmake/testing/cython | rapidsai_public_repos/rapids-cmake/testing/cython/add_rpath_entries/CMakeLists.txt | #=============================================================================
# Copyright (c) 2022, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
cmake_minimum_required(VERSION 3.20)
include(${rapids-cmake-dir}/cython/create_modules.cmake)
include(${rapids-cmake-dir}/cython/init.cmake)
include(${rapids-cmake-dir}/cython/add_rpath_entries.cmake)
project(rapids_cython-set_lib_dirs LANGUAGES C CXX)
# Silence warning about running without scikit-build.
set(SKBUILD ON)
# Ensure that scikit-build's CMake files are discoverable. The glob is to
# capture the current git commit hash.
file(GLOB skbuild_resource_dir LIST_DIRECTORIES ON "${CPM_SOURCE_CACHE}/skbuild/*/skbuild/resources/cmake")
LIST(APPEND CMAKE_MODULE_PATH "${skbuild_resource_dir}")
rapids_cython_init()
rapids_cython_create_modules(
SOURCE_FILES test.pyx
ASSOCIATED_TARGETS associated_target
)
# Test a relative path.
rapids_cython_add_rpath_entries(TARGET associated_target PATHS ../libraries)
get_target_property(rpath test INSTALL_RPATH)
if (NOT rpath STREQUAL "$ORIGIN;$ORIGIN/../libraries")
message(FATAL_ERROR "rapids_cython_set_lib_dirs failed to set the RPATH correctly.")
endif()
# Test a relative path with a root directory.
rapids_cython_add_rpath_entries(TARGET associated_target PATHS ../libraries ROOT_DIRECTORY ../)
get_target_property(rpath test INSTALL_RPATH)
if (NOT rpath STREQUAL "$ORIGIN;$ORIGIN/../libraries;$ORIGIN/../../libraries")
message(FATAL_ERROR "rapids_cython_set_lib_dirs failed to set the RPATH correctly.")
endif()
# Test an absolute path
rapids_cython_add_rpath_entries(TARGET associated_target PATHS /path/to/libraries)
get_target_property(rpath test INSTALL_RPATH)
set(the_path /path/to/libraries)
cmake_path(RELATIVE_PATH the_path)
if (NOT rpath STREQUAL "$ORIGIN;$ORIGIN/../libraries;$ORIGIN/../../libraries;$ORIGIN/${the_path}")
message(FATAL_ERROR "rapids_cython_set_lib_dirs failed to set the RPATH correctly.")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing/cython | rapidsai_public_repos/rapids-cmake/testing/cython/create_modules_with_prefix/CMakeLists.txt | #=============================================================================
# Copyright (c) 2022, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
cmake_minimum_required(VERSION 3.20)
include(${rapids-cmake-dir}/cython/create_modules.cmake)
include(${rapids-cmake-dir}/cython/init.cmake)
project(rapids_cython-create_modules LANGUAGES C CXX)
# Silence warning about running without scikit-build.
set(SKBUILD ON)
# Ensure that scikit-build's CMake files are discoverable. The glob is to
# capture the current git commit hash.
file(GLOB skbuild_resource_dir LIST_DIRECTORIES ON "${CPM_SOURCE_CACHE}/skbuild/*/skbuild/resources/cmake")
LIST(APPEND CMAKE_MODULE_PATH "${skbuild_resource_dir}")
rapids_cython_init()
# Test that an empty invocation works.
rapids_cython_create_modules()
# Test that we can use a prefix to generate a different library target.
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`")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cmake/conda_env-cross-build-x86-envvar.cmake | #=============================================================================
# Copyright (c) 2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/support_conda_env.cmake)
set(ENV{CONDA_BUILD} "1")
set(ENV{BUILD_PREFIX} "/usr/local/build_prefix")
set(ENV{target_platform} "linux-64")
set(ENV{PREFIX} "/opt/local/prefix")
set(ENV{CONDA_PREFIX} "/opt/conda/prefix")
rapids_cmake_support_conda_env(conda_env)
if(NOT TARGET conda_env)
message(FATAL_ERROR "Expected target conda_env to exist")
endif()
get_target_property(include_dirs conda_env INTERFACE_INCLUDE_DIRECTORIES)
if( NOT "$ENV{BUILD_PREFIX}/include" IN_LIST include_dirs)
message(FATAL_ERROR "Expected env{BUILD_PREFIX} to be in the include dirs of `conda_env`")
endif()
if( NOT "$ENV{PREFIX}/include" IN_LIST include_dirs)
message(FATAL_ERROR "Expected env{PREFIX} to be in the include dirs of `conda_env`")
endif()
if("$ENV{CONDA_PREFIX}/include" IN_LIST include_dirs)
message(FATAL_ERROR "Not expected for env{CONDA_PREFIX} to be in the include dirs of `conda_env`")
endif()
get_target_property(link_dirs conda_env INTERFACE_LINK_DIRECTORIES)
if( NOT "$ENV{BUILD_PREFIX}/lib" IN_LIST link_dirs)
message(FATAL_ERROR "Expected env{BUILD_PREFIX} to be in the link dirs of `conda_env`")
endif()
if( NOT "$ENV{PREFIX}/lib" IN_LIST link_dirs)
message(FATAL_ERROR "Expected env{PREFIX} to be in the link dirs of `conda_env`")
endif()
if("$ENV{CONDA_PREFIX}/lib" IN_LIST link_dirs)
message(FATAL_ERROR "Not expected for env{CONDA_PREFIX} to be in the link dirs of `conda_env`")
endif()
get_target_property(link_options conda_env INTERFACE_LINK_OPTIONS)
message(STATUS "link_options: ${link_options}")
if( NOT "$<HOST_LINK:SHELL:LINKER:-rpath-link=$ENV{BUILD_PREFIX}/lib>" IN_LIST link_options)
message(FATAL_ERROR "Expected rpath-link=env{BUILD_PREFIX} to be in the link options of `conda_env`")
endif()
if( NOT "$<HOST_LINK:SHELL:LINKER:-rpath-link=$ENV{PREFIX}/lib>" IN_LIST link_options)
message(FATAL_ERROR "Expected rpath-link=env{PREFIX} to be in the link options of `conda_env`")
endif()
if( NOT "$<HOST_LINK:SHELL:LINKER:-rpath-link=$ENV{PREFIX}/targets/x86_64-linux/lib>" 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("$<HOST_LINK:SHELL:LINKER:-rpath-link=$ENV{CONDA_PREFIX}/lib>" IN_LIST link_options)
message(FATAL_ERROR "Not expected for rpath-link=env{CONDA_PREFIX} to be in the link options of `conda_env`")
endif()
# No effect as the target already exists
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}")
endif()
# New target being used, so this should modify ENV{CMAKE_PREFIX_PATH}
set(ENV{CMAKE_PREFIX_PATH} "placeholder" )
rapids_cmake_support_conda_env(conda_env_modify MODIFY_PREFIX_PATH)
if(NOT TARGET conda_env_modify)
message(FATAL_ERROR "Expected target conda_env_modify to exist")
endif()
cmake_path(CONVERT "$ENV{CMAKE_PREFIX_PATH}" TO_CMAKE_PATH_LIST env_cmake_prefix_path NORMALIZE)
list(LENGTH env_cmake_prefix_path len)
if( len GREATER 4)
message(FATAL_ERROR "ENV{CMAKE_PREFIX_PATH} length is wrong after MODIFY_PREFIX_PATH")
endif()
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(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)
message(STATUS "correct: ${correct}")
message(STATUS "actual: ${actual}")
message(FATAL_ERROR "MODIFY_PREFIX_PATH failed")
endif()
endforeach()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cmake/conda_env-build-envvar.cmake | #=============================================================================
# Copyright (c) 2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/support_conda_env.cmake)
set(ENV{CONDA_BUILD} "1")
set(ENV{BUILD_PREFIX} "/usr/local/build_prefix")
set(ENV{PREFIX} "/opt/local/prefix")
set(ENV{CONDA_PREFIX} "/opt/conda/prefix")
rapids_cmake_support_conda_env(conda_env)
if(NOT TARGET conda_env)
message(FATAL_ERROR "Expected target conda_env to exist")
endif()
get_target_property(include_dirs conda_env INTERFACE_INCLUDE_DIRECTORIES)
if( NOT "$ENV{BUILD_PREFIX}/include" IN_LIST include_dirs)
message(FATAL_ERROR "Expected env{BUILD_PREFIX} to be in the include dirs of `conda_env`")
endif()
if( NOT "$ENV{PREFIX}/include" IN_LIST include_dirs)
message(FATAL_ERROR "Expected env{PREFIX} to be in the include dirs of `conda_env`")
endif()
if("$ENV{CONDA_PREFIX}/include" IN_LIST include_dirs)
message(FATAL_ERROR "Not expected for env{CONDA_PREFIX} to be in the include dirs of `conda_env`")
endif()
get_target_property(link_dirs conda_env INTERFACE_LINK_DIRECTORIES)
if( NOT "$ENV{BUILD_PREFIX}/lib" IN_LIST link_dirs)
message(FATAL_ERROR "Expected env{BUILD_PREFIX} to be in the link dirs of `conda_env`")
endif()
if( NOT "$ENV{PREFIX}/lib" IN_LIST link_dirs)
message(FATAL_ERROR "Expected env{PREFIX} to be in the link dirs of `conda_env`")
endif()
if("$ENV{CONDA_PREFIX}/lib" IN_LIST link_dirs)
message(FATAL_ERROR "Not expected for env{CONDA_PREFIX} to be in the link dirs of `conda_env`")
endif()
get_target_property(link_options conda_env INTERFACE_LINK_OPTIONS)
message(STATUS "link_options: ${link_options}")
if( NOT "$<HOST_LINK:SHELL:LINKER:-rpath-link=$ENV{BUILD_PREFIX}/lib>" IN_LIST link_options)
message(FATAL_ERROR "Expected rpath-link=env{BUILD_PREFIX} to be in the link options of `conda_env`")
endif()
if( NOT "$<HOST_LINK:SHELL:LINKER:-rpath-link=$ENV{PREFIX}/lib>" IN_LIST link_options)
message(FATAL_ERROR "Expected rpath-link=env{PREFIX} to be in the link options of `conda_env`")
endif()
if("$<HOST_LINK:SHELL:LINKER:-rpath-link=$ENV{CONDA_PREFIX}/lib>" IN_LIST link_options)
message(FATAL_ERROR "Not expected for rpath-link=env{CONDA_PREFIX} to be in the link options of `conda_env`")
endif()
# No effect as the target already exists
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}")
endif()
# New target being used, so this should modify ENV{CMAKE_PREFIX_PATH}
set(ENV{CMAKE_PREFIX_PATH} "placeholder" )
rapids_cmake_support_conda_env(conda_env_modify MODIFY_PREFIX_PATH)
if(NOT TARGET conda_env_modify)
message(FATAL_ERROR "Expected target conda_env_modify to exist")
endif()
cmake_path(CONVERT "$ENV{CMAKE_PREFIX_PATH}" TO_CMAKE_PATH_LIST env_cmake_prefix_path NORMALIZE)
list(LENGTH env_cmake_prefix_path len)
if( len GREATER 3)
message(FATAL_ERROR "ENV{CMAKE_PREFIX_PATH} length is wrong after MODIFY_PREFIX_PATH")
endif()
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)
set(correct_list "placeholder" "$ENV{PREFIX}" "$ENV{BUILD_PREFIX}")
set(actual_list "${first_value}" "${second_value}" "${third_value}")
foreach(correct actual IN ZIP_LISTS correct_list actual_list)
if(NOT correct STREQUAL actual)
message(STATUS "correct: ${correct}")
message(STATUS "actual: ${actual}")
message(FATAL_ERROR "MODIFY_PREFIX_PATH failed")
endif()
endforeach()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cmake/parse_version-patch-invalid.cmake | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/parse_version.cmake)
rapids_cmake_parse_version(PATCH "" patch_value)
if(DEFINED patch_value)
message(FATAL_ERROR "rapids_cmake_parse_version(PATCH) value parsing should have failed")
endif()
rapids_cmake_parse_version(PATCH "not-a-version" patch_value)
if(DEFINED patch_value)
message(FATAL_ERROR "rapids_cmake_parse_version(PATCH) value parsing failed unexpectedly")
endif()
rapids_cmake_parse_version(PATCH "100" patch_value)
if(DEFINED patch_value)
message(FATAL_ERROR "rapids_cmake_parse_version(PATCH) value parsing failed unexpectedly")
endif()
rapids_cmake_parse_version(PATCH "." patch_value)
if(DEFINED patch_value)
message(FATAL_ERROR "rapids_cmake_parse_version(PATCH) value parsing failed unexpectedly")
endif()
rapids_cmake_parse_version(PATCH "21.03" patch_value)
if(DEFINED patch_value)
message(FATAL_ERROR "rapids_cmake_parse_version(PATCH) value parsing failed unexpectedly")
endif()
rapids_cmake_parse_version(PATCH "100.." patch_value)
if(DEFINED patch_value)
message(FATAL_ERROR "rapids_cmake_parse_version(PATCH) value parsing failed unexpectedly")
endif()
rapids_cmake_parse_version(PATCH ".." patch_value)
if(DEFINED patch_value)
message(FATAL_ERROR "rapids_cmake_parse_version(PATCH) value parsing failed unexpectedly")
endif()
rapids_cmake_parse_version(PATCH "100..." patch_value)
if(DEFINED patch_value)
message(FATAL_ERROR "rapids_cmake_parse_version(PATCH) value parsing failed unexpectedly")
endif()
rapids_cmake_parse_version(PATCH "..." patch_value)
if(DEFINED patch_value)
message(FATAL_ERROR "rapids_cmake_parse_version(PATCH) value parsing failed unexpectedly")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cmake/CMakeLists.txt | #=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
add_cmake_config_test( rapids-cmake.cmake )
add_cmake_config_test( build_type-debug.cmake )
add_cmake_config_test( build_type-multiple.cmake )
add_cmake_config_test( build_type-user-specified.cmake)
add_cmake_config_test( conda_env-build.cmake )
add_cmake_config_test( conda_env-build-envvar.cmake )
add_cmake_config_test( conda_env-cross-build-arm.cmake )
add_cmake_config_test( conda_env-cross-build-arm-envvar.cmake )
add_cmake_config_test( conda_env-cross-build-x86.cmake )
add_cmake_config_test( conda_env-cross-build-x86-envvar.cmake )
add_cmake_config_test( conda_env-invalid.cmake )
add_cmake_config_test( conda_env-prefix.cmake )
add_cmake_config_test( conda_env-prefix-envvar.cmake )
add_cmake_config_test( install_lib_dir-after-gnuinstalldir-include.cmake )
add_cmake_config_test( install_lib_dir-build.cmake )
add_cmake_config_test( install_lib_dir-lib64-with-conda_build.cmake )
add_cmake_config_test( install_lib_dir-lib64-with-conda_prefix.cmake )
add_cmake_config_test( install_lib_dir-no-conda.cmake )
add_cmake_config_test( install_lib_dir-prefix.cmake )
add_cmake_config_test( make_global-already-imported-global.cmake )
add_cmake_config_test( make_global-is-alias.cmake )
add_cmake_config_test( make_global-no-targets.cmake )
add_cmake_config_test( make_global-not-imported.cmake )
add_cmake_config_test( make_global-valid.cmake )
add_cmake_config_test( parse_version-major-valid.cmake )
add_cmake_config_test( parse_version-major-invalid.cmake )
add_cmake_config_test( parse_version-minor-invalid.cmake )
add_cmake_config_test( parse_version-minor-valid.cmake )
add_cmake_config_test( parse_version-patch-valid.cmake )
add_cmake_config_test( parse_version-patch-invalid.cmake )
add_cmake_config_test( parse_version-major_minor-invalid.cmake )
add_cmake_config_test( parse_version-major_minor-valid.cmake )
add_cmake_build_test( write_git_revision-custom-prefix )
add_cmake_build_test( write_git_revision-dirty )
add_cmake_build_test( write_git_revision-embed )
add_cmake_build_test( write_git_revision-no-git )
add_cmake_build_test( write_git_revision-simple )
add_cmake_build_test( write_version-absolute )
add_cmake_build_test( write_version-all-zeroes )
add_cmake_build_test( write_version-custom-prefix )
add_cmake_build_test( write_version-leading-zeroes )
add_cmake_build_test( write_version-relative )
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cmake/install_lib_dir-lib64-with-conda_prefix.cmake | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/install_lib_dir.cmake)
unset(ENV{CONDA_BUILD})
unset(ENV{CONDA_PREFIX})
set(ENV{CONDA_PREFIX} "/opt/conda/prefix")
set(CMAKE_INSTALL_PREFIX "/opt/not-conda/prefix")
set(CMAKE_INSTALL_LIBDIR "lib64")
rapids_cmake_install_lib_dir( lib_dir )
if(NOT lib_dir STREQUAL "lib64")
message(FATAL_ERROR "rapids_cmake_install_lib_dir computed '${lib_dir}', but we expected 'lib64'")
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'")
endif()
set(CMAKE_INSTALL_PREFIX "/opt/conda/prefix")
unset(CMAKE_INSTALL_LIBDIR)
unset(CMAKE_INSTALL_LIBDIR CACHE)
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'")
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'")
endif()
# unset CMAKE_INSTALL_LIBDIR so it doesn't leak into our CMakeCache.txt and cause subsequent
# re-runs of the test to fail
unset(CMAKE_INSTALL_LIBDIR)
unset(CMAKE_INSTALL_LIBDIR CACHE)
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cmake/install_lib_dir-after-gnuinstalldir-include.cmake | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/install_lib_dir.cmake)
unset(ENV{CONDA_BUILD})
unset(ENV{CONDA_PREFIX})
include(GNUInstallDirs)
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")
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")
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")
endif()
# unset CMAKE_INSTALL_LIBDIR so it doesn't leak into our CMakeCache.txt and cause subsequent
# re-runs of the test to fail
unset(CMAKE_INSTALL_LIBDIR)
unset(CMAKE_INSTALL_LIBDIR CACHE)
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cmake/install_lib_dir-build.cmake | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/install_lib_dir.cmake)
set(ENV{CONDA_BUILD} "1")
set(ENV{PREFIX} "/opt/conda/prefix")
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")
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")
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")
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")
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")
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")
endif()
# unset CMAKE_INSTALL_LIBDIR so it doesn't leak into our CMakeCache.txt and cause subsequent
# re-runs of the test to fail
unset(CMAKE_INSTALL_LIBDIR)
unset(CMAKE_INSTALL_LIBDIR CACHE)
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cmake/install_lib_dir-prefix.cmake | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/install_lib_dir.cmake)
unset(ENV{CONDA_BUILD})
unset(ENV{CONDA_PREFIX})
set(ENV{CONDA_PREFIX} "/opt/conda/prefix")
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")
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")
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")
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")
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")
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")
endif()
# unset CMAKE_INSTALL_LIBDIR so it doesn't leak into our CMakeCache.txt and cause subsequent
# re-runs of the test to fail
unset(CMAKE_INSTALL_LIBDIR)
unset(CMAKE_INSTALL_LIBDIR CACHE)
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cmake/install_lib_dir-lib64-with-conda_build.cmake | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/install_lib_dir.cmake)
set(ENV{CONDA_BUILD} "1")
set(ENV{PREFIX} "/opt/conda/prefix")
set(CMAKE_INSTALL_PREFIX "/usr/local/")
set(CMAKE_INSTALL_LIBDIR "lib64")
rapids_cmake_install_lib_dir( lib_dir )
if(NOT lib_dir STREQUAL "lib64")
message(FATAL_ERROR "rapids_cmake_install_lib_dir computed '${lib_dir}', but we expected 'lib64'")
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'")
endif()
set(CMAKE_INSTALL_PREFIX "/opt/conda/prefix")
unset(CMAKE_INSTALL_LIBDIR)
unset(CMAKE_INSTALL_LIBDIR CACHE)
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'")
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'")
endif()
# unset CMAKE_INSTALL_LIBDIR so it doesn't leak into our CMakeCache.txt and cause subsequent
# re-runs of the test to fail
unset(CMAKE_INSTALL_LIBDIR)
unset(CMAKE_INSTALL_LIBDIR CACHE)
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cmake/conda_env-cross-build-arm-envvar.cmake | #=============================================================================
# Copyright (c) 2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/support_conda_env.cmake)
set(ENV{CONDA_BUILD} "1")
set(ENV{BUILD_PREFIX} "/usr/local/build_prefix")
set(ENV{cross_target_platform} "linux-aarch64")
set(ENV{PREFIX} "/opt/local/prefix")
set(ENV{CONDA_PREFIX} "/opt/conda/prefix")
rapids_cmake_support_conda_env(conda_env)
if(NOT TARGET conda_env)
message(FATAL_ERROR "Expected target conda_env to exist")
endif()
get_target_property(include_dirs conda_env INTERFACE_INCLUDE_DIRECTORIES)
if( NOT "$ENV{BUILD_PREFIX}/include" IN_LIST include_dirs)
message(FATAL_ERROR "Expected env{BUILD_PREFIX} to be in the include dirs of `conda_env`")
endif()
if( NOT "$ENV{PREFIX}/include" IN_LIST include_dirs)
message(FATAL_ERROR "Expected env{PREFIX} to be in the include dirs of `conda_env`")
endif()
if("$ENV{CONDA_PREFIX}/include" IN_LIST include_dirs)
message(FATAL_ERROR "Not expected for env{CONDA_PREFIX} to be in the include dirs of `conda_env`")
endif()
get_target_property(link_dirs conda_env INTERFACE_LINK_DIRECTORIES)
if( NOT "$ENV{BUILD_PREFIX}/lib" IN_LIST link_dirs)
message(FATAL_ERROR "Expected env{BUILD_PREFIX} to be in the link dirs of `conda_env`")
endif()
if( NOT "$ENV{PREFIX}/lib" IN_LIST link_dirs)
message(FATAL_ERROR "Expected env{PREFIX} to be in the link dirs of `conda_env`")
endif()
if("$ENV{CONDA_PREFIX}/lib" IN_LIST link_dirs)
message(FATAL_ERROR "Not expected for env{CONDA_PREFIX} to be in the link dirs of `conda_env`")
endif()
get_target_property(link_options conda_env INTERFACE_LINK_OPTIONS)
message(STATUS "link_options: ${link_options}")
if( NOT "$<HOST_LINK:SHELL:LINKER:-rpath-link=$ENV{BUILD_PREFIX}/lib>" IN_LIST link_options)
message(FATAL_ERROR "Expected rpath-link=env{BUILD_PREFIX} to be in the link options of `conda_env`")
endif()
if( NOT "$<HOST_LINK:SHELL:LINKER:-rpath-link=$ENV{PREFIX}/lib>" IN_LIST link_options)
message(FATAL_ERROR "Expected rpath-link=env{PREFIX} to be in the link options of `conda_env`")
endif()
if( NOT "$<HOST_LINK:SHELL:LINKER:-rpath-link=$ENV{PREFIX}/targets/sbsa-linux/lib>" 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("$<HOST_LINK:SHELL:LINKER:-rpath-link=$ENV{CONDA_PREFIX}/lib>" IN_LIST link_options)
message(FATAL_ERROR "Not expected for rpath-link=env{CONDA_PREFIX} to be in the link options of `conda_env`")
endif()
# No effect as the target already exists
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}")
endif()
# New target being used, so this should modify ENV{CMAKE_PREFIX_PATH}
set(ENV{CMAKE_PREFIX_PATH} "placeholder" )
rapids_cmake_support_conda_env(conda_env_modify MODIFY_PREFIX_PATH)
if(NOT TARGET conda_env_modify)
message(FATAL_ERROR "Expected target conda_env_modify to exist")
endif()
cmake_path(CONVERT "$ENV{CMAKE_PREFIX_PATH}" TO_CMAKE_PATH_LIST env_cmake_prefix_path NORMALIZE)
list(LENGTH env_cmake_prefix_path len)
if( len GREATER 4)
message(FATAL_ERROR "ENV{CMAKE_PREFIX_PATH} length is wrong after MODIFY_PREFIX_PATH")
endif()
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(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)
message(STATUS "correct: ${correct}")
message(STATUS "actual: ${actual}")
message(FATAL_ERROR "MODIFY_PREFIX_PATH failed")
endif()
endforeach()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cmake/make_global-is-alias.cmake | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/make_global.cmake)
add_library(test_lib UNKNOWN IMPORTED)
add_library(test::lib ALIAS test_lib)
set(targets test::lib)
rapids_cmake_make_global(targets)
# verify that test::lib AND test_lib are now global
get_target_property(alias_is_global test::lib ALIAS_GLOBAL)
if(alias_is_global)
message(FATAL_ERROR "Expected alias_is_global to be False [${alias_is_global}]")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cmake/parse_version-major-invalid.cmake | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/parse_version.cmake)
rapids_cmake_parse_version(MAJOR "" major_value)
if(DEFINED major_value)
message(FATAL_ERROR "rapids_cmake_parse_version(MAJOR) value parsing should have failed")
endif()
rapids_cmake_parse_version(MAJOR "." major_value)
if(DEFINED major_value)
message(FATAL_ERROR "rapids_cmake_parse_version(MAJOR) value parsing failed unexpectedly")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cmake/parse_version-minor-invalid.cmake | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/parse_version.cmake)
rapids_cmake_parse_version(MINOR "" minor_value)
if(DEFINED minor_value)
message(FATAL_ERROR "rapids_cmake_parse_version(MINOR) value parsing should have failed")
endif()
rapids_cmake_parse_version(MINOR "not-a-version" minor_value)
if(DEFINED minor_value)
message(FATAL_ERROR "rapids_cmake_parse_version(MINOR) value parsing failed unexpectedly")
endif()
rapids_cmake_parse_version(MINOR "100" minor_value)
if(DEFINED minor_value)
message(FATAL_ERROR "rapids_cmake_parse_version(MINOR) value parsing failed unexpectedly")
endif()
rapids_cmake_parse_version(MINOR "." minor_value)
if(DEFINED minor_value)
message(FATAL_ERROR "rapids_cmake_parse_version(MINOR) value parsing failed unexpectedly")
endif()
rapids_cmake_parse_version(MINOR "100." minor_value)
if(DEFINED minor_value)
message(FATAL_ERROR "rapids_cmake_parse_version(MINOR) value parsing failed unexpectedly")
endif()
rapids_cmake_parse_version(MINOR "100.." minor_value)
message(STATUS "minor_value: ${minor_value}")
if(DEFINED minor_value)
message(FATAL_ERROR "rapids_cmake_parse_version(MINOR) value parsing failed unexpectedly")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cmake/parse_version-minor-valid.cmake | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/parse_version.cmake)
rapids_cmake_parse_version(MINOR "1.a.0" minor_value)
if(NOT minor_value STREQUAL "a")
message(FATAL_ERROR "rapids_cmake_parse_version(MINOR) value parsing failed unexpectedly")
endif()
rapids_cmake_parse_version(MINOR "0.200.git-sha1" minor_value)
if(NOT minor_value EQUAL 200)
message(FATAL_ERROR "rapids_cmake_parse_version(MINOR) value parsing failed unexpectedly")
endif()
rapids_cmake_parse_version(MINOR "21.03.00...22.04.00" minor_value)
if(NOT minor_value STREQUAL "03")
message(FATAL_ERROR "rapids_cmake_parse_version(MINOR) value parsing failed unexpectedly")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cmake/conda_env-invalid.cmake | #=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/support_conda_env.cmake)
unset(ENV{CONDA_BUILD})
unset(ENV{CONDA_PREFIX})
set(ENV{BUILD_PREFIX} "/usr/local/build_prefix")
set(ENV{PREFIX} "/opt/local/prefix")
rapids_cmake_support_conda_env(conda_env)
if(TARGET conda_env)
message(FATAL_ERROR "Not expected for `conda_env` target to exist")
endif()
set(before_call_value "${CMAKE_PREFIX_PATH}" )
rapids_cmake_support_conda_env(conda_env2 MODIFY_PREFIX_PATH)
if(TARGET conda_env2)
message(FATAL_ERROR "Not expected for `conda_env2` target to exist")
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")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cmake/conda_env-cross-build-x86.cmake | #=============================================================================
# Copyright (c) 2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/support_conda_env.cmake)
set(ENV{CONDA_BUILD} "1")
set(ENV{BUILD_PREFIX} "/usr/local/build_prefix")
set(ENV{target_platform} "linux-64")
set(ENV{PREFIX} "/opt/local/prefix")
set(ENV{CONDA_PREFIX} "/opt/conda/prefix")
rapids_cmake_support_conda_env(conda_env)
if(NOT TARGET conda_env)
message(FATAL_ERROR "Expected target conda_env to exist")
endif()
get_target_property(include_dirs conda_env INTERFACE_INCLUDE_DIRECTORIES)
if( NOT "$ENV{BUILD_PREFIX}/include" IN_LIST include_dirs)
message(FATAL_ERROR "Expected env{BUILD_PREFIX} to be in the include dirs of `conda_env`")
endif()
if( NOT "$ENV{PREFIX}/include" IN_LIST include_dirs)
message(FATAL_ERROR "Expected env{PREFIX} to be in the include dirs of `conda_env`")
endif()
if("$ENV{CONDA_PREFIX}/include" IN_LIST include_dirs)
message(FATAL_ERROR "Not expected for env{CONDA_PREFIX} to be in the include dirs of `conda_env`")
endif()
get_target_property(link_dirs conda_env INTERFACE_LINK_DIRECTORIES)
if( NOT "$ENV{BUILD_PREFIX}/lib" IN_LIST link_dirs)
message(FATAL_ERROR "Expected env{BUILD_PREFIX} to be in the link dirs of `conda_env`")
endif()
if( NOT "$ENV{PREFIX}/lib" IN_LIST link_dirs)
message(FATAL_ERROR "Expected env{PREFIX} to be in the link dirs of `conda_env`")
endif()
if("$ENV{CONDA_PREFIX}/lib" IN_LIST link_dirs)
message(FATAL_ERROR "Not expected for env{CONDA_PREFIX} to be in the link dirs of `conda_env`")
endif()
get_target_property(link_options conda_env INTERFACE_LINK_OPTIONS)
message(STATUS "link_options: ${link_options}")
if( NOT "$<HOST_LINK:SHELL:LINKER:-rpath-link=$ENV{BUILD_PREFIX}/lib>" IN_LIST link_options)
message(FATAL_ERROR "Expected rpath-link=env{BUILD_PREFIX} to be in the link options of `conda_env`")
endif()
if( NOT "$<HOST_LINK:SHELL:LINKER:-rpath-link=$ENV{PREFIX}/lib>" IN_LIST link_options)
message(FATAL_ERROR "Expected rpath-link=env{PREFIX} to be in the link options of `conda_env`")
endif()
if( NOT "$<HOST_LINK:SHELL:LINKER:-rpath-link=$ENV{PREFIX}/targets/x86_64-linux/lib>" 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("$<HOST_LINK:SHELL:LINKER:-rpath-link=$ENV{CONDA_PREFIX}/lib>" IN_LIST link_options)
message(FATAL_ERROR "Not expected for rpath-link=env{CONDA_PREFIX} to be in the link options of `conda_env`")
endif()
# No effect as the target already exists
set(before_call_value "${CMAKE_PREFIX_PATH}" )
rapids_cmake_support_conda_env(conda_env MODIFY_PREFIX_PATH)
if(NOT ("${before_call_value}" STREQUAL "${CMAKE_PREFIX_PATH}") )
message(FATAL_ERROR "Expected rapids_cmake_support_conda_env not to change CMAKE_PREFIX_PATH")
endif()
# New target being used, so this should modify CMAKE_PREFIX_PATH
set(CMAKE_PREFIX_PATH "placeholder" )
set(ENV{CMAKE_PREFIX_PATH} "env_1:env_2" )
rapids_cmake_support_conda_env(conda_env_modify MODIFY_PREFIX_PATH)
if(NOT TARGET conda_env_modify)
message(FATAL_ERROR "Expected target conda_env_modify to exist")
endif()
list(LENGTH CMAKE_PREFIX_PATH len)
if( len GREATER 6)
message(FATAL_ERROR "CMAKE_PREFIX_PATH length is wrong after MODIFY_PREFIX_PATH")
endif()
list(GET CMAKE_PREFIX_PATH 0 first_value)
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)
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}")
foreach(correct actual IN ZIP_LISTS correct_list actual_list)
if(NOT correct STREQUAL actual)
message(STATUS "correct: ${correct}")
message(STATUS "actual: ${actual}")
message(FATAL_ERROR "MODIFY_PREFIX_PATH failed")
endif()
endforeach()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cmake/make_global-already-imported-global.cmake | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/make_global.cmake)
add_library(test_lib UNKNOWN IMPORTED GLOBAL)
set(targets test_lib)
rapids_cmake_make_global(targets)
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cmake/build_type-debug.cmake | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/build_type.cmake)
rapids_cmake_build_type(DEBUG)
if(CMAKE_CONFIGURATION_TYPES)
if(DEFINED CMAKE_BUILD_TYPE)
message(FATAL_ERROR "rapids_cmake_build_type failed when executed by a multi-config generator")
endif()
elseif(NOT CMAKE_BUILD_TYPE STREQUAL "DEBUG")
message(FATAL_ERROR "rapids_cmake_build_type failed")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cmake/rapids-cmake.cmake | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/rapids-cmake.cmake)
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cmake/make_global-valid.cmake | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/make_global.cmake)
add_library(test_lib UNKNOWN IMPORTED)
set(targets test_lib)
rapids_cmake_make_global(targets)
get_target_property(is_global test_lib IMPORTED_GLOBAL)
if(NOT is_global)
message(FATAL_ERROR "Expected is_global to be True [${is_global}]")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cmake/parse_version-patch-valid.cmake | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/parse_version.cmake)
rapids_cmake_parse_version(PATCH "1.a.0" patch_value)
message(STATUS "patch_value: ${patch_value}")
if(NOT patch_value EQUAL 0)
message(FATAL_ERROR "rapids_cmake_parse_version(PATCH) value parsing failed unexpectedly")
endif()
rapids_cmake_parse_version(PATCH "0.200.git-sha1" patch_value)
if(NOT patch_value STREQUAL "git-sha1")
message(FATAL_ERROR "rapids_cmake_parse_version(PATCH) value parsing failed unexpectedly")
endif()
rapids_cmake_parse_version(PATCH "21.03.00...22.04.00" patch_value)
if(NOT patch_value STREQUAL "00")
message(FATAL_ERROR "rapids_cmake_parse_version(PATCH) value parsing failed unexpectedly")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cmake/conda_env-prefix-envvar.cmake | #=============================================================================
# Copyright (c) 2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/support_conda_env.cmake)
set(ENV{CONDA_BUILD} "2")
set(ENV{BUILD_PREFIX} "/usr/local/build_prefix")
set(ENV{PREFIX} "/opt/local/prefix")
set(ENV{CONDA_PREFIX} "/opt/conda/prefix")
rapids_cmake_support_conda_env(conda_env)
get_target_property(include_dirs conda_env INTERFACE_INCLUDE_DIRECTORIES)
if( "$ENV{BUILD_PREFIX}/include" IN_LIST include_dirs)
message(FATAL_ERROR "Not expected env{BUILD_PREFIX} to be in the include dirs of `conda_env`")
endif()
if( "$ENV{PREFIX}/include" IN_LIST include_dirs)
message(FATAL_ERROR "Not expected env{PREFIX} to be in the include dirs of `conda_env`")
endif()
if( NOT "$ENV{CONDA_PREFIX}/include" IN_LIST include_dirs)
message(FATAL_ERROR "Expected for env{CONDA_PREFIX} to be in the include dirs of `conda_env`")
endif()
get_target_property(link_dirs conda_env INTERFACE_LINK_DIRECTORIES)
if( "$ENV{BUILD_PREFIX}/lib" IN_LIST link_dirs)
message(FATAL_ERROR "Not expected env{BUILD_PREFIX} to be in the link dirs of `conda_env`")
endif()
if( "$ENV{PREFIX}/lib" IN_LIST link_dirs)
message(FATAL_ERROR "Not expected env{PREFIX} to be in the link dirs of `conda_env`")
endif()
if( NOT "$ENV{CONDA_PREFIX}/lib" IN_LIST link_dirs)
message(FATAL_ERROR "Expected for env{CONDA_PREFIX} to be in the link dirs of `conda_env`")
endif()
get_target_property(link_options conda_env INTERFACE_LINK_OPTIONS)
if( "$<HOST_LINK:SHELL:LINKER:-rpath-link=$ENV{BUILD_PREFIX}/lib>" IN_LIST link_options)
message(FATAL_ERROR "Not expected rpath-link=env{BUILD_PREFIX} to be in the link options of `conda_env`")
endif()
if( "$<HOST_LINK:SHELL:LINKER:-rpath-link=$ENV{PREFIX}/lib>" IN_LIST link_options)
message(FATAL_ERROR "Not expected rpath-link=env{PREFIX} to be in the link options of `conda_env`")
endif()
if( NOT "$<HOST_LINK:SHELL:LINKER:-rpath-link=$ENV{CONDA_PREFIX}/lib>" IN_LIST link_options)
message(FATAL_ERROR "Expected for rpath-link=env{CONDA_PREFIX} to be in the link options of `conda_env`")
endif()
set(ENV{CMAKE_PREFIX_PATH} "placeholder" )
rapids_cmake_support_conda_env(conda_env_modify MODIFY_PREFIX_PATH)
if(NOT TARGET conda_env_modify)
message(FATAL_ERROR "Expected target conda_env_modify to exist")
endif()
cmake_path(CONVERT "$ENV{CMAKE_PREFIX_PATH}" TO_CMAKE_PATH_LIST env_cmake_prefix_path NORMALIZE)
list(LENGTH env_cmake_prefix_path len)
if( len GREATER 2)
message(FATAL_ERROR "ENV{CMAKE_PREFIX_PATH} length is wrong after MODIFY_PREFIX_PATH")
endif()
list(GET env_cmake_prefix_path 0 first_value)
list(GET env_cmake_prefix_path 1 second_value)
set(correct_list "placeholder" "$ENV{CONDA_PREFIX}")
set(actual_list "${first_value}" "${second_value}")
foreach(correct actual IN ZIP_LISTS correct_list actual_list)
if(NOT correct STREQUAL actual)
message(FATAL_ERROR "MODIFY_PREFIX_PATH failed")
endif()
endforeach()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cmake/conda_env-cross-build-arm.cmake | #=============================================================================
# Copyright (c) 2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/support_conda_env.cmake)
set(ENV{CONDA_BUILD} "1")
set(ENV{BUILD_PREFIX} "/usr/local/build_prefix")
set(ENV{cross_target_platform} "linux-aarch64")
set(ENV{PREFIX} "/opt/local/prefix")
set(ENV{CONDA_PREFIX} "/opt/conda/prefix")
rapids_cmake_support_conda_env(conda_env)
if(NOT TARGET conda_env)
message(FATAL_ERROR "Expected target conda_env to exist")
endif()
get_target_property(include_dirs conda_env INTERFACE_INCLUDE_DIRECTORIES)
if( NOT "$ENV{BUILD_PREFIX}/include" IN_LIST include_dirs)
message(FATAL_ERROR "Expected env{BUILD_PREFIX} to be in the include dirs of `conda_env`")
endif()
if( NOT "$ENV{PREFIX}/include" IN_LIST include_dirs)
message(FATAL_ERROR "Expected env{PREFIX} to be in the include dirs of `conda_env`")
endif()
if("$ENV{CONDA_PREFIX}/include" IN_LIST include_dirs)
message(FATAL_ERROR "Not expected for env{CONDA_PREFIX} to be in the include dirs of `conda_env`")
endif()
get_target_property(link_dirs conda_env INTERFACE_LINK_DIRECTORIES)
if( NOT "$ENV{BUILD_PREFIX}/lib" IN_LIST link_dirs)
message(FATAL_ERROR "Expected env{BUILD_PREFIX} to be in the link dirs of `conda_env`")
endif()
if( NOT "$ENV{PREFIX}/lib" IN_LIST link_dirs)
message(FATAL_ERROR "Expected env{PREFIX} to be in the link dirs of `conda_env`")
endif()
if("$ENV{CONDA_PREFIX}/lib" IN_LIST link_dirs)
message(FATAL_ERROR "Not expected for env{CONDA_PREFIX} to be in the link dirs of `conda_env`")
endif()
get_target_property(link_options conda_env INTERFACE_LINK_OPTIONS)
message(STATUS "link_options: ${link_options}")
if( NOT "$<HOST_LINK:SHELL:LINKER:-rpath-link=$ENV{BUILD_PREFIX}/lib>" IN_LIST link_options)
message(FATAL_ERROR "Expected rpath-link=env{BUILD_PREFIX} to be in the link options of `conda_env`")
endif()
if( NOT "$<HOST_LINK:SHELL:LINKER:-rpath-link=$ENV{PREFIX}/lib>" IN_LIST link_options)
message(FATAL_ERROR "Expected rpath-link=env{PREFIX} to be in the link options of `conda_env`")
endif()
if( NOT "$<HOST_LINK:SHELL:LINKER:-rpath-link=$ENV{PREFIX}/targets/sbsa-linux/lib>" 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("$<HOST_LINK:SHELL:LINKER:-rpath-link=$ENV{CONDA_PREFIX}/lib>" IN_LIST link_options)
message(FATAL_ERROR "Not expected for rpath-link=env{CONDA_PREFIX} to be in the link options of `conda_env`")
endif()
# No effect as the target already exists
set(before_call_value "${CMAKE_PREFIX_PATH}" )
rapids_cmake_support_conda_env(conda_env MODIFY_PREFIX_PATH)
if(NOT ("${before_call_value}" STREQUAL "${CMAKE_PREFIX_PATH}") )
message(FATAL_ERROR "Expected rapids_cmake_support_conda_env not to change CMAKE_PREFIX_PATH")
endif()
# New target being used, so this should modify CMAKE_PREFIX_PATH
set(CMAKE_PREFIX_PATH "placeholder" )
set(ENV{CMAKE_PREFIX_PATH} "env_1:env_2" )
rapids_cmake_support_conda_env(conda_env_modify MODIFY_PREFIX_PATH)
if(NOT TARGET conda_env_modify)
message(FATAL_ERROR "Expected target conda_env_modify to exist")
endif()
list(LENGTH CMAKE_PREFIX_PATH len)
if( len GREATER 6)
message(FATAL_ERROR "CMAKE_PREFIX_PATH length is wrong after MODIFY_PREFIX_PATH")
endif()
list(GET CMAKE_PREFIX_PATH 0 first_value)
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)
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}")
foreach(correct actual IN ZIP_LISTS correct_list actual_list)
if(NOT correct STREQUAL actual)
message(STATUS "correct: ${correct}")
message(STATUS "actual: ${actual}")
message(FATAL_ERROR "MODIFY_PREFIX_PATH failed")
endif()
endforeach()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cmake/conda_env-build.cmake | #=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/support_conda_env.cmake)
set(ENV{CONDA_BUILD} "1")
set(ENV{BUILD_PREFIX} "/usr/local/build_prefix")
set(ENV{PREFIX} "/opt/local/prefix")
set(ENV{CONDA_PREFIX} "/opt/conda/prefix")
rapids_cmake_support_conda_env(conda_env)
if(NOT TARGET conda_env)
message(FATAL_ERROR "Expected target conda_env to exist")
endif()
get_target_property(include_dirs conda_env INTERFACE_INCLUDE_DIRECTORIES)
if( NOT "$ENV{BUILD_PREFIX}/include" IN_LIST include_dirs)
message(FATAL_ERROR "Expected env{BUILD_PREFIX} to be in the include dirs of `conda_env`")
endif()
if( NOT "$ENV{PREFIX}/include" IN_LIST include_dirs)
message(FATAL_ERROR "Expected env{PREFIX} to be in the include dirs of `conda_env`")
endif()
if("$ENV{CONDA_PREFIX}/include" IN_LIST include_dirs)
message(FATAL_ERROR "Not expected for env{CONDA_PREFIX} to be in the include dirs of `conda_env`")
endif()
get_target_property(link_dirs conda_env INTERFACE_LINK_DIRECTORIES)
if( NOT "$ENV{BUILD_PREFIX}/lib" IN_LIST link_dirs)
message(FATAL_ERROR "Expected env{BUILD_PREFIX} to be in the link dirs of `conda_env`")
endif()
if( NOT "$ENV{PREFIX}/lib" IN_LIST link_dirs)
message(FATAL_ERROR "Expected env{PREFIX} to be in the link dirs of `conda_env`")
endif()
if("$ENV{CONDA_PREFIX}/lib" IN_LIST link_dirs)
message(FATAL_ERROR "Not expected for env{CONDA_PREFIX} to be in the link dirs of `conda_env`")
endif()
get_target_property(link_options conda_env INTERFACE_LINK_OPTIONS)
message(STATUS "link_options: ${link_options}")
if( NOT "$<HOST_LINK:SHELL:LINKER:-rpath-link=$ENV{BUILD_PREFIX}/lib>" IN_LIST link_options)
message(FATAL_ERROR "Expected rpath-link=env{BUILD_PREFIX} to be in the link options of `conda_env`")
endif()
if( NOT "$<HOST_LINK:SHELL:LINKER:-rpath-link=$ENV{PREFIX}/lib>" IN_LIST link_options)
message(FATAL_ERROR "Expected rpath-link=env{PREFIX} to be in the link options of `conda_env`")
endif()
if("$<HOST_LINK:SHELL:LINKER:-rpath-link=$ENV{CONDA_PREFIX}/lib>" IN_LIST link_options)
message(FATAL_ERROR "Not expected for rpath-link=env{CONDA_PREFIX} to be in the link options of `conda_env`")
endif()
# No effect as the target already exists
set(before_call_value "${CMAKE_PREFIX_PATH}" )
rapids_cmake_support_conda_env(conda_env MODIFY_PREFIX_PATH)
if(NOT ("${before_call_value}" STREQUAL "${CMAKE_PREFIX_PATH}") )
message(FATAL_ERROR "Expected rapids_cmake_support_conda_env not to change CMAKE_PREFIX_PATH")
endif()
# New target being used, so this should modify CMAKE_PREFIX_PATH
set(CMAKE_PREFIX_PATH "placeholder" )
set(ENV{CMAKE_PREFIX_PATH} "env_1:env_2" )
rapids_cmake_support_conda_env(conda_env_modify MODIFY_PREFIX_PATH)
if(NOT TARGET conda_env_modify)
message(FATAL_ERROR "Expected target conda_env_modify to exist")
endif()
list(LENGTH CMAKE_PREFIX_PATH len)
if( len GREATER 5)
message(FATAL_ERROR "CMAKE_PREFIX_PATH length is wrong after MODIFY_PREFIX_PATH")
endif()
list(GET CMAKE_PREFIX_PATH 0 first_value)
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}")
foreach(correct actual IN ZIP_LISTS correct_list actual_list)
if(NOT correct STREQUAL actual)
message(STATUS "correct: ${correct}")
message(STATUS "actual: ${actual}")
message(FATAL_ERROR "MODIFY_PREFIX_PATH failed")
endif()
endforeach()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cmake/make_global-no-targets.cmake | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/make_global.cmake)
add_library(real_target UNKNOWN IMPORTED)
set(targets fake_target1_ real_target fake_target2_ )
rapids_cmake_make_global(targets)
get_target_property(is_global real_target IMPORTED_GLOBAL)
if(NOT is_global)
message(FATAL_ERROR "Expected is_global to be True [${is_global}]")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cmake/parse_version-major_minor-invalid.cmake | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/parse_version.cmake)
rapids_cmake_parse_version(MAJOR_MINOR "" major_minor)
if(DEFINED major_minor)
message(FATAL_ERROR "rapids_cmake_parse_version(MAJOR_MINOR) value parsing should have failed")
endif()
rapids_cmake_parse_version(MAJOR_MINOR "not-a-version" major_minor)
if(DEFINED major_minor)
message(FATAL_ERROR "rapids_cmake_parse_version(MAJOR_MINOR) value parsing failed unexpectedly")
endif()
rapids_cmake_parse_version(MAJOR_MINOR "100" major_minor)
if(DEFINED major_minor)
message(FATAL_ERROR "rapids_cmake_parse_version(MAJOR_MINOR) value parsing failed unexpectedly")
endif()
rapids_cmake_parse_version(MAJOR_MINOR "100." major_minor)
if(DEFINED major_minor)
message(FATAL_ERROR "rapids_cmake_parse_version(MAJOR_MINOR) value parsing failed unexpectedly")
endif()
rapids_cmake_parse_version(MAJOR_MINOR "100.." major_minor)
if(DEFINED major_minor)
message(FATAL_ERROR "rapids_cmake_parse_version(MAJOR_MINOR) value parsing failed unexpectedly")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cmake/build_type-user-specified.cmake | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/build_type.cmake)
set(CMAKE_BUILD_TYPE USER)
rapids_cmake_build_type(DEBUG)
if(NOT CMAKE_BUILD_TYPE STREQUAL "USER")
message(FATAL_ERROR "rapids_cmake_build_type overwrote user setting")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cmake/conda_env-prefix.cmake | #=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/support_conda_env.cmake)
set(ENV{CONDA_BUILD} "2")
set(ENV{BUILD_PREFIX} "/usr/local/build_prefix")
set(ENV{PREFIX} "/opt/local/prefix")
set(ENV{CONDA_PREFIX} "/opt/conda/prefix")
rapids_cmake_support_conda_env(conda_env)
get_target_property(include_dirs conda_env INTERFACE_INCLUDE_DIRECTORIES)
if( "$ENV{BUILD_PREFIX}/include" IN_LIST include_dirs)
message(FATAL_ERROR "Not expected env{BUILD_PREFIX} to be in the include dirs of `conda_env`")
endif()
if( "$ENV{PREFIX}/include" IN_LIST include_dirs)
message(FATAL_ERROR "Not expected env{PREFIX} to be in the include dirs of `conda_env`")
endif()
if( NOT "$ENV{CONDA_PREFIX}/include" IN_LIST include_dirs)
message(FATAL_ERROR "Expected for env{CONDA_PREFIX} to be in the include dirs of `conda_env`")
endif()
get_target_property(link_dirs conda_env INTERFACE_LINK_DIRECTORIES)
if( "$ENV{BUILD_PREFIX}/lib" IN_LIST link_dirs)
message(FATAL_ERROR "Not expected env{BUILD_PREFIX} to be in the link dirs of `conda_env`")
endif()
if( "$ENV{PREFIX}/lib" IN_LIST link_dirs)
message(FATAL_ERROR "Not expected env{PREFIX} to be in the link dirs of `conda_env`")
endif()
if( NOT "$ENV{CONDA_PREFIX}/lib" IN_LIST link_dirs)
message(FATAL_ERROR "Expected for env{CONDA_PREFIX} to be in the link dirs of `conda_env`")
endif()
get_target_property(link_options conda_env INTERFACE_LINK_OPTIONS)
if( "$<HOST_LINK:SHELL:LINKER:-rpath-link=$ENV{BUILD_PREFIX}/lib>" IN_LIST link_options)
message(FATAL_ERROR "Not expected rpath-link=env{BUILD_PREFIX} to be in the link options of `conda_env`")
endif()
if( "$<HOST_LINK:SHELL:LINKER:-rpath-link=$ENV{PREFIX}/lib>" IN_LIST link_options)
message(FATAL_ERROR "Not expected rpath-link=env{PREFIX} to be in the link options of `conda_env`")
endif()
if( NOT "$<HOST_LINK:SHELL:LINKER:-rpath-link=$ENV{CONDA_PREFIX}/lib>" IN_LIST link_options)
message(FATAL_ERROR "Expected for rpath-link=env{CONDA_PREFIX} to be in the link options of `conda_env`")
endif()
set(CMAKE_PREFIX_PATH "placeholder" )
set(ENV{CMAKE_PREFIX_PATH} "env_1:env_2" )
rapids_cmake_support_conda_env(conda_env_modify MODIFY_PREFIX_PATH)
if(NOT TARGET conda_env_modify)
message(FATAL_ERROR "Expected target conda_env_modify to exist")
endif()
list(LENGTH CMAKE_PREFIX_PATH len)
if( len GREATER 4)
message(FATAL_ERROR "CMAKE_PREFIX_PATH length is wrong after MODIFY_PREFIX_PATH")
endif()
list(GET CMAKE_PREFIX_PATH 0 first_value)
list(GET CMAKE_PREFIX_PATH 1 second_value)
list(GET CMAKE_PREFIX_PATH 2 third_value)
list(GET CMAKE_PREFIX_PATH 3 fourth_value)
set(correct_list "placeholder" "env_1" "env_2" "$ENV{CONDA_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)
message(FATAL_ERROR "MODIFY_PREFIX_PATH failed")
endif()
endforeach()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cmake/parse_version-major-valid.cmake | #=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/parse_version.cmake)
rapids_cmake_parse_version(MAJOR "not-a-version" major_value)
if(NOT major_value STREQUAL "not-a-version")
message(FATAL_ERROR "rapids_cmake_parse_version(MAJOR) value parsing failed unexpectedly")
endif()
rapids_cmake_parse_version(MAJOR "100" major_value)
if(NOT major_value EQUAL 100)
message(FATAL_ERROR "rapids_cmake_parse_version(MAJOR) value parsing failed unexpectedly")
endif()
rapids_cmake_parse_version(MAJOR "1.0.a.0" major_value)
if(NOT major_value EQUAL 1)
message(FATAL_ERROR "rapids_cmake_parse_version(MAJOR) value parsing failed unexpectedly")
endif()
rapids_cmake_parse_version(MAJOR "0.200.git-sha1" major_value)
if(NOT major_value EQUAL 0)
message(FATAL_ERROR "rapids_cmake_parse_version(MAJOR) value parsing failed unexpectedly")
endif()
rapids_cmake_parse_version(MAJOR "21.03.00...22.04.00" major_value)
if(NOT major_value EQUAL 21)
message(FATAL_ERROR "rapids_cmake_parse_version(MAJOR) value parsing failed unexpectedly")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cmake/build_type-multiple.cmake | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/build_type.cmake)
rapids_cmake_build_type(DEBUG)
rapids_cmake_build_type(RELEASE)
if(CMAKE_CONFIGURATION_TYPES)
if(DEFINED CMAKE_BUILD_TYPE)
message(FATAL_ERROR "rapids_cmake_build_type failed when executed by a multi-config generator")
endif()
elseif(NOT CMAKE_BUILD_TYPE STREQUAL "DEBUG")
message(FATAL_ERROR "rapids_cmake_build_type failed")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cmake/parse_version-major_minor-valid.cmake | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/parse_version.cmake)
rapids_cmake_parse_version(MAJOR_MINOR "1.a.0" major_minor)
if(NOT major_minor STREQUAL "1.a")
message(FATAL_ERROR "rapids_cmake_parse_version(MAJOR_MINOR) value parsing failed unexpectedly")
endif()
rapids_cmake_parse_version(MAJOR_MINOR "a_string.1" major_minor)
if(NOT major_minor STREQUAL "a_string.1")
message(FATAL_ERROR "rapids_cmake_parse_version(MAJOR_MINOR) value parsing failed unexpectedly")
endif()
rapids_cmake_parse_version(MAJOR_MINOR "0.200.git-sha1" major_minor)
if(NOT major_minor STREQUAL "0.200")
message(FATAL_ERROR "rapids_cmake_parse_version(MAJOR_MINOR) value parsing failed unexpectedly")
endif()
rapids_cmake_parse_version(MAJOR_MINOR "21.03.00...22.04.00" major_minor)
if(NOT major_minor STREQUAL "21.03")
message(FATAL_ERROR "rapids_cmake_parse_version(MAJOR_MINOR) value parsing failed unexpectedly")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cmake/install_lib_dir-no-conda.cmake | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/install_lib_dir.cmake)
unset(ENV{CONDA_BUILD})
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")
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")
endif()
# unset CMAKE_INSTALL_LIBDIR so it doesn't leak into our CMakeCache.txt and cause subsequent
# re-runs of the test to fail
unset(CMAKE_INSTALL_LIBDIR)
unset(CMAKE_INSTALL_LIBDIR CACHE)
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cmake/make_global-not-imported.cmake | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/make_global.cmake)
add_library(real_target INTERFACE)
set(targets real_target)
rapids_cmake_make_global(targets)
get_target_property(is_global real_target IMPORTED_GLOBAL)
if(is_global)
message(FATAL_ERROR "Expected is_global to be False [${is_global}]")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing/cmake | rapidsai_public_repos/rapids-cmake/testing/cmake/write_git_revision-embed/CMakeLists.txt | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/write_git_revision_file.cmake)
cmake_minimum_required(VERSION 3.23.1)
project(DEMO VERSION 2.4 LANGUAGES CXX)
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)
target_compile_features(embed_git_version PRIVATE cxx_std_14)
# verify that the git strings have been embedded.
find_package(Git QUIET)
add_custom_command(TARGET embed_git_version
POST_BUILD
COMMAND ${CMAKE_COMMAND}
-DWORKING_DIRECTORY=${CMAKE_CURRENT_SOURCE_DIR}
-DEXECUTABLE=$<TARGET_FILE:embed_git_version>
-DGIT_EXECUTABLE=${GIT_EXECUTABLE}
-P ${CMAKE_CURRENT_SOURCE_DIR}/verify_embedding.cmake)
| 0 |
rapidsai_public_repos/rapids-cmake/testing/cmake | rapidsai_public_repos/rapids-cmake/testing/cmake/write_git_revision-embed/verify_embedding.cmake | #=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
cmake_minimum_required(VERSION 3.23.1)
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 --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
)
if(NOT contents MATCHES "sha1=${RAPIDS_WRITE_SHA1}")
message(FATAL_ERROR "SHA1 not embedded")
endif()
if(NOT contents MATCHES "branch=${RAPIDS_WRITE_BRANCH}")
message(FATAL_ERROR "branch name not embedded")
endif()
if(NOT contents MATCHES "version=${RAPIDS_WRITE_VERSION}")
message(FATAL_ERROR "git version not embedded")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing/cmake | rapidsai_public_repos/rapids-cmake/testing/cmake/write_git_revision-embed/main.cpp | /*
* Copyright (c) 2021-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <git_version.hpp>
#include <iostream>
#include <type_traits>
constexpr const char* dbranch = "branch=" DEMO_GIT_BRANCH;
constexpr const char* dsha1 = "sha1=" DEMO_GIT_SHA1;
constexpr const char* dvers = "version=" DEMO_GIT_VERSION;
int main()
{
std::cout << dbranch << std::endl;
std::cout << dsha1 << std::endl;
std::cout << dvers << std::endl;
return 0;
}
| 0 |
rapidsai_public_repos/rapids-cmake/testing/cmake | rapidsai_public_repos/rapids-cmake/testing/cmake/write_git_revision-no-git/CMakeLists.txt | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/write_git_revision_file.cmake)
cmake_minimum_required(VERSION 3.23.1)
project(DEMO VERSION 2.4 LANGUAGES CXX)
add_subdirectory(gen_header)
add_executable(verify_no_git main.cpp)
target_link_libraries(verify_no_git PRIVATE git_generated_header)
target_compile_features(verify_no_git PRIVATE cxx_std_14)
| 0 |
rapidsai_public_repos/rapids-cmake/testing/cmake | rapidsai_public_repos/rapids-cmake/testing/cmake/write_git_revision-no-git/verify_embedding.cmake | #=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
cmake_minimum_required(VERSION 3.23.1)
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 --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
)
if(NOT contents MATCHES "sha1=${RAPIDS_WRITE_SHA1}")
message(FATAL_ERROR "SHA1 not embedded")
endif()
if(NOT contents MATCHES "branch=${RAPIDS_WRITE_BRANCH}")
message(FATAL_ERROR "branch name not embedded")
endif()
if(NOT contents MATCHES "version=${RAPIDS_WRITE_VERSION}")
message(FATAL_ERROR "git version not embedded")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing/cmake | rapidsai_public_repos/rapids-cmake/testing/cmake/write_git_revision-no-git/main.cpp | /*
* Copyright (c) 2021-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <git_version.hpp>
#include <iostream>
#include <type_traits>
constexpr const char* dbranch = DEMO_GIT_BRANCH;
constexpr const char* dsha1 = DEMO_GIT_SHA1;
constexpr const char* dvers = DEMO_GIT_VERSION;
int main()
{
static_assert(dbranch == "unknown");
static_assert(dsha1 == "unknown");
static_assert(dvers == "unknown");
#ifdef DEMO_GIT_IS_DIRTY
#error "DEMO_GIT_IS_DIRTY define shouldn't exist as git shouldn't have been found"
#endif
return 0;
}
| 0 |
rapidsai_public_repos/rapids-cmake/testing/cmake/write_git_revision-no-git | rapidsai_public_repos/rapids-cmake/testing/cmake/write_git_revision-no-git/gen_header/CMakeLists.txt | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/write_git_revision_file.cmake)
# Fake out GIT_EXECUTABLE with a stub so that all git commands
# fail, acting like what happens when 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")
| 0 |
rapidsai_public_repos/rapids-cmake/testing/cmake | rapidsai_public_repos/rapids-cmake/testing/cmake/write_version-all-zeroes/CMakeLists.txt | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/write_version_file.cmake)
cmake_minimum_required(VERSION 3.23.1)
project(DEMO VERSION 0.0000.1 LANGUAGES NONE)
rapids_cmake_write_version_file(version.h)
enable_language(CXX)
add_executable(write_version main.cpp)
target_include_directories(write_version PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")
target_compile_features(write_version PRIVATE cxx_std_14)
| 0 |
rapidsai_public_repos/rapids-cmake/testing/cmake | rapidsai_public_repos/rapids-cmake/testing/cmake/write_version-all-zeroes/main.cpp | /*
* Copyright (c) 2021, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <type_traits>
#include <version.h>
constexpr int dmajor = DEMO_VERSION_MAJOR;
constexpr int dminor = DEMO_VERSION_MINOR;
constexpr int dpatch = DEMO_VERSION_PATCH;
int main()
{
static_assert(dmajor == 0);
static_assert(dminor == 0);
static_assert(dpatch == 1);
return 0;
}
| 0 |
rapidsai_public_repos/rapids-cmake/testing/cmake | rapidsai_public_repos/rapids-cmake/testing/cmake/write_version-custom-prefix/CMakeLists.txt | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/write_version_file.cmake)
cmake_minimum_required(VERSION 3.23.1)
project(RandomProjectName VERSION 3.2.0 LANGUAGES NONE)
rapids_cmake_write_version_file(demo_version.hpp PREFIX DEMO)
rapids_cmake_write_version_file(nested_version.hpp PREFIX NESTED)
enable_language(CXX)
add_executable(write_version main.cpp)
target_include_directories(write_version PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")
target_compile_features(write_version PRIVATE cxx_std_14)
| 0 |
rapidsai_public_repos/rapids-cmake/testing/cmake | rapidsai_public_repos/rapids-cmake/testing/cmake/write_version-custom-prefix/main.cpp | /*
* Copyright (c) 2021-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <demo_version.hpp>
#include <nested_version.hpp>
#include <type_traits>
constexpr int dmajor = DEMO_VERSION_MAJOR;
constexpr int dminor = DEMO_VERSION_MINOR;
constexpr int dpatch = DEMO_VERSION_PATCH;
constexpr int nmajor = NESTED_VERSION_MAJOR;
constexpr int nminor = NESTED_VERSION_MINOR;
constexpr int npatch = NESTED_VERSION_PATCH;
int main()
{
static_assert(dmajor == 3);
static_assert(dminor == 2);
static_assert(dpatch == 0);
static_assert(nmajor == 3);
static_assert(nminor == 2);
static_assert(npatch == 0);
return 0;
}
| 0 |
rapidsai_public_repos/rapids-cmake/testing/cmake | rapidsai_public_repos/rapids-cmake/testing/cmake/write_version-leading-zeroes/CMakeLists.txt | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/write_version_file.cmake)
cmake_minimum_required(VERSION 3.23.1)
project(DEMO VERSION 09.00008.02 LANGUAGES NONE)
rapids_cmake_write_version_file(version.h)
enable_language(CXX)
add_executable(write_version main.cpp)
target_include_directories(write_version PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")
target_compile_features(write_version PRIVATE cxx_std_14)
| 0 |
rapidsai_public_repos/rapids-cmake/testing/cmake | rapidsai_public_repos/rapids-cmake/testing/cmake/write_version-leading-zeroes/main.cpp | /*
* Copyright (c) 2021, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <type_traits>
#include <version.h>
constexpr int dmajor = DEMO_VERSION_MAJOR;
constexpr int dminor = DEMO_VERSION_MINOR;
constexpr int dpatch = DEMO_VERSION_PATCH;
int main()
{
static_assert(dmajor == 9);
static_assert(dminor == 8);
static_assert(dpatch == 2);
return 0;
}
| 0 |
rapidsai_public_repos/rapids-cmake/testing/cmake | rapidsai_public_repos/rapids-cmake/testing/cmake/write_git_revision-simple/CMakeLists.txt | #=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/write_git_revision_file.cmake)
include(${rapids-cmake-dir}/export/export.cmake)
cmake_minimum_required(VERSION 3.23.1)
project(DEMO VERSION 2.4 LANGUAGES CXX)
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")
add_executable(write_git_version main.cpp)
target_link_libraries(write_git_version PRIVATE demo_version nested_version)
target_compile_features(write_git_version PRIVATE cxx_std_14)
install(TARGETS write_git_version EXPORT write_git)
rapids_export(BUILD DEMO
EXPORT_SET write_git
)
| 0 |
rapidsai_public_repos/rapids-cmake/testing/cmake | rapidsai_public_repos/rapids-cmake/testing/cmake/write_git_revision-simple/main.cpp | /*
* Copyright (c) 2021-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <demo_git_version.hpp>
#include <nested_git_version.h>
#include <type_traits>
constexpr const char* dbranch = DEMO_GIT_BRANCH;
constexpr const char* dsha1 = DEMO_GIT_SHA1;
constexpr const char* dvers = DEMO_GIT_VERSION;
#if defined(DEMO_GIT_IS_DIRTY)
constexpr const bool disdirty = true;
#else
constexpr const bool disdirty = false;
#endif
constexpr const char* nbranch = NESTED_GIT_BRANCH;
constexpr const char* nsha1 = NESTED_GIT_SHA1;
constexpr const char* nvers = DEMO_GIT_VERSION;
#if defined(NESTED_GIT_IS_DIRTY)
constexpr const bool nisdirty = true;
#else
constexpr const bool nisdirty = false;
#endif
int main()
{
static_assert(dbranch == nbranch);
static_assert(dsha1 == nsha1);
static_assert(disdirty == nisdirty);
static_assert(dvers == nvers);
return 0;
}
| 0 |
rapidsai_public_repos/rapids-cmake/testing/cmake | rapidsai_public_repos/rapids-cmake/testing/cmake/write_git_revision-dirty/CMakeLists.txt | #=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/write_git_revision_file.cmake)
cmake_minimum_required(VERSION 3.23.1)
project(DEMO VERSION 2.4 LANGUAGES CXX)
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
)
add_executable(is_dirty main.cpp)
target_link_libraries(is_dirty PRIVATE git_generated_header)
target_compile_features(is_dirty PRIVATE cxx_std_14)
if(RAPIDS_WRITE_VERSION MATCHES "dirty")
target_compile_definitions(is_dirty PRIVATE "-DIS_DIRTY")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing/cmake | rapidsai_public_repos/rapids-cmake/testing/cmake/write_git_revision-dirty/main.cpp | /*
* Copyright (c) 2021-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <git_version.hpp>
#include <iostream>
#include <type_traits>
int main()
{
#if defined(IS_DIRTY) && !defined(DEMO_GIT_IS_DIRTY)
#error "failed to encode dirty state correctly"
#endif
#if defined(DEMO_GIT_IS_DIRTY) && !defined(IS_DIRTY)
#error "failed to encode dirty state correctly"
#endif
return 0;
}
| 0 |
rapidsai_public_repos/rapids-cmake/testing/cmake | rapidsai_public_repos/rapids-cmake/testing/cmake/write_version-absolute/CMakeLists.txt | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/write_version_file.cmake)
cmake_minimum_required(VERSION 3.23.1)
project(DEMO VERSION 2.4 LANGUAGES NONE)
rapids_cmake_write_version_file("${CMAKE_CURRENT_BINARY_DIR}/demo/version.h")
project(NESTED VERSION 3.14.159 LANGUAGES NONE)
rapids_cmake_write_version_file("${CMAKE_CURRENT_BINARY_DIR}/nested/version.h")
enable_language(CXX)
add_executable(write_version main.cpp)
target_include_directories(write_version PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")
target_compile_features(write_version PRIVATE cxx_std_14)
| 0 |
rapidsai_public_repos/rapids-cmake/testing/cmake | rapidsai_public_repos/rapids-cmake/testing/cmake/write_version-absolute/main.cpp | /*
* Copyright (c) 2021-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <demo/version.h>
#include <nested/version.h>
#include <type_traits>
constexpr int dmajor = DEMO_VERSION_MAJOR;
constexpr int dminor = DEMO_VERSION_MINOR;
constexpr int dpatch = DEMO_VERSION_PATCH;
constexpr int nmajor = NESTED_VERSION_MAJOR;
constexpr int nminor = NESTED_VERSION_MINOR;
constexpr int npatch = NESTED_VERSION_PATCH;
int main()
{
static_assert(dmajor == 2);
static_assert(dminor == 4);
static_assert(dpatch == 0);
static_assert(nmajor == 3);
static_assert(nminor == 14);
static_assert(npatch == 159);
return 0;
}
| 0 |
rapidsai_public_repos/rapids-cmake/testing/cmake | rapidsai_public_repos/rapids-cmake/testing/cmake/write_git_revision-custom-prefix/CMakeLists.txt | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/write_git_revision_file.cmake)
cmake_minimum_required(VERSION 3.23.1)
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)
add_executable(write_git_version main.cpp)
target_link_libraries(write_git_version PRIVATE demo_version nested_version)
target_compile_features(write_git_version PRIVATE cxx_std_14)
| 0 |
rapidsai_public_repos/rapids-cmake/testing/cmake | rapidsai_public_repos/rapids-cmake/testing/cmake/write_git_revision-custom-prefix/main.cpp | /*
* Copyright (c) 2021-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <demo_git_version.hpp>
#include <nested_git_version.h>
#include <type_traits>
constexpr const char* dbranch = DEMO_GIT_BRANCH;
constexpr const char* dsha1 = DEMO_GIT_SHA1;
constexpr const char* dvers = DEMO_GIT_VERSION;
#if defined(DEMO_GIT_IS_DIRTY)
constexpr const bool disdirty = true;
#else
constexpr const bool disdirty = false;
#endif
constexpr const char* nbranch = NESTED_GIT_BRANCH;
constexpr const char* nsha1 = NESTED_GIT_SHA1;
constexpr const char* nvers = DEMO_GIT_VERSION;
#if defined(NESTED_GIT_IS_DIRTY)
constexpr const bool nisdirty = true;
#else
constexpr const bool nisdirty = false;
#endif
int main()
{
static_assert(dbranch == nbranch);
static_assert(dsha1 == nsha1);
static_assert(disdirty == nisdirty);
static_assert(dvers == nvers);
return 0;
}
| 0 |
rapidsai_public_repos/rapids-cmake/testing/cmake | rapidsai_public_repos/rapids-cmake/testing/cmake/write_version-relative/CMakeLists.txt | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cmake/write_version_file.cmake)
cmake_minimum_required(VERSION 3.23.1)
project(DEMO VERSION 3.2.0 LANGUAGES NONE)
rapids_cmake_write_version_file(demo_version.hpp)
project(NESTED VERSION 3.14.159 LANGUAGES NONE)
rapids_cmake_write_version_file(nested_version.hpp)
enable_language(CXX)
add_executable(write_version main.cpp)
target_include_directories(write_version PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")
target_compile_features(write_version PRIVATE cxx_std_14)
| 0 |
rapidsai_public_repos/rapids-cmake/testing/cmake | rapidsai_public_repos/rapids-cmake/testing/cmake/write_version-relative/main.cpp | /*
* Copyright (c) 2021-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <demo_version.hpp>
#include <nested_version.hpp>
#include <type_traits>
constexpr int dmajor = DEMO_VERSION_MAJOR;
constexpr int dminor = DEMO_VERSION_MINOR;
constexpr int dpatch = DEMO_VERSION_PATCH;
constexpr int nmajor = NESTED_VERSION_MAJOR;
constexpr int nminor = NESTED_VERSION_MINOR;
constexpr int npatch = NESTED_VERSION_PATCH;
int main()
{
static_assert(dmajor == 3);
static_assert(dminor == 2);
static_assert(dpatch == 0);
static_assert(nmajor == 3);
static_assert(nminor == 14);
static_assert(npatch == 159);
return 0;
}
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_gbench-export.cmake | #=============================================================================
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/gbench.cmake)
rapids_cpm_init()
rapids_cpm_gbench(BUILD_EXPORT_SET bench)
rapids_cpm_gbench(BUILD_EXPORT_SET bench2)
get_target_property(packages rapids_export_build_bench PACKAGE_NAMES)
if(NOT benchmark IN_LIST packages)
message(FATAL_ERROR "rapids_cpm_gbench failed to record benchmark needs to be exported")
endif()
get_target_property(packages rapids_export_build_bench2 PACKAGE_NAMES)
if(NOT benchmark IN_LIST packages)
message(FATAL_ERROR "rapids_cpm_gbench failed to record benchmark needs to be exported")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_nvcomp-simple.cmake | #=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/nvcomp.cmake)
rapids_cpm_init()
if(TARGET nvcomp::nvcomp)
message(FATAL_ERROR "Expected nvcomp::nvcomp not to exist")
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")
endif()
# Make sure we can be called multiple times
rapids_cpm_nvcomp()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_cuco-simple.cmake | #=============================================================================
# Copyright (c) 2022, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/cuco.cmake)
rapids_cpm_init()
if(TARGET cuco::cuco)
message(FATAL_ERROR "Expected cuco::cuco target not to exist")
endif()
rapids_cpm_cuco()
if(NOT TARGET cuco::cuco)
message(FATAL_ERROR "Expected cuco::cuco target to exist")
endif()
# Ensure that calls are idempotent.
rapids_cpm_cuco()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_libcudacxx-after_cpmfind.cmake | #=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/libcudacxx.cmake)
rapids_cpm_init()
include("${rapids-cmake-dir}/cpm/detail/package_details.cmake")
rapids_cpm_package_details(libcudacxx version repository tag shallow exclude)
include("${rapids-cmake-dir}/cpm/find.cmake")
rapids_cpm_find(libcudacxx ${version}
CPM_ARGS
GIT_REPOSITORY ${repository}
GIT_TAG ${tag}
GIT_SHALLOW ${shallow}
EXCLUDE_FROM_ALL ${exclude})
rapids_cpm_libcudacxx()
if(NOT TARGET libcudacxx::libcudacxx)
message(FATAL_ERROR "Expected libcudacxx::libcudacxx target to exist")
endif()
rapids_cpm_libcudacxx()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_spdlog-external-fmt.cmake | #=============================================================================
# Copyright (c) 2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/spdlog.cmake)
enable_language(CXX)
rapids_cpm_init()
rapids_cpm_spdlog(FMT_OPTION "EXTERNAL_FMT_HO")
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/use_external_fmt.cpp" [=[
#ifndef SPDLOG_FMT_EXTERNAL
#error "SPDLOG_FMT_EXTERNAL not defined"
#endif
]=])
add_library(spdlog_extern_fmt SHARED "${CMAKE_CURRENT_BINARY_DIR}/use_external_fmt.cpp")
target_link_libraries(spdlog_extern_fmt PRIVATE spdlog::spdlog)
add_library(spdlog-header-only_extern_fmt SHARED "${CMAKE_CURRENT_BINARY_DIR}/use_external_fmt.cpp")
target_link_libraries(spdlog-header-only_extern_fmt PRIVATE spdlog::spdlog_header_only)
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_spdlog-export.cmake | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/spdlog.cmake)
rapids_cpm_init()
rapids_cpm_spdlog(BUILD_EXPORT_SET frank INSTALL_EXPORT_SET test)
rapids_cpm_spdlog(INSTALL_EXPORT_SET test2)
get_target_property(packages rapids_export_install_test PACKAGE_NAMES)
if(NOT spdlog IN_LIST packages)
message(FATAL_ERROR "rapids_cpm_spdlog failed to record spdlog needs to be exported")
endif()
get_target_property(packages rapids_export_install_test2 PACKAGE_NAMES)
if(NOT spdlog IN_LIST packages)
message(FATAL_ERROR "rapids_cpm_spdlog failed to record spdlog needs to be exported")
endif()
get_target_property(packages rapids_export_build_frank PACKAGE_NAMES)
if(NOT spdlog IN_LIST packages)
message(FATAL_ERROR "rapids_cpm_spdlog failed to record spdlog needs to be exported")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_nvbench-conda.cmake | #=============================================================================
# Copyright (c) 2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/rmm.cmake)
include(${rapids-cmake-dir}/cpm/nvbench.cmake)
enable_language(CUDA)
enable_language(CXX)
include(${rapids-cmake-dir}/cuda/set_architectures.cmake)
rapids_cuda_set_architectures(RAPIDS)
# Make sure that nvbench can build static fmt from inside
# a conda env
set(ENV{CONDA_BUILD} "1")
set(ENV{BUILD_PREFIX} "/usr/local/build_prefix")
set(ENV{PREFIX} "/opt/local/prefix")
set(ENV{CONDA_PREFIX} "/opt/conda/prefix")
set(NVBench_ENABLE_CUPTI OFF)
rapids_cpm_init()
rapids_cpm_nvbench()
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/use_fmt.cpp" [=[
#include <nvbench/nvbench.cuh>
#include <cstdint>
template <typename Type>
void nvbench_distinct(nvbench::state& state, nvbench::type_list<Type>)
{
}
using data_type = nvbench::type_list<bool, int8_t, int32_t, int64_t, float>;
NVBENCH_BENCH_TYPES(nvbench_distinct, NVBENCH_TYPE_AXES(data_type))
.set_name("distinct")
.set_type_axes_names({"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)
target_compile_features(uses_fmt PRIVATE cxx_std_17)
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_gtest-static.cmake | #=============================================================================
# Copyright (c) 2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/gtest.cmake)
rapids_cpm_init()
if(TARGET GTest::gtest)
message(FATAL_ERROR "Expected GTest::gtest not to exist")
endif()
set(BUILD_SHARED_LIBS OFF)
rapids_cpm_gtest()
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/use_gtest.cpp" [=[
#include <gtest/gtest.h>
// The fixture for testing class Foo.
class FooTest : public testing::Test {
FooTest() {}
~FooTest() override { }
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)
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_init-override-simple.cmake | #=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
# Need to write out an override file
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json
[=[
{
"packages" : {
"nvbench" : {
"version" : "custom_version",
"git_url" : "my_url",
"git_tag" : "my_tag"
}
}
}
]=])
rapids_cpm_init(OVERRIDE "${CMAKE_CURRENT_BINARY_DIR}/override.json")
# Verify that the override works
include("${rapids-cmake-dir}/cpm/detail/package_details.cmake")
rapids_cpm_package_details(nvbench version repository tag shallow exclude)
if(NOT version STREQUAL "custom_version")
message(FATAL_ERROR "custom version field was ignored. ${version} found instead of custom_version")
endif()
if(NOT repository STREQUAL "my_url")
message(FATAL_ERROR "custom git_url field was ignored. ${repository} found instead of my_url")
endif()
if(NOT tag STREQUAL "my_tag")
message(FATAL_ERROR "custom git_tag field was ignored. ${tag} found instead of my_tag")
endif()
if(NOT DEFINED CPM_DOWNLOAD_ALL)
message(FATAL_ERROR "CPM_DOWNLOAD_ALL should be defined when an override exists")
endif()
if(NOT CPM_DOWNLOAD_ALL)
message(FATAL_ERROR "CPM_DOWNLOAD_ALL should be set to true when an override exists")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_thrust-export.cmake | #=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/thrust.cmake)
rapids_cpm_init()
rapids_cpm_thrust(NAMESPACE A BUILD_EXPORT_SET test)
rapids_cpm_thrust(NAMESPACE B INSTALL_EXPORT_SET test2)
get_target_property(packages rapids_export_build_test PACKAGE_NAMES)
if(NOT Thrust IN_LIST packages)
message(FATAL_ERROR "rapids_cpm_thrust failed to record thrust needs to be exported")
endif()
get_target_property(packages rapids_export_install_test2 PACKAGE_NAMES)
if(NOT Thrust IN_LIST packages)
message(FATAL_ERROR "rapids_cpm_thrust failed to record thrust needs to be exported")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_nvcomp-invalid-arch.cmake | #=============================================================================
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/nvcomp.cmake)
rapids_cpm_init()
if(TARGET nvcomp::nvcomp)
message(FATAL_ERROR "Expected nvcomp::nvcomp not to exist")
endif()
set(CMAKE_SYSTEM_PROCESSOR "i686") # Don't do this outside of tests
rapids_cpm_nvcomp(USE_PROPRIETARY_BINARY 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")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_package_override-bad-path.cmake | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/package_override.cmake)
rapids_cpm_init()
rapids_cpm_package_override(${CMAKE_CURRENT_LIST_DIR}/bad_path.cmake)
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_fmt-simple.cmake | #=============================================================================
# Copyright (c) 2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/fmt.cmake)
rapids_cpm_init()
if(TARGET fmt::fmt-header-only)
message(FATAL_ERROR "Expected fmt::fmt-header-only expected to not exist")
endif()
if(TARGET fmt::fmt)
message(FATAL_ERROR "Expected fmt::fmt expected to not exist")
endif()
rapids_cpm_fmt()
if(NOT TARGET fmt::fmt-header-only)
message(FATAL_ERROR "Expected fmt::fmt-header-only target to exist")
endif()
if(NOT TARGET fmt::fmt)
message(FATAL_ERROR "Expected fmt::fmt target to exist")
endif()
rapids_cpm_fmt()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_generate_patch_command-override.cmake | #=============================================================================
# Copyright (c) 2022, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/package_override.cmake)
include(${rapids-cmake-dir}/cpm/detail/generate_patch_command.cmake)
rapids_cpm_init()
rapids_cpm_generate_patch_command(pkg_with_patch 10.2 patch_command)
if(patch_command)
message(FATAL_ERROR "pkg_with_patch doesn't have override yet, patch_command should be empty")
endif()
# Need to write out an override file
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json
[=[
{
"packages" : {
"pkg_with_patch" : {
"version" : "10.2",
"git_tag" : "a_tag",
"git_shallow" : "OFF",
"exclude_from_all" : "ON",
"patches" : [
{
"file" : "e/example.diff",
"issue" : "explain",
"fixed_in" : ""
}
]
},
"pkg_patch_not_applied" : {
"version" : "10.2",
"git_tag" : "a_tag",
"git_shallow" : "OFF",
"exclude_from_all" : "ON",
"patches" : [
{
"file" : "e/example.diff",
"issue" : "explain",
"fixed_in" : "3"
}
]
}
}
}
]=])
rapids_cpm_package_override(${CMAKE_CURRENT_BINARY_DIR}/override.json)
rapids_cpm_generate_patch_command(pkg_with_patch 10.2 patch_command)
if(NOT patch_command)
message(FATAL_ERROR "rapids_cpm_package_override specified a patch step for `pkg_with_patch`")
endif()
unset(patch_command)
rapids_cpm_generate_patch_command(pkg_patch_not_applied 10.2 patch_command)
if(patch_command)
message(FATAL_ERROR "rapids_cpm_package_override patch step for `pkg_patch_not_applied` shouldn't apply due to version values")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_nvbench-conda-fmt.cmake | #=============================================================================
# Copyright (c) 2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/rmm.cmake)
include(${rapids-cmake-dir}/cpm/nvbench.cmake)
enable_language(CUDA)
enable_language(CXX)
include(${rapids-cmake-dir}/cuda/set_architectures.cmake)
rapids_cuda_set_architectures(RAPIDS)
# Force shared libs so that nvbench doesn't have a chance to use a static fmt
set(BUILD_SHARED_LIBS ON)
set(NVBench_ENABLE_CUPTI OFF)
rapids_cpm_init()
rapids_cpm_rmm()
rapids_cpm_nvbench()
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/use_fmt.cpp" [=[
#include <spdlog/spdlog.h>
#include <nvbench/nvbench.cuh>
template <typename Type>
void nvbench_distinct(nvbench::state& state, nvbench::type_list<Type>)
{
}
using data_type = nvbench::type_list<bool, int8_t, int32_t, int64_t, float>;
NVBENCH_BENCH_TYPES(nvbench_distinct, NVBENCH_TYPE_AXES(data_type))
.set_name("distinct")
.set_type_axes_names({"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 rmm::rmm nvbench::nvbench)
target_compile_features(uses_fmt PRIVATE cxx_std_17)
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_nvbench-explicit-static.cmake | #=============================================================================
# Copyright (c) 2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/nvbench.cmake)
rapids_cpm_init()
rapids_cpm_nvbench(BUILD_STATIC)
get_target_property(type nvbench TYPE)
if(NOT type STREQUAL STATIC_LIBRARY)
message(FATAL_ERROR "rapids_cpm_nvbench failed to get a static version of nvbench")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/rapids-cpm.cmake | #=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/rapids-cpm.cmake)
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/CMakeLists.txt | #=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
add_cmake_config_test( rapids-cpm.cmake )
add_cmake_config_test( cpm_find-add-pkg-source )
add_cmake_config_test( cpm_find-and-find_package )
add_cmake_config_test( cpm_find-components )
add_cmake_config_test( cpm_find-existing-build-dir )
add_cmake_config_test( cpm_find-existing-target )
add_cmake_config_test( cpm_find-existing-target-to-export-sets )
add_cmake_config_test( cpm_find-gtest-no-gmock )
add_cmake_config_test( cpm_find-options-escaped )
add_cmake_config_test( cpm_find-restore-cpm-vars )
add_cmake_config_test( cpm_find-version-explicit-install.cmake )
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-override-multiple.cmake )
add_cmake_config_test( cpm_init-override-simple.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-before-init.cmake )
add_cmake_config_test( cpm_package_override-empty.cmake )
add_cmake_config_test( cpm_package_override-multiple.cmake )
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-simple.cmake )
add_cmake_config_test( cpm_generate_patch_command-invalid.cmake )
add_cmake_config_test( cpm_generate_patch_command-override.cmake )
add_cmake_config_test( cpm_generate_patch_command-current_json_dir.cmake )
add_cmake_config_test( cpm_cuco-simple.cmake )
add_cmake_config_test( cpm_cuco-export.cmake )
add_cmake_config_test( cpm_cuco-libcudacxx-no-install-export.cmake )
add_cmake_config_test( cpm_fmt-export.cmake )
add_cmake_config_test( cpm_fmt-simple.cmake )
add_cmake_build_test( cpm_fmt-static-lib.cmake )
add_cmake_config_test( cpm_gbench-export.cmake )
add_cmake_config_test( cpm_gbench-simple.cmake )
add_cmake_config_test( cpm_gbench-explicit-static.cmake)
add_cmake_config_test( cpm_gtest-export.cmake )
add_cmake_config_test( cpm_gtest-simple.cmake )
add_cmake_config_test( cpm_gtest-static.cmake )
add_cmake_config_test( cpm_libcudacxx-after_cpmfind.cmake SERIAL)
add_cmake_config_test( cpm_libcudacxx-export.cmake )
add_cmake_config_test( cpm_libcudacxx-simple.cmake )
add_cmake_build_test( cpm_libcudacxx-verify-install-custom-libdir )
add_cmake_config_test( cpm_nvbench-export.cmake SERIAL)
add_cmake_config_test( cpm_nvbench-simple.cmake SERIAL)
add_cmake_config_test( cpm_nvbench-already-found-fmt.cmake SERIAL)
add_cmake_build_test( cpm_nvbench-conda.cmake SERIAL)
add_cmake_build_test( cpm_nvbench-conda-fmt.cmake SERIAL)
add_cmake_config_test( cpm_nvbench-explicit-static.cmake SERIAL)
add_cmake_config_test( cpm_nvcomp-export.cmake )
add_cmake_config_test( cpm_nvcomp-proprietary-off.cmake )
add_cmake_config_test( cpm_nvcomp-proprietary-on.cmake )
add_cmake_config_test( cpm_nvcomp-simple.cmake )
add_cmake_config_test( cpm_nvcomp-invalid-arch.cmake )
add_cmake_config_test( cpm_nvcomp-override-clears-proprietary_binary.cmake )
add_cmake_config_test( cpm_proprietary-url-ctk-version-find-ctk.cmake )
add_cmake_config_test( cpm_proprietary-url-ctk-version.cmake )
add_cmake_config_test( cpm_proprietary-url-no-ctk-parsing.cmake )
add_cmake_config_test( cpm_rmm-export.cmake )
add_cmake_config_test( cpm_rmm-simple.cmake )
add_cmake_build_test( cpm_spdlog-external-fmt.cmake )
add_cmake_config_test( cpm_spdlog-export.cmake )
add_cmake_config_test( cpm_spdlog-simple.cmake )
add_cmake_config_test( cpm_thrust-export.cmake )
add_cmake_config_test( cpm_thrust-simple.cmake )
add_cmake_build_test( cpm_thrust-verify-post-find-code )
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_generate_patch_command-invalid.cmake | #=============================================================================
# Copyright (c) 2022, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/detail/generate_patch_command.cmake)
rapids_cpm_generate_patch_command(not_a_project 1 patch_command)
if(patch_command)
message(FATAL_ERROR "not_a_project should not have a patch command")
endif()
rapids_cpm_init()
rapids_cpm_generate_patch_command(not_a_project 1 patch_command)
if(patch_command)
message(FATAL_ERROR "not_a_project should not have a patch command")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_nvcomp-override-clears-proprietary_binary.cmake | #=============================================================================
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/nvcomp.cmake)
include(${rapids-cmake-dir}/cpm/package_override.cmake)
rapids_cpm_init()
if(TARGET nvcomp::nvcomp)
message(FATAL_ERROR "Expected nvcomp::nvcomp not to exist")
endif()
# Need to write out an nvcomp override file
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json
[=[
{
"packages" : {
"nvcomp" : {
"version" : "224",
"git_url" : "https://github.com/NVIDIA/nvcomp.git",
}
}
}
]=])
rapids_cpm_package_override(${CMAKE_CURRENT_BINARY_DIR}/override.json)
#
rapids_cpm_nvcomp(USE_PROPRIETARY_BINARY ON)
if(nvcomp_proprietary_binary)
message(FATAL_ERROR "Ignored nvcomp override file and brought in the binary version")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_rmm-export.cmake | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/rmm.cmake)
rapids_cpm_init()
rapids_cpm_rmm(BUILD_EXPORT_SET frank INSTALL_EXPORT_SET test)
rapids_cpm_rmm(INSTALL_EXPORT_SET test2)
get_target_property(packages rapids_export_install_test PACKAGE_NAMES)
if(NOT rmm IN_LIST packages)
message(FATAL_ERROR "rapids_cpm_rmm failed to record rmm needs to be exported")
endif()
get_target_property(packages rapids_export_install_test2 PACKAGE_NAMES)
if(NOT rmm IN_LIST packages)
message(FATAL_ERROR "rapids_cpm_rmm failed to record rmm needs to be exported")
endif()
get_target_property(packages rapids_export_build_frank PACKAGE_NAMES)
if(NOT rmm IN_LIST packages)
message(FATAL_ERROR "rapids_cpm_rmm failed to record rmm needs to be exported")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_nvcomp-proprietary-off.cmake | #=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/nvcomp.cmake)
rapids_cpm_init()
if(TARGET nvcomp::nvcomp)
message(FATAL_ERROR "Expected nvcomp::nvcomp not to exist")
endif()
rapids_cpm_nvcomp(USE_PROPRIETARY_BINARY OFF)
if(nvcomp_proprietary_binary)
message(FATAL_ERROR "Ignored `USE_PROPRIETARY_BINARY OFF` and brought in the binary version")
endif()
# Make sure we can be called multiple times
rapids_cpm_nvcomp()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_cuco-export.cmake | #=============================================================================
# Copyright (c) 2022, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/cuco.cmake)
rapids_cpm_init()
rapids_cpm_cuco(BUILD_EXPORT_SET test_export_set)
get_target_property(packages rapids_export_build_test_export_set PACKAGE_NAMES)
if(NOT cuco IN_LIST packages)
message(FATAL_ERROR "rapids_cpm_cuco failed to record cuco needs to be exported")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_fmt-static-lib.cmake | #=============================================================================
# Copyright (c) 2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/fmt.cmake)
enable_language(CXX)
rapids_cpm_init()
set(CMAKE_BUILD_SHARED_LIBS OFF)
rapids_cpm_fmt()
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/use_fmt.cpp" [=[
#include <fmt/core.h>
std::string make_error_string() {
std::string expect = fmt::format("The answer is {:d}", "forty-two");
return expect;
}
]=])
add_library(uses_fmt SHARED "${CMAKE_CURRENT_BINARY_DIR}/use_fmt.cpp")
target_link_libraries(uses_fmt PRIVATE fmt::fmt)
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_nvbench-simple.cmake | #=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/nvbench.cmake)
rapids_cpm_init()
if(TARGET nvbench::nvbench)
message(FATAL_ERROR "Expected nvbench::nvbench not to exist")
endif()
rapids_cpm_nvbench()
set(targets_made nvbench::nvbench nvbench::main)
foreach(t IN LISTS targets_made)
if(NOT TARGET ${t})
message(FATAL_ERROR "Expected ${t} target to exist")
endif()
endforeach()
# Make sure we can be called multiple times
rapids_cpm_nvbench()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_spdlog-simple.cmake | #=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/spdlog.cmake)
rapids_cpm_init()
if(TARGET spdlog::spdlog_header_only)
message(FATAL_ERROR "Expected spdlog::spdlog_header_only not to exist")
endif()
rapids_cpm_spdlog()
if(NOT TARGET spdlog::spdlog_header_only)
message(FATAL_ERROR "Expected spdlog::spdlog_header_only target to exist")
endif()
rapids_cpm_spdlog()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_package_override-before-init.cmake | #=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
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
[=[
{
"packages" : {
"nvbench" : {
"version" : "custom_version",
"git_url" : "my_url2",
"git_tag" : "my_tag"
}
}
}
]=])
rapids_cpm_package_override(${CMAKE_CURRENT_BINARY_DIR}/simple_override.json)
rapids_cpm_init()
# Verify that the override works
include("${rapids-cmake-dir}/cpm/detail/package_details.cmake")
rapids_cpm_package_details(nvbench version repository tag shallow exclude)
if(NOT version STREQUAL "custom_version")
message(FATAL_ERROR "custom version field was ignored. ${version} found instead of custom_version")
endif()
if(NOT repository STREQUAL "my_url2")
message(FATAL_ERROR "custom git_url field was ignored. ${repository} found instead of my_url2")
endif()
if(NOT tag STREQUAL "my_tag")
message(FATAL_ERROR "custom git_tag field was ignored. ${tag} found instead of my_tag")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_init-bad-override-path.cmake | #=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
rapids_cpm_init(OVERRIDE ${CMAKE_CURRENT_LIST_DIR}/bad_path.cmake)
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_find-version-explicit-install.cmake | #=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/libcudacxx.cmake)
include(${rapids-cmake-dir}/cpm/thrust.cmake)
rapids_cpm_init()
rapids_cpm_thrust(NAMESPACE example:: INSTALL_EXPORT_SET example_export)
rapids_cpm_libcudacxx(INSTALL_EXPORT_SET example_export)
include("${rapids-cmake-dir}/cpm/detail/package_details.cmake")
rapids_cpm_package_details(libcudacxx libcudacxx_version repository tag shallow exclude)
rapids_cpm_package_details(Thrust thrust_version repository tag shallow exclude)
set(thrust_path "${CMAKE_BINARY_DIR}/rapids-cmake/example_export/install/package_Thrust.cmake")
set(libcudacxx_path "${CMAKE_BINARY_DIR}/rapids-cmake/example_export/install/package_libcudacxx.cmake")
file(READ "${libcudacxx_path}" contents)
message(STATUS "contents: ${contents}")
string(FIND "${contents}" "${libcudacxx}" is_found)
if(is_found EQUAL -1)
message(FATAL_ERROR "rapids_cpm_libcudacxx failed to generate a find_package configuration with version")
endif()
file(READ "${thrust_path}" contents)
string(FIND "${contents}" "${thrust_version}" is_found)
if(is_found EQUAL -1)
message(FATAL_ERROR "rapids_cpm_thrust failed to generate a find_package configuration with version")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_nvcomp-export.cmake | #=============================================================================
# Copyright (c) 2022, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/nvcomp.cmake)
rapids_cpm_init()
rapids_cpm_nvcomp(BUILD_EXPORT_SET test)
rapids_cpm_nvcomp(BUILD_EXPORT_SET test2)
get_target_property(packages rapids_export_build_test PACKAGE_NAMES)
if(NOT nvcomp IN_LIST packages)
message(FATAL_ERROR "rapids_cpm_nvcomp failed to record nvcomp needs to be exported")
endif()
get_target_property(packages rapids_export_build_test2 PACKAGE_NAMES)
if(NOT nvcomp IN_LIST packages)
message(FATAL_ERROR "rapids_cpm_nvcomp failed to record nvcomp needs to be exported")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_nvbench-already-found-fmt.cmake | #=============================================================================
# Copyright (c) 2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/nvbench.cmake)
# Fake bring in fmt via find package
add_library(fmt::fmt INTERFACE IMPORTED GLOBAL)
rapids_cpm_init()
rapids_cpm_nvbench()
if(fmt_ADDED)
message(FATAL_ERROR "fmt shouldn't be added if it exists via `find_package`")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_nvcomp-proprietary-on.cmake | #=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/nvcomp.cmake)
rapids_cpm_init()
if(TARGET nvcomp::nvcomp)
message(FATAL_ERROR "Expected nvcomp::nvcomp not to exist")
endif()
rapids_cpm_nvcomp(USE_PROPRIETARY_BINARY ON)
if(NOT nvcomp_proprietary_binary)
message(FATAL_ERROR "Expected nvcomp::nvcomp target to exist")
endif()
# Make sure CUDA::cudart_static isn't in the interface link lines
get_target_property(libs nvcomp::nvcomp INTERFACE_LINK_LIBRARIES)
if("CUDA::cudart_static" IN_LIST libs)
message(FATAL_ERROR "nvcomp::nvcomp shouldn't link to CUDA::cudart_static")
endif()
# Make sure we can be called multiple times
rapids_cpm_nvcomp()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_proprietary-url-ctk-version-find-ctk.cmake | #=============================================================================
# Copyright (c) 2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/package_override.cmake)
include(${rapids-cmake-dir}/cpm/detail/get_proprietary_binary_url.cmake)
include(${rapids-cmake-dir}/cpm/detail/package_details.cmake)
rapids_cpm_init()
# Need to write out an override file with a proprietary blob url
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json
[=[
{
"packages" : {
"test_binary" : {
"version" : "2.6.1",
"proprietary_binary" : {
"x86_64-linux" : "https://fake.url.com/${version}/${cuda-toolkit-version}/x86_64_${cuda-toolkit-version-major}.tgz",
"aarch64-linux" : "https://fake.url.com/${version}/${cuda-toolkit-version}/aarch64_${cuda-toolkit-version-major}.tgz",
}
}
}
}
]=])
rapids_cpm_package_override(${CMAKE_CURRENT_BINARY_DIR}/override.json)
# Verify that the placeholders are evaluated correctly from `enable_language(CUDA)`
rapids_cpm_package_details(test_binary version repository tag shallow exclude)
rapids_cpm_get_proprietary_binary_url(test_binary ${version} url)
find_package(CUDAToolkit)
set(CTK_VER ${CUDAToolkit_VERSION_MAJOR}.${CUDAToolkit_VERSION_MINOR})
set(CTK_VER_M ${CUDAToolkit_VERSION_MAJOR})
set(valid_url "https://fake.url.com/2.6.1/${CTK_VER}/${CMAKE_SYSTEM_PROCESSOR}_${CTK_VER_M}.tgz")
if(NOT valid_url STREQUAL url)
message(FATAL_ERROR "Expected: ${valid_url} got: ${url}")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_thrust-simple.cmake | #=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/thrust.cmake)
rapids_cpm_init()
if(TARGET test::Thrust)
message(FATAL_ERROR "Expected test::Thrust not to exist")
endif()
rapids_cpm_thrust(NAMESPACE test)
if(NOT TARGET test::Thrust)
message(FATAL_ERROR "Expected test::Thrust target to exist")
endif()
rapids_cpm_thrust(NAMESPACE test)
rapids_cpm_thrust(NAMESPACE test2)
if(NOT TARGET test2::Thrust)
message(FATAL_ERROR "Expected test2::Thrust target to exist")
endif()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_libcudacxx-simple.cmake | #=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/libcudacxx.cmake)
rapids_cpm_init()
if(TARGET libcudacxx::libcudacxx)
message(FATAL_ERROR "Expected libcudacxx::libcudacxx not to exist")
endif()
rapids_cpm_libcudacxx()
if(NOT TARGET libcudacxx::libcudacxx)
message(FATAL_ERROR "Expected libcudacxx::libcudacxx target to exist")
endif()
rapids_cpm_libcudacxx()
| 0 |
rapidsai_public_repos/rapids-cmake/testing | rapidsai_public_repos/rapids-cmake/testing/cpm/cpm_gbench-explicit-static.cmake | #=============================================================================
# Copyright (c) 2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/gbench.cmake)
rapids_cpm_init()
rapids_cpm_gbench(BUILD_STATIC)
get_target_property(type benchmark TYPE)
if(NOT type STREQUAL STATIC_LIBRARY)
message(FATAL_ERROR "rapids_cpm_gbench failed to get a static version of gbench")
endif()
| 0 |