Skip to content

Commit

Permalink
Split CMake RDC utilities from Celeritas macros (#1104)
Browse files Browse the repository at this point in the history
* cmake: Use cuda_rdc_* for CUDA relocatable device code support

* cmake: add celeritas_target_compile_options wrapper

* Apply POSITION_INDEPENDENT_CODE only to the object library

* Do not use cuda_rdc if USE_VECGEOM is false

* Install CudaRdcUtils.cmake

* Add more celeritas rdc wrappers and fix existing ones.

* Re-add CeleritasLibrary.cmake for backwark compatibility.

Add missing install of CeleritasUtils.cmake

* Add celeritas_sources_contains_cuda

* Fix typo in doc/comment

* Update exampes, library usage

* Fix variable being set in parent scope by using macros to forward

* Also don't use if not CUDA

* Fix typo in documentation.

Co-authored-by: Seth R. Johnson <johnsonsr@ornl.gov>

* Correct implementation of cuda_rdc_add_library for ALIAS

* Add support for ALIAS in cuda_rdc_get_sources_and_options

* Avoid FindCUDA's version by renaming cuda_[rdc_]get_sources_and_options
  • Loading branch information
pcanal committed Feb 14, 2024
1 parent 4c469e2 commit fb03216
Show file tree
Hide file tree
Showing 8 changed files with 1,158 additions and 914 deletions.
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if(CMAKE_VERSION VERSION_LESS 3.18)
endif()

include(GNUInstallDirs)
include(CeleritasLibrary)
include(CudaRdcUtils)
include(CeleritasUtils)
include(CMakeDependentOption)
include(CMakePackageConfigHelpers)
Expand Down Expand Up @@ -229,8 +229,8 @@ endif()
celeritas_set_default(CMAKE_INSTALL_MESSAGE LAZY)

#----------------------------------------------------------------------------#
# Output locations for Celeritas products (used by CeleritasLibrary.cmake,
# CeleritasUtils.cmake, install code below) will mirror the installation layout
# Output locations for Celeritas products (used by CeleritasUtils.cmake and
# install code below) will mirror the installation layout
set(CELERITAS_CMAKE_CONFIG_DIRECTORY
"${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/cmake")
set(CELERITAS_HEADER_CONFIG_DIRECTORY
Expand Down Expand Up @@ -525,6 +525,7 @@ set(CELERITAS_INSTALL_CMAKECONFIGDIR

# Build list of CMake files to install
set(_cmake_files
"${PROJECT_SOURCE_DIR}/cmake/CudaRdcUtils.cmake"
"${PROJECT_SOURCE_DIR}/cmake/CeleritasLibrary.cmake"
)
foreach(_dep Geant4 HepMC3 ROOT VecGeom)
Expand Down

0 comments on commit fb03216

Please sign in to comment.