Back to home page

EIC code displayed by LXR

 
 

    


Warning, /eic-opticks/dd4hepplugins/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 #------------------------------- -*- cmake -*- -------------------------------#
0002 # eic-opticks DD4hep integration plugins
0003 #
0004 # Builds DD4hep action plugins that integrate eic-opticks GPU-accelerated
0005 # optical photon simulation into DD4hep/Geant4.
0006 #
0007 # Works both as part of the top-level eic-opticks build (in-tree) and as a
0008 # standalone project against an installed eic-opticks.
0009 #
0010 # Usage from a DD4hep steering file:
0011 #   OpticsRun      -- initializes/finalizes G4CXOpticks per run
0012 #   OpticsEvent    -- triggers GPU simulation per event
0013 #----------------------------------------------------------------------------#
0014 
0015 # Detect standalone vs in-tree build
0016 if(NOT TARGET G4CX)
0017     cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
0018     project(ddeicopticks VERSION 0.1.0 LANGUAGES CXX)
0019     find_package(DD4hep REQUIRED COMPONENTS DDG4 DDCore)
0020     find_package(eic-opticks REQUIRED)
0021     find_package(Geant4 REQUIRED)
0022     set(_g4cx   eic-opticks::G4CX)
0023     set(_u4     eic-opticks::U4)
0024     set(_sysrap eic-opticks::SysRap)
0025 else()
0026     # In-tree: DD4hep already found by parent, targets use local names
0027     find_package(Geant4 REQUIRED)
0028     set(_g4cx   G4CX)
0029     set(_u4     U4)
0030     set(_sysrap SysRap)
0031 endif()
0032 
0033 dd4hep_set_compiler_flags()
0034 
0035 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
0036 set(LIBRARY_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
0037 
0038 dd4hep_add_plugin(ddeicopticks
0039   SOURCES
0040     OpticsRun.cc
0041     OpticsEvent.cc
0042     OpticsSteppingAction.cc
0043   USES
0044     DD4hep::DDG4
0045     DD4hep::DDCore
0046     ${_g4cx}
0047     ${_u4}
0048     ${_sysrap}
0049 )
0050 # STANDALONE changes class export macros in eic-opticks headers;
0051 # only needed when building outside the main eic-opticks tree.
0052 if(NOT TARGET G4CX)
0053     target_compile_definitions(ddeicopticks PRIVATE STANDALONE)
0054 endif()
0055 
0056 install(TARGETS ddeicopticks
0057   LIBRARY DESTINATION lib
0058 )
0059 
0060 install(FILES
0061   ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_SHARED_MODULE_PREFIX}ddeicopticks.components
0062   DESTINATION lib
0063 )