Skip to content

Commit b3e3fd5

Browse files
committed
Update CMakeLists.txt to bring in latest changes from develop
1 parent 58161ac commit b3e3fd5

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
@@ -45,6 +45,7 @@ celeritas_optional_package(DD4hep "Enable DD4hep integration")
4545
option(CELERITAS_USE_Perfetto "Perfetto tracing library" OFF)
4646

4747
# Components
48+
option(CELERITAS_BUILD_APPS "Build Celeritas executables (strongly recommended)" ON)
4849
option(CELERITAS_BUILD_DOCS "Build Celeritas documentation" OFF)
4950
option(CELERITAS_BUILD_TESTS "Build Celeritas unit tests" OFF)
5051

@@ -84,6 +85,10 @@ if(CELERITAS_BUILD_TESTS)
8485
mark_as_advanced(CELERITAS_TEST_XML)
8586
endif()
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

285290
include(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

289296
if(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()
314325
endif()
315326

316327
if(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()
345355
endif()
346356

@@ -507,13 +517,15 @@ if(CELERITAS_BUILD_DOCS)
507517
include(ExternalProject)
508518
endif()
509519

510-
if(CELERITAS_BUILD_TESTS)
520+
if(CELERITAS_USE_GTest)
511521
celeritas_find_or_builtin_package(GTest 1.10)
512522
endif()
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?$`
517529
if(NOT DEFINED CELERITAS_SINCOSPI_PREFIX)
518530
foreach(_prefix "__" "_" "")
519531
try_compile(CELERITAS_TRY_${_prefix}SINCOSPI
@@ -569,10 +581,12 @@ if(CELERITAS_BUILD_TESTS)
569581
endif()
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

Comments
 (0)