@@ -45,6 +45,7 @@ celeritas_optional_package(DD4hep "Enable DD4hep integration")
4545option (CELERITAS_USE_Perfetto "Perfetto tracing library" OFF )
4646
4747# Components
48+ option (CELERITAS_BUILD_APPS "Build Celeritas executables (strongly recommended)" ON )
4849option (CELERITAS_BUILD_DOCS "Build Celeritas documentation" OFF )
4950option (CELERITAS_BUILD_TESTS "Build Celeritas unit tests" OFF )
5051
@@ -84,6 +85,10 @@ if(CELERITAS_BUILD_TESTS)
8485 mark_as_advanced (CELERITAS_TEST_XML)
8586endif ()
8687
88+ # Automatic options
89+ set (CELERITAS_USE_CLI11 ${CELERITAS_BUILD_APPS} )
90+ set (CELERITAS_USE_GTest ${CELERITAS_BUILD_TESTS} )
91+
8792#----------------------------------------------------------------------------#
8893# CELERITAS CORE IMPLEMENTATION OPTIONS
8994#----------------------------------------------------------------------------#
@@ -284,7 +289,9 @@ set(CELERITAS_RUNTIME_OUTPUT_DIRECTORY
284289
285290include (CeleritasUtils)
286291
287- celeritas_find_or_builtin_package(CLI11 2.4)
292+ if (CELERITAS_USE_CLI11)
293+ celeritas_find_or_builtin_package(CLI11 2.4)
294+ endif ()
288295
289296if (BUILD_TESTING)
290297 # Build the test tree for unit and/or app tests
@@ -311,6 +318,10 @@ elseif(CELERITAS_USE_HIP)
311318 OFF
312319 )
313320 endif ()
321+ find_library (ROCTX_LIBRARY roctx64)
322+ if (ROCTX_LIBRARY)
323+ set (CELERITAS_HAVE_ROCTX ON )
324+ endif ()
314325endif ()
315326
316327if (CELERITAS_USE_CUDA)
@@ -340,7 +351,6 @@ if(CELERITAS_USE_DD4hep)
340351 find_package (DD4hep 1.18 REQUIRED COMPONENTS DDCore DDG4)
341352 include (${DD4hep_DIR} /cmake/DD4hep.cmake)
342353 include (${DD4hep_DIR} /cmake/DD4hepBuild.cmake)
343- add_subdirectory (src/ddceler)
344354 endif ()
345355endif ()
346356
@@ -507,13 +517,15 @@ if(CELERITAS_BUILD_DOCS)
507517 include (ExternalProject)
508518endif ()
509519
510- if (CELERITAS_BUILD_TESTS )
520+ if (CELERITAS_USE_GTest )
511521 celeritas_find_or_builtin_package(GTest 1.10)
512522endif ()
513523
514524#----------------------------------------------------------------------------#
515- # System property: availability of sincospi and related functions:
516- # All of: `^${CELERITAS_SINCOSPI_PREFIX}(sincos(pi)?|(sin|cos)pi)f?$`
525+ # System properties
526+
527+ # Availability of sincospi and related functions: all comibinations of:
528+ # `^${CELERITAS_SINCOSPI_PREFIX}(sincos(pi)?|(sin|cos)pi)f?$`
517529if (NOT DEFINED CELERITAS_SINCOSPI_PREFIX)
518530 foreach (_prefix "__" "_" "" )
519531 try_compile (CELERITAS_TRY_${_prefix} SINCOSPI
@@ -569,10 +581,12 @@ if(CELERITAS_BUILD_TESTS)
569581endif ()
570582
571583#----------------------------------------------------------------------------#
572- # APPLICATIONS AND BINARIES
584+ # APPLICATIONS AND USER EXECUTABLES
573585#----------------------------------------------------------------------------#
574586
575- add_subdirectory (app)
587+ if (CELERITAS_BUILD_APPS)
588+ add_subdirectory (app)
589+ endif ()
576590
577591#----------------------------------------------------------------------------#
578592# DOCUMENTATION
0 commit comments