Skip to content

Commit ab67f02

Browse files
committed
Update CMakeLists.txt to bring in latest changes from develop
1 parent 6d06415 commit ab67f02

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

CMakeLists.txt

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ celeritas_optional_package(DD4hep "Enable DD4hep integration")
4646
option(CELERITAS_USE_Perfetto "Perfetto tracing library" OFF)
4747

4848
# Components
49+
option(CELERITAS_BUILD_APPS "Build Celeritas executables (strongly recommended)" ON)
4950
option(CELERITAS_BUILD_DOCS "Build Celeritas documentation" OFF)
5051
option(CELERITAS_BUILD_TESTS "Build Celeritas unit tests" OFF)
5152

@@ -85,6 +86,10 @@ if(CELERITAS_BUILD_TESTS)
8586
mark_as_advanced(CELERITAS_TEST_XML)
8687
endif()
8788

89+
# Automatic options
90+
set(CELERITAS_USE_CLI11 ${CELERITAS_BUILD_APPS})
91+
set(CELERITAS_USE_GTest ${CELERITAS_BUILD_TESTS})
92+
8893
#----------------------------------------------------------------------------#
8994
# CELERITAS CORE IMPLEMENTATION OPTIONS
9095
#----------------------------------------------------------------------------#
@@ -285,7 +290,9 @@ set(CELERITAS_RUNTIME_OUTPUT_DIRECTORY
285290

286291
include(CeleritasUtils)
287292

288-
celeritas_find_or_builtin_package(CLI11 2.4)
293+
if(CELERITAS_USE_CLI11)
294+
celeritas_find_or_builtin_package(CLI11 2.4)
295+
endif()
289296

290297
if(BUILD_TESTING)
291298
# Build the test tree for unit and/or app tests
@@ -312,6 +319,10 @@ elseif(CELERITAS_USE_HIP)
312319
OFF
313320
)
314321
endif()
322+
find_library(ROCTX_LIBRARY roctx64)
323+
if(ROCTX_LIBRARY)
324+
set(CELERITAS_HAVE_ROCTX ON)
325+
endif()
315326
endif()
316327

317328
if(CELERITAS_USE_CUDA)
@@ -341,7 +352,6 @@ if(CELERITAS_USE_DD4hep)
341352
find_package(DD4hep 1.18 REQUIRED COMPONENTS DDCore DDG4)
342353
include(${DD4hep_DIR}/cmake/DD4hep.cmake)
343354
include(${DD4hep_DIR}/cmake/DD4hepBuild.cmake)
344-
add_subdirectory(src/ddceler)
345355
endif()
346356
endif()
347357

@@ -519,13 +529,15 @@ if(CELERITAS_BUILD_DOCS)
519529
include(ExternalProject)
520530
endif()
521531

522-
if(CELERITAS_BUILD_TESTS)
532+
if(CELERITAS_USE_GTest)
523533
celeritas_find_or_builtin_package(GTest 1.10)
524534
endif()
525535

526536
#----------------------------------------------------------------------------#
527-
# System property: availability of sincospi and related functions:
528-
# All of: `^${CELERITAS_SINCOSPI_PREFIX}(sincos(pi)?|(sin|cos)pi)f?$`
537+
# System properties
538+
539+
# Availability of sincospi and related functions: all comibinations of:
540+
# `^${CELERITAS_SINCOSPI_PREFIX}(sincos(pi)?|(sin|cos)pi)f?$`
529541
if(NOT DEFINED CELERITAS_SINCOSPI_PREFIX)
530542
foreach(_prefix "__" "_" "")
531543
try_compile(CELERITAS_TRY_${_prefix}SINCOSPI
@@ -581,10 +593,12 @@ if(CELERITAS_BUILD_TESTS)
581593
endif()
582594

583595
#----------------------------------------------------------------------------#
584-
# APPLICATIONS AND BINARIES
596+
# APPLICATIONS AND USER EXECUTABLES
585597
#----------------------------------------------------------------------------#
586598

587-
add_subdirectory(app)
599+
if(CELERITAS_BUILD_APPS)
600+
add_subdirectory(app)
601+
endif()
588602

589603
#----------------------------------------------------------------------------#
590604
# DOCUMENTATION

0 commit comments

Comments
 (0)