Back to home page

EIC code displayed by LXR

 
 

    


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

0001 cmake_minimum_required(VERSION 3.16...3.27)
0002 project(dsbandrepair)
0003 
0004 find_package(Geant4 REQUIRED)
0005 
0006 option(DOWNLOAD_GEOMETRY "Download geometry files" TRUE)
0007 option(USE_MPI "Using MPI" FALSE)
0008 if (USE_MPI)
0009   find_package(G4mpi REQUIRED)
0010 endif()
0011 #----------------------------------------------------------------------------
0012 if (DOWNLOAD_GEOMETRY) 
0013   include(ExternalProject)
0014   ExternalProject_Add(dnafabric_geometries
0015   SOURCE_DIR ${PROJECT_BINARY_DIR}/dnafabric_geometries
0016   URL https://cern.ch/geant4-data/datasets/examples/advanced/dsbandrepair/0/dnafabric_geometries.tar.xz
0017   URL_HASH SHA256=7e77ec0dd4291599768a4c95b95f2456a1477b32f8141c97ddb78f982d828649
0018   CONFIGURE_COMMAND ""
0019   BUILD_COMMAND ""
0020   INSTALL_COMMAND ""
0021   )
0022 else()
0023   message("---> Option for downloading geometry files is off. Make sure you already have them, or download manually!")
0024 endif()
0025 #----------------------------------------------------------------------------
0026 #----------------------------------------------------------------------------
0027 # Locate sources and headers for this project
0028 # NB: headers are included so they will show up in IDEs
0029 #
0030 file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc)
0031 file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh)
0032 
0033 #----------------------------------------------------------------------------
0034 # Add the executable, and link it to the Geant4 libraries
0035 #
0036 add_executable(${PROJECT_NAME} dsbandrepair.cc ${sources} ${headers})
0037 target_link_libraries(${PROJECT_NAME} ${Geant4_LIBRARIES} ${G4mpi_LIBRARIES})
0038 #----------------------------------------------------------------------------
0039 if(DOWNLOAD_GEOMETRY)
0040   add_dependencies(${PROJECT_NAME} dnafabric_geometries)
0041 endif()
0042 #----------------------------------------------------------------------------
0043 if (USE_MPI)
0044   message(STATUS "dsbandrepair will run with MPI")
0045   target_compile_definitions(${PROJECT_NAME} PRIVATE USE_MPI)
0046 endif()
0047 #----------------------------------------------------------------------------
0048 # Setup Geant4 include directories and compile definitions
0049 # 
0050 target_include_directories(${PROJECT_NAME} PUBLIC
0051                     ${PROJECT_SOURCE_DIR}/include
0052                     ${Geant4_INCLUDE_DIR}
0053                     ${G4mpi_INCLUDE_DIR}
0054 )
0055 #----------------------------------------------------------------------------
0056 # Copy all scripts to the build directory, i.e. the directory in which we
0057 # build dsbandrepair. 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(dsbandrepair_SCRIPTS
0061   ${PROJECT_SOURCE_DIR}/macros/dsbandrepair.in
0062   ${PROJECT_SOURCE_DIR}/macros/chem.in
0063   ${PROJECT_SOURCE_DIR}/macros/endophys.in
0064   ${PROJECT_SOURCE_DIR}/macros/fibroblast.in
0065   ${PROJECT_SOURCE_DIR}/macros/yeastphys.in
0066   ${PROJECT_SOURCE_DIR}/macros/analysis.in
0067   )
0068 
0069 foreach(_script ${dsbandrepair_SCRIPTS})
0070   configure_file(
0071     ${_script}
0072     ${PROJECT_BINARY_DIR}/.
0073     COPYONLY
0074     )
0075 endforeach()