Skip to content

Commit

Permalink
Merge pull request #289 from asalzburger/feat-add-svg-display
Browse files Browse the repository at this point in the history
feat: add svg display
  • Loading branch information
beomki-yeo authored Aug 16, 2022
2 parents ac750f2 + dbe355f commit 3631646
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
16 changes: 16 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ option( DETRAY_EIGEN_PLUGIN "Build Eigen math plugin" ON )
option( DETRAY_SMATRIX_PLUGIN "Build ROOT/SMatrix math plugin" OFF )
option( DETRAY_VC_PLUGIN "Build Vc based math plugin" ON )
option( DETRAY_IO_CSV "Build CSV IO module" ON )
option( DETRAY_SVG_DISPLAY "Build ActSVG display module" OFF)
option( DETRAY_BUILD_CUDA "Build the CUDA sources included in detray"
${DETRAY_BUILD_CUDA_DEFAULT} )
option( DETRAY_BUILD_TESTING "Build the (unit) tests of Detray"
Expand Down Expand Up @@ -90,6 +91,21 @@ if( DETRAY_SETUP_ALGEBRA_PLUGINS )
endif()
endif()

# Set up ACTSVG for displaying
option( DETRAY_SETUP_ACTSVG
"Set up the actsvg target(s) explicitly" TRUE )
option( DETRAY_USE_SYSTEM_ACTSVG
"Pick up an existing installation of dfelibs from the build environment"
FALSE )
if( DETRAY_SETUP_ACTSVG )
if( DETRAY_USE_SYSTEM_ACTSVG )
find_package( actsvg::core actsvg::meta REQUIRED )
else()
add_subdirectory( extern/actsvg )
endif()
endif()


# Set up dfelibs.
option( DETRAY_SETUP_DFELIBS
"Set up the dfelibs target(s) explicitly" TRUE )
Expand Down
24 changes: 24 additions & 0 deletions extern/actsvg/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Detray library, part of the ACTS project (R&D line)
#
# (c) 2021-2022 CERN for the benefit of the ACTS project
#
# Mozilla Public License Version 2.0

# CMake include(s).
cmake_minimum_required( VERSION 3.14 )
include( FetchContent )

# Tell the user what's happening.
message( STATUS "Building actsvg as part of the Detray project" )

# Declare where to get Actsvg from.
set( DETRAY_ACTSVG_GIT_REPOSITORY "https://github.com/acts-project/actsvg.git"
CACHE STRING "Git repository to take actsvg from" )
set( DETRAY_ACTSVG_GIT_TAG "v0.4.19" CACHE STRING "Version of actsvg to build" )
mark_as_advanced( DETRAY_ACTSVG_GIT_REPOSITORY DETRAY_ACTSVG_GIT_TAG )
FetchContent_Declare( actsvg
GIT_REPOSITORY "${DETRAY_ACTSVG_GIT_REPOSITORY}"
GIT_TAG "${DETRAY_ACTSVG_GIT_TAG}" )

# Now set up its build.
FetchContent_MakeAvailable( actsvg )
3 changes: 3 additions & 0 deletions extern/actsvg/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This directory holds a simple build recipe for the
[ActSVG](https://github.com/acts-project/actsvg) project. Used in case
`DETRAY_USE_SYSTEM_ACTSVG` is set to `FALSE` for the build.

0 comments on commit 3631646

Please sign in to comment.