Back to home page

EIC code displayed by LXR

 
 

    


Warning, /geant4/examples/advanced/doiPET/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(doiPET)
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)
0016 else()
0017   find_package(Geant4 REQUIRED)
0018 endif()
0019 
0020 # Setup of ROOT ANALYSIS : optional. 
0021 
0022 #option(WITH_ANALYSIS_USE "Build example with analysis objects" OFF)
0023 #if(WITH_ANALYSIS_USE)
0024 #add_definitions(-DUSEROOT)
0025 #else()
0026 #endif()
0027 
0028 option(WITH_ANALYSIS_USE "Build example with analysis objects" OFF)
0029 if(WITH_ANALYSIS_USE)
0030 add_definitions(-DANALYSIS_USE)
0031 else()
0032 endif()
0033 
0034 #----------------------------------------------------------------------------
0035 # Setup Geant4 include directories and compile definitions
0036 # Setup include directory for this project
0037 #
0038 include(${Geant4_USE_FILE})
0039 include_directories(${PROJECT_SOURCE_DIR}/include)
0040 
0041 #----------------------------------------------------------------------------
0042 # Find ROOT (required package)
0043 #
0044 #find_package(ROOT REQUIRED)
0045 #if(WITH_ANALYSIS_USE)
0046 #       EXECUTE_PROCESS(COMMAND root-config --cflags OUTPUT_VARIABLE ROOT_CXX_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
0047 #       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ROOT_CXX_FLAGS}")
0048 #endif(WITH_ANALYSIS_USE) 
0049 #----------------------------------------------------------------------------
0050 # Locate sources and headers for this project
0051 # NB: headers are included so they will show up in IDEs
0052 #
0053 file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc)
0054 file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh)
0055 
0056 #include_directories(${PROJECT_SOURCE_DIR}/include 
0057 #                    ${PROJECT_SOURCE_DIR}/shared/include 
0058 #                    ${Geant4_INCLUDE_DIR}
0059 #                    ${ROOT_INCLUDE_DIR})
0060 #file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc
0061 #                  ${PROJECT_SOURCE_DIR}/shared/src/*.cc)
0062 #file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh
0063 #                  ${PROJECT_SOURCE_DIR}/shared/include/*.hh)
0064 
0065 #----------------------------------------------------------------------------
0066 # Add the executable, and link it to the Geant4 libraries
0067 #
0068 add_executable(doiPET doiPET.cc ${sources} ${headers})
0069 
0070 #if(WITH_ANALYSIS_USE)
0071 #       EXECUTE_PROCESS(COMMAND root-config --libs OUTPUT_VARIABLE ROOT_LD_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
0072 #       set(CMAKE_EXE_LINKER_FLAGS ${ROOT_LD_FLAGS})
0073 #endif(WITH_ANALYSIS_USE)
0074 
0075 target_link_libraries(doiPET ${Geant4_LIBRARIES})
0076 
0077 #----------------------------------------------------------------------------
0078 # Copy all scripts to the build directory. This is so that we can run the executable directly because it
0079 # relies on these scripts being in the current working directory.
0080 #
0081 set(DOIPET_SCRIPTS
0082   init_vis.mac
0083   vis.mac
0084   run_imageQualityPhantom_wholeBody.mac
0085   run_imageQualityPhantom_smallAnimal.mac
0086   run_NECR.mac
0087   run_spatialResolution.mac
0088   run_sensitivity.mac 
0089   run_normalization.mac 
0090   run.mac
0091   inputParameter.txt
0092   analysis.cpp
0093   )
0094 
0095 foreach(_script ${DOIPET_SCRIPTS})
0096   configure_file(
0097     ${PROJECT_SOURCE_DIR}/${_script}
0098     ${PROJECT_BINARY_DIR}/${_script}
0099     COPYONLY
0100     )
0101 endforeach()
0102 
0103 install(TARGETS doiPET DESTINATION bin )