Remove official install test and example cmake folder
DELETE
examples/cmake/CMakeLists.txt
-thrust_update_system_found_flags()
-
-if (THRUST_CPP_FOUND AND THRUST_CUDA_FOUND)
- # Do a basic check of the cmake/ThrustAddSubdir.cmake mechanism:
- add_test(
- NAME thrust.example.cmake.add_subdir
- COMMAND "${CMAKE_COMMAND}"
- --log-level=VERBOSE
- -G "${CMAKE_GENERATOR}"
- -S "${CMAKE_CURRENT_SOURCE_DIR}/add_subdir"
- -B "${CMAKE_CURRENT_BINARY_DIR}/add_subdir"
- -D "THRUST_ROOT=${Thrust_SOURCE_DIR}"
- -D "CMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
- -D "CMAKE_CUDA_COMPILER=${CMAKE_CUDA_COMPILER}"
- -D "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
- )
-endif()

DELETE
examples/cmake/add_subdir/CMakeLists.txt
-# This example demonstrates / tests adding thrust via a CMake add_subdirectory
-# call from a parent project.
-#
-# The variables THRUST_REQUIRED_SYSTEMS and THRUST_OPTIONAL_SYSTEMS must be
-# set prior to add_subdirectory(thrust), and afterwards the thrust_create_target
-# function may be used to create targets with the desired systems. See
-# NVIDIA/thrust/cmake/README.md for more details on thrust_create_target.
-
-cmake_minimum_required(VERSION 3.15)
-
-# Silence warnings about empty CUDA_ARCHITECTURES properties on example targets:
-if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.18)
- cmake_policy(SET CMP0104 OLD)
-endif()
-
-project(ThrustAddSubDirExample CXX)
-
-# Add required Thrust systems to THRUST_REQUIRED_SYSTEMS.
-# Options are: CPP, CUDA, TBB or OMP.
-# Multiple systems may be specified.
-# An error is emitted if the system is not found.
-set(THRUST_REQUIRED_SYSTEMS CPP)
-
-# Add optional Thrust systems to THRUST_OPTIONAL_SYSTEMS.
-# Options are: CPP, CUDA, TBB or OMP.
-# Multiple systems may be specified.
-# No error is emitted if not found.
-set(THRUST_OPTIONAL_SYSTEMS CUDA)
-
-# Use your project's checkout of Thrust here, for most cases
-# `add_subdirectory(thrust)` will be sufficient.
-add_subdirectory("${THRUST_ROOT}" thrust)
-
-# Create a thrust target that only uses the serial CPP backend.
-# See thrust/thrust/cmake/README.md for details and additional options:
-thrust_create_target(ThrustCPP HOST CPP DEVICE CPP)
-
-# Create an executable that uses the CPP-only thrust target:
-add_executable(ExecWithCPP dummy.cpp)
-target_link_libraries(ExecWithCPP ThrustCPP)
-
-# To test for optional systems, first call thrust_update_system_found_flags to
-# set the THRUST_${system}_FOUND flags in current scope.
-# Required due to CMake scoping rules.
-thrust_update_system_found_flags()
-
-# Create and use a Thrust target configured to use CUDA acceleration if CUDA
-# is available:
-if (THRUST_CUDA_FOUND)
- enable_language(CUDA)
- thrust_create_target(ThrustCUDA HOST CPP DEVICE CUDA)
- add_executable(ExecWithCUDA dummy.cu)
- target_link_libraries(ExecWithCUDA ThrustCUDA)
-endif()
-
-#
-# Validation
-#
-
-function(assert_boolean var_name expect)
- if (expect)
- if (NOT ${var_name})
- message(FATAL_ERROR "'${var_name}' is false, expected true.")
- endif()
- else()
- if (${var_name})
- message(FATAL_ERROR "'${var_name}' is true, expected false.")
- endif()
- endif()
-endfunction()
-
-function(assert_target target_name)
- if (NOT TARGET "${target_name}")
- message(FATAL_ERROR "Target '${target_name}' not defined.")
- endif()
-endfunction()
-
-assert_boolean(THRUST_CPP_FOUND TRUE)
-assert_boolean(THRUST_CUDA_FOUND TRUE)
-assert_boolean(THRUST_OMP_FOUND FALSE)
-assert_boolean(THRUST_TBB_FOUND FALSE)
-
-assert_target(ThrustCPP)
-assert_target(ThrustCUDA)
-assert_target(ExecWithCPP)
-assert_target(ExecWithCUDA)
-
-thrust_debug_target(ThrustCPP "")
-thrust_debug_target(ThrustCUDA "")
-thrust_debug_target(ExecWithCPP "")
-thrust_debug_target(ExecWithCUDA "")

DELETE
examples/cmake/add_subdir/dummy.cpp
-#include <thrust/detail/config.h>
-
-#include <iostream>
-
-int main()
-{
- std::cout << "Hello from Thrust version " << THRUST_VERSION << ":\n"
-
- << "Host system: "
-#if THRUST_HOST_SYSTEM == THRUST_HOST_SYSTEM_CPP
- << "CPP\n"
-#elif THRUST_HOST_SYSTEM == THRUST_HOST_SYSTEM_OMP
- << "OMP\n"
-#elif THRUST_HOST_SYSTEM == THRUST_HOST_SYSTEM_TBB
- << "TBB\n"
-#else
- << "Unknown\n"
-#endif
-
- << "Device system: "
-#if THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_CPP
- << "CPP\n";
-#elif THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_CUDA
- << "CUDA\n";
-#elif THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_HIP
- << "HIP\n";
-#elif THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_OMP
- << "OMP\n";
-#elif THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_TBB
- << "TBB\n";
-#else
- << "Unknown\n";
-#endif
-}

DELETE
examples/cmake/add_subdir/dummy.cu
-#include "dummy.cpp"

DELETE
testing/cmake/CMakeLists.txt
-thrust_update_system_found_flags()
-
-if (THRUST_CPP_FOUND AND THRUST_CUDA_FOUND)
- # Test that we can use `find_package` on an installed Thrust:
- add_test(
- NAME thrust.test.cmake.test_install
- COMMAND "${CMAKE_COMMAND}"
- --log-level=VERBOSE
- -G "${CMAKE_GENERATOR}"
- -S "${CMAKE_CURRENT_SOURCE_DIR}/test_install"
- -B "${CMAKE_CURRENT_BINARY_DIR}/test_install"
- -D "THRUST_BINARY_DIR=${Thrust_BINARY_DIR}"
- -D "CMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
- -D "CMAKE_CUDA_COMPILER=${CMAKE_CUDA_COMPILER}"
- -D "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
- )
-endif()

DELETE
testing/cmake/test_install/CMakeLists.txt
-# Test that an installation of the project can be located by find_package() call
-# with appropriate prefix settings.
-#
-# Expects THRUST_BINARY_DIR to be set to an existing thrust build directory.
-
-cmake_minimum_required(VERSION 3.15)
-
-project(ThrustTestInstall CXX CUDA)
-
-# This will eventually get deleted recursively -- keep that in mind if modifying
-set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/install_prefix/")
-
-function(do_manual_install)
- # Inspired by the VTK-m install tests, we can just glob up all of the
- # cmake_install.cmake, include (ie. run) them, and they'll effectively
- # install the project into the current value of CMAKE_INSTALL_PREFIX.
-
- # Gather all of the install files from Thrust's root:
- file(GLOB_RECURSE install_files
- LIST_DIRECTORIES False
- "${THRUST_BINARY_DIR}/cmake_install.cmake"
- )
-
- message(STATUS "Locating install files...")
- foreach (install_file IN LISTS install_files)
- message(STATUS " * ${install_file}")
- endforeach()
-
- message(STATUS "Building install tree...")
- foreach(install_file IN LISTS install_files)
- include("${install_file}")
- endforeach()
-endfunction()
-
-function(do_cleanup)
- message(STATUS "Removing ${CMAKE_INSTALL_PREFIX}")
- file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}")
-endfunction()
-
-function(assert_boolean var_name expect)
- if (expect)
- if (NOT ${var_name})
- message(FATAL_ERROR "'${var_name}' is false, expected true.")
- endif()
- else()
- if (${var_name})
- message(FATAL_ERROR "'${var_name}' is true, expected false.")
- endif()
- endif()
-endfunction()
-
-function(assert_target target_name)
- if (NOT TARGET "${target_name}")
- message(FATAL_ERROR "Target '${target_name}' not defined.")
- endif()
-endfunction()
-
-function(find_installed_project)
- set(CMAKE_PREFIX_PATH "${CMAKE_INSTALL_PREFIX}")
- find_package(Thrust CONFIG COMPONENTS CPP CUDA)
-
- if (NOT Thrust_FOUND)
- message(FATAL_ERROR
- "find_package(Thrust) failed. "
- "CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}"
- )
- endif()
-
- # Test some internal config vars to check that this is the expected install:
- # TODO The cmake_path (3.19) command will provide more robust ways to do this
-
- # Escape regex special characters in the install prefix, see
- # https://gitlab.kitware.com/cmake/cmake/-/issues/18580
- string(REGEX REPLACE "([][+.*()^])" "\\\\\\1"
- prefix_regex
- "${CMAKE_INSTALL_PREFIX}"
- )
- if (NOT _THRUST_INCLUDE_DIR MATCHES "^${prefix_regex}")
- message(FATAL_ERROR
- "Found Thrust in unexpected location: "
- " * _THRUST_INCLUDE_DIR=${_THRUST_INCLUDE_DIR} "
- " * ExpectedPrefix=${CMAKE_INSTALL_DIR}"
- )
- endif()
- if (NOT _CUB_INCLUDE_DIR MATCHES "^${prefix_regex}")
- message(FATAL_ERROR
- "Found CUB in unexpected location: "
- " * _CUB_INCLUDE_DIR=${_CUB_INCLUDE_DIR} "
- " * ExpectedPrefix=${CMAKE_INSTALL_DIR}"
- )
- endif()
-
- thrust_create_target(Thrust)
- assert_target(Thrust)
- assert_target(CUB::CUB)
- assert_target(Thrust::CPP::Host)
- assert_target(Thrust::CUDA::Device)
-
- thrust_update_system_found_flags()
- assert_boolean(THRUST_CPP_FOUND TRUE)
- assert_boolean(THRUST_CUDA_FOUND TRUE)
- assert_boolean(THRUST_OMP_FOUND FALSE)
- assert_boolean(THRUST_TBB_FOUND FALSE)
-
-endfunction()
-
-do_cleanup() # Prepare for new installation
-do_manual_install()
-find_installed_project()
-do_cleanup() # Clean up if successful

Remove official install test and example cmake folder