Back to home page

EIC code displayed by LXR

 
 

    


Warning, /geant4/examples/advanced/eRosita/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 #----------------------------------------------------------------------------
0002 # Setup the project
0003 cmake_minimum_required(VERSION 3.16...3.27)
0004 if(${CMAKE_VERSION} VERSION_LESS 3.12)
0005   cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
0006 endif()
0007 project(eRosita)
0008 
0009 #----------------------------------------------------------------------------
0010 # Find Geant4 package, activating all available UI and Vis drivers by default
0011 # You can set WITH_GEANT4_UIVIS to OFF via the command line or ccmake/cmake-gui
0012 # to build a batch mode only executable
0013 #
0014 option(WITH_GEANT4_UIVIS "Build example with Geant4 UI and Vis drivers" ON)
0015 if(WITH_GEANT4_UIVIS)
0016   find_package(Geant4 REQUIRED ui_all vis_all)
0017 else()
0018   find_package(Geant4 REQUIRED)
0019 endif()
0020 
0021 
0022 #-----------------------------------------------------------------------------------
0023 # Notice G4PIIDATA environment variable as appropriate to get acces to the PIXE data
0024 #
0025 # message("G4PIIDATA: " $ENV{G4PIIDATA})
0026 if(DEFINED ENV{G4PIIDATA})
0027   message(STATUS "G4PIIDATA environment variable defined")
0028 else()
0029   message(STATUS "Please set G4PIIDATA enviroment variable (e.g. G4PII1.3) in your system!")
0030 endif()
0031 
0032 
0033 #----------------------------------------------------------------------------
0034 # Setup Geant4 include directories and compile definitions
0035 # Setup include directory for this project
0036 #
0037 include(${Geant4_USE_FILE})
0038 include_directories(${PROJECT_SOURCE_DIR}/application/include)
0039 
0040 #----------------------------------------------------------------------------
0041 # Locate sources and headers for this project
0042 # NB: headers are included so they will show up in IDEs
0043 #
0044 file(GLOB sources ${PROJECT_SOURCE_DIR}/application/src/*.cc)
0045 file(GLOB headers ${PROJECT_SOURCE_DIR}/application/include/*.hh)
0046 
0047 add_executable(eRosita eRosita.cc ${sources} ${headers})
0048 
0049 #----------------------------------------------------------------------------
0050 # Add the executable, and link it to the Geant4 libraries
0051 #
0052 target_link_libraries(eRosita ${Geant4_LIBRARIES})
0053 
0054 
0055 #----------------------------------------------------------------------------
0056 # Copy all scripts to the build directory, i.e. the directory in which we
0057 # build eRosita. This is so that we can run the executable directly because it
0058 # relies on these scripts being in the current working directory.
0059 #
0060 set(EXAMPLEeRosita_SCRIPTS
0061   eRosita.in
0062   eRositaLong.in
0063   vis.mac
0064 )
0065 
0066 foreach(_script ${EXAMPLEeRosita_SCRIPTS})
0067   configure_file(
0068     ${PROJECT_SOURCE_DIR}/${_script}
0069     ${PROJECT_BINARY_DIR}/${_script}
0070     COPYONLY
0071     )
0072 endforeach()
0073 
0074 #----------------------------------------------------------------------------
0075 # For internal Geant4 use - but has no effect if you build this
0076 # example standalone
0077 #
0078 #add_custom_target(eRosita DEPENDS eRosita)
0079 
0080 #----------------------------------------------------------------------------
0081 # Install the executable to 'bin' directory under CMAKE_INSTALL_PREFIX
0082 #
0083 install(TARGETS eRosita DESTINATION bin)