Skip to content

Commit b6a1e3f

Browse files
committed
Adapt the cmake
1 parent 9558ecd commit b6a1e3f

File tree

3 files changed

+25
-5
lines changed

3 files changed

+25
-5
lines changed

CMakeLists.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,19 @@ endif()
8787
# In order to generate specializations for our kernels, we need to have both
8888
# a working Python interpreter, and a list of supported detectors.
8989
find_package (Python COMPONENTS Interpreter REQUIRED)
90-
set(TRACCC_SUPPORTED_DETECTORS "default_detector;telescope_detector;toy_detector;itk_detector;odd_detector")
90+
91+
# Need at least one detector type
92+
if (NOT TRACCC_SUPPORTED_DETECTORS OR TRACCC_BUILD_EXAMPLES)
93+
list(APPEND TRACCC_SUPPORTED_DETECTORS default_detector)
94+
endif()
95+
96+
# Add the test detector types (default_detector is used for wire chamber)
97+
if (TRACCC_BUILD_TESTING)
98+
list(APPEND TRACCC_SUPPORTED_DETECTORS default_detector;telescope_detector;toy_detector;odd_detector)
99+
endif()
100+
101+
list(REMOVE_DUPLICATES TRACCC_SUPPORTED_DETECTORS)
102+
list(JOIN TRACCC_SUPPORTED_DETECTORS ", " TRACCC_METADATA_LIST)
91103

92104
# Set up build profiling for the project.
93105
if( CTEST_USE_LAUNCHERS )

core/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,7 @@ target_compile_definitions( traccc_core
148148
# Set the algebra-plugins plugin to use.
149149
message(STATUS "Building with plugin type: " ${TRACCC_ALGEBRA_PLUGINS})
150150
target_compile_definitions(traccc_core PUBLIC ALGEBRA_PLUGINS_INCLUDE_${TRACCC_ALGEBRA_PLUGINS})
151+
152+
# Define the detector types to be built
153+
message(STATUS "Building with detector types: " ${TRACCC_METADATA_LIST})
154+
#target_compile_definitions(traccc_core PUBLIC TRACCC_METADATA_LIST=${TRACCC_METADATA_LIST})

core/include/traccc/geometry/detector.hpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ concept is_detector_traits = requires {
7777
typename T::buffer;
7878
};
7979

80-
/// Default detector (also used for ODD)
80+
/// Default detector (Can hold the data of any detector)
8181
using default_detector =
8282
detector_traits<detray::default_metadata<traccc::default_algebra>>;
8383

@@ -93,10 +93,14 @@ using toy_detector =
9393
using itk_detector =
9494
detector_traits<detray::itk_metadata<traccc::default_algebra>>;
9595

96-
/// ITk detector
96+
/// ODD detector
9797
using odd_detector =
9898
detector_traits<detray::odd_metadata<traccc::default_algebra>>;
9999

100-
using detector_type_list = std::tuple<default_detector, telescope_detector,
101-
itk_detector, odd_detector>;
100+
// The metadata list is generated during build configuration
101+
// using detector_type_list = std::tuple<TRACCC_METADATA_LIST>;
102+
103+
using detector_type_list = std::tuple<default_detector, toy_detector,
104+
telescope_detector, odd_detector>;
105+
102106
} // namespace traccc

0 commit comments

Comments
 (0)