Warning, /DD4hep/examples/DDG4_MySensDet/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 #==========================================================================
0002 # AIDA Detector description implementation
0003 #--------------------------------------------------------------------------
0004 # Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
0005 # All rights reserved.
0006 #
0007 # For the licensing terms see $DD4hepINSTALL/LICENSE.
0008 # For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
0009 #
0010 #==========================================================================
0011 cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
0012
0013 IF(NOT TARGET DD4hep::DDCore)
0014 find_package ( DD4hep REQUIRED )
0015 include ( ${DD4hep_DIR}/cmake/DD4hep.cmake )
0016 include ( ${DD4hep_DIR}/cmake/DD4hepBuild.cmake )
0017 dd4hep_configure_output()
0018 ENDIF()
0019
0020 dd4hep_set_compiler_flags()
0021 dd4hep_use_python_executable()
0022 #==========================================================================
0023 if(NOT TARGET Geant4::Interface)
0024 dd4hep_print("Not creating DDG4_MySensDet tests")
0025 return()
0026 endif()
0027
0028 #-----------------------------------------------------------------------------------
0029 set(DDG4_MySensDet_INSTALL ${CMAKE_INSTALL_PREFIX}/examples/DDG4_MySensDet)
0030 install(DIRECTORY scripts DESTINATION ${DDG4_MySensDet_INSTALL})
0031 dd4hep_configure_scripts(DDG4_MySensDet DEFAULT_SETUP WITH_TESTS)
0032 enable_testing ()
0033 include(CTest)
0034 #
0035 #---Geant4 Testing-----------------------------------------------------------------
0036 #
0037 if (DD4HEP_USE_GEANT4)
0038 #--------------------------- Plugin library for the simulation framework ---------
0039 dd4hep_add_dictionary(G__DDG4_MySensDet
0040 SOURCES ${DD4hep_DIR}/include/ROOT/Warnings.h src/MyTrackerHit.h
0041 LINKDEF ${DD4hep_DIR}/include/ROOT/LinkDef.h
0042 OUTPUT ${LIBRARY_OUTPUT_PATH}
0043 USES DD4hep::DDCore DD4hep::DDG4 Geant4::Interface
0044 )
0045
0046 #---- Example of a client library with user defined plugins --------------------
0047 dd4hep_add_plugin( DDG4_MySensDet
0048 GENERATED G__DDG4_MySensDet.cxx
0049 SOURCES src/*.cpp
0050 USES DD4hep::DDCore DD4hep::DDG4 Geant4::Interface ROOT::Core ROOT::Geom ROOT::GenVector ROOT::RIO
0051 )
0052 install(TARGETS DDG4_MySensDet DESTINATION lib)
0053
0054 # Geant4 material scan. From position=0,0,0 to end-of-world
0055 dd4hep_add_test_reg( DDG4_MySensDet_g4material_scan_SiliconBlock_LONGTEST
0056 COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_DDG4_MySensDet.sh"
0057 EXEC_ARGS ${Python_EXECUTABLE} ${DD4hep_ROOT}/bin/g4MaterialScan --compact=file:${CMAKE_INSTALL_PREFIX}/examples/ClientTests/compact/SiliconBlock.xml
0058 "--position=0,0,0" "--direction=0,1,0"
0059 REGEX_PASS " Terminate Geant4 and delete associated actions."
0060 )
0061
0062 dd4hep_add_test_reg( DDG4_MySensDet_sim_SiliconBlock_LONGTEST
0063 COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_DDG4_MySensDet.sh"
0064 EXEC_ARGS ${Python_EXECUTABLE} ${DDG4_MySensDet_INSTALL}/scripts/MyTrackerSD_sim.py
0065 --compact=file:${CMAKE_INSTALL_PREFIX}/examples/ClientTests/compact/SiliconBlock.xml
0066 -batch -events 3
0067 REGEX_PASS NONE
0068 REGEX_FAIL "Exception;EXCEPTION;ERROR;Error" )
0069
0070 endif()