Back to home page

EIC code displayed by LXR

 
 

    


Warning, /geant4/examples/extended/parallel/TBB/B2b/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 
0002 #----------------------------------------------------------------------------
0003 # Setup the project
0004 #
0005 cmake_minimum_required(VERSION 3.16...3.27)
0006 project(B2bTBB)
0007 
0008 #----------------------------------------------------------------------------
0009 # Find Geant4 package, activating all available UI and Vis drivers by default
0010 # You can set WITH_GEANT4_UIVIS to OFF via the command line or ccmake/cmake-gui
0011 # to build a batch mode only executable
0012 #
0013 option(WITH_GEANT4_UIVIS "Build example with Geant4 UI and Vis drivers" ON)
0014 if(WITH_GEANT4_UIVIS)
0015   find_package(Geant4 REQUIRED ui_all vis_all multithreaded)
0016 else()
0017   find_package(Geant4 REQUIRED multithreaded)
0018 endif()
0019 
0020 #----------------------------------------------------------------------------
0021 # Setup Geant4 include directories and compile definitions
0022 #
0023 include(${Geant4_USE_FILE})
0024 
0025 #----------------------------------------------------------------------------
0026 # Find TBB (required package)
0027 #
0028 find_package(TBB REQUIRED)
0029 
0030 #----------------------------------------------------------------------------
0031 # Setup Geant4 include directories and compile definitions
0032 # Setup include directory for this project
0033 #
0034 include_directories(${PROJECT_SOURCE_DIR}/include ${TBB_INCLUDE_DIRS})
0035 
0036 #----------------------------------------------------------------------------
0037 # Locate sources and headers for this project
0038 # NB: headers are included so they will show up in IDEs
0039 #
0040 file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc)
0041 file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh)
0042 
0043 #----------------------------------------------------------------------------
0044 # Add the executable, and link it to the Geant4 libraries
0045 #
0046 add_executable(exampleB2bTBB exampleB2b.cc ${sources} ${headers})
0047 target_link_libraries(exampleB2bTBB ${Geant4_LIBRARIES} ${TBB_LIBRARIES})
0048 
0049 #----------------------------------------------------------------------------
0050 # Copy all scripts to the build directory, i.e. the directory in which we
0051 # build B2b. This is so that we can run the executable directly because it
0052 # relies on these scripts being in the current working directory.
0053 #
0054 set(EXAMPLEB2B_SCRIPTS
0055   exampleB2b.out
0056   exampleB2.in
0057   gui.mac
0058   init.mac
0059   init_vis.mac
0060   tbb.mac
0061   vis.mac
0062   )
0063 
0064 foreach(_script ${EXAMPLEB2B_SCRIPTS})
0065   configure_file(
0066     ${PROJECT_SOURCE_DIR}/${_script}
0067     ${PROJECT_BINARY_DIR}/${_script}
0068     COPYONLY
0069     )
0070 endforeach()
0071 
0072 #----------------------------------------------------------------------------
0073 # Install the executable to 'bin' directory under CMAKE_INSTALL_PREFIX
0074 #
0075 install(TARGETS exampleB2bTBB DESTINATION bin)
0076