Warning, /acts/Detray/tests/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 # This file is part of the ACTS project.
0002 #
0003 # Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 #
0005 # This Source Code Form is subject to the terms of the Mozilla Public
0006 # License, v. 2.0. If a copy of the MPL was not distributed with this
0007 # file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008
0009 # Set the common C++ flags.
0010 include(detray-compiler-options-cpp)
0011
0012 include_directories(
0013 SYSTEM
0014 $<TARGET_PROPERTY:covfie::core,INTERFACE_INCLUDE_DIRECTORIES>
0015 )
0016
0017 # Detray unit and integration test framework (depends on google test)
0018 if(DETRAY_BUILD_TESTING)
0019 message(STATUS "Building 'detray::test_framework' component")
0020
0021 file(
0022 GLOB _detray_test_headers
0023 RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
0024 "include/detray/test/framework/*.hpp"
0025 )
0026
0027 add_library(detray_test_framework INTERFACE "${_detray_test_headers}")
0028 add_library(detray::test_framework ALIAS detray_test_framework)
0029
0030 target_include_directories(
0031 detray_test_framework
0032 INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include"
0033 )
0034
0035 target_link_libraries(
0036 detray_test_framework
0037 INTERFACE GTest::gtest vecmem::core detray::core detray::detectors
0038 )
0039
0040 unset(_detray_test_headers)
0041 endif()
0042
0043 # Common test dependencies such as test detectors, B-fields and track generators
0044 # (depends on covfie)
0045 if(DETRAY_BUILD_TEST_UTILS OR DETRAY_BUILD_BENCHMARKS)
0046 message(STATUS "Building 'detray::test_common' component")
0047
0048 file(
0049 GLOB _detray_test_common_headers
0050 RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
0051 "include/detray/test/common/*.hpp"
0052 "include/detray/test/common/factories/*.hpp"
0053 "include/detray/test/common/event_generator/*.hpp"
0054 )
0055
0056 detray_add_library(detray_test_common test_common "${_detray_test_common_headers}")
0057
0058 target_link_libraries(
0059 detray_test_common
0060 INTERFACE vecmem::core covfie::core detray::core detray::detectors
0061 )
0062
0063 unset(_detray_test_common_headers)
0064 endif()
0065
0066 # Lightweight test utils library without external dependencies
0067 if(DETRAY_BUILD_TEST_UTILS OR DETRAY_BUILD_VALIDATION_TOOLS)
0068 message(STATUS "Building 'detray::test_utils' component")
0069
0070 file(
0071 GLOB _detray_test_utils_headers
0072 RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
0073 "include/detray/test/utils/*.hpp"
0074 )
0075
0076 detray_add_library(detray_test_utils test_utils ${_detray_test_utils_headers})
0077
0078 target_link_libraries(detray_test_utils INTERFACE vecmem::core detray::core)
0079
0080 unset(_detray_test_utils_headers)
0081 endif()
0082
0083 # Build extended validation tools (actsvg and csv dependencies)
0084 if(DETRAY_BUILD_VALIDATION_TOOLS)
0085 message(STATUS "Building 'detray::validation_utils' component")
0086
0087 file(
0088 GLOB _detray_validation_headers
0089 RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
0090 "include/detray/test/validation/*.hpp"
0091 )
0092
0093 detray_add_library(detray_validation_utils validation_utils ${_detray_validation_headers})
0094
0095 target_link_libraries(
0096 detray_validation_utils
0097 INTERFACE
0098 vecmem::core
0099 detray::core
0100 detray::test_utils
0101 detray::csv_io
0102 detray::svgtools
0103 )
0104
0105 unset(_detray_validation_headers)
0106 endif()
0107
0108 # Include all of the code-holding sub-directories.
0109
0110 # Build the benchmarks
0111 if(DETRAY_BUILD_BENCHMARKS)
0112 add_subdirectory(benchmarks)
0113 endif()
0114
0115 # Build test executables
0116 if(DETRAY_BUILD_TESTING)
0117 # Build host and device specific test code
0118 add_subdirectory(include/detray/test/cpu)
0119
0120 if(DETRAY_BUILD_CUDA OR DETRAY_BUILD_HIP OR DETRAY_BUILD_SYCL)
0121 add_subdirectory(include/detray/test/device)
0122 endif()
0123
0124 # Build the unittests
0125 if(DETRAY_BUILD_UNITTESTS)
0126 add_subdirectory(unit_tests)
0127 endif()
0128
0129 # Build the integration tests
0130 if(DETRAY_BUILD_INTEGRATIONTESTS)
0131 add_subdirectory(integration_tests)
0132 endif()
0133 endif()
0134
0135 # Build the command line tools (also required for the host jacobian
0136 # validation integration test)
0137 if(
0138 (DETRAY_BUILD_INTEGRATIONTESTS AND DETRAY_BUILD_HOST)
0139 OR DETRAY_BUILD_CLI_TOOLS
0140 )
0141 add_subdirectory(tools)
0142 endif()