Warning, /geant4/examples/extended/medical/DICOM/DICOM1/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 project(DICOM01)
0005
0006 #----------------------------------------------------------------------------
0007 # Locate sources and headers for this project
0008 # NB: headers are included so they will show up in IDEs
0009 #
0010 file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc)
0011 file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh)
0012
0013 #----------------------------------------------------------------------------
0014 # Add the executable, and link it to the Geant4 libraries
0015 #
0016 add_executable(dicom1 dicom1.cc)
0017 target_link_libraries(dicom1 PRIVATE G4DicomCore::G4DicomCore)
0018
0019 #----------------------------------------------------------------------------
0020 # Copy all scripts to the build directory, i.e. the directory in which we
0021 # build DICOM. This is so that we can run the executable directly because it
0022 # relies on these scripts being in the current working directory.
0023 #
0024
0025 # the macros
0026 set(DICOM_MACROS run.mac vis.mac)
0027
0028 # original set of DICOM data
0029 set(DICOM_SCRIPTS
0030 1.dcm 2.dcm 3.dcm
0031 1.g4 2.g4 3.g4
0032 1.g4dcm 2.g4dcm 3.g4dcm
0033 ColourMap.dat CT2Density.dat
0034 Data.dat.new Data.dat.old
0035 Data.dat.new_dens Data.partial.dat)
0036
0037 # new DICOM data (in share directory)
0038 set(DICOM_SHARE
0039 AltData.dat SixSlice.dat
0040 IM-0003-0001.dcm IM-0003-0003.dcm IM-0003-0005.dcm IM-0003-0007.dcm IM-0003-0009.dcm
0041 IM-0003-0002.dcm IM-0003-0004.dcm IM-0003-0006.dcm IM-0003-0008.dcm IM-0003-0010.dcm)
0042
0043 # copy over scripts
0044 foreach(_script ${DICOM_SCRIPTS})
0045 configure_file(
0046 ${PROJECT_SOURCE_DIR}/${_script}
0047 ${PROJECT_BINARY_DIR}/${_script}
0048 COPYONLY)
0049 endforeach()
0050
0051 # copy either Data.dat.old or Data.dat.new to Data.dat based on build settings
0052 if(G4DICOM_USE_DCMTK)
0053 configure_file(${PROJECT_SOURCE_DIR}/Data.dat.new
0054 ${PROJECT_BINARY_DIR}/Data.dat COPYONLY)
0055 else()
0056 configure_file(${PROJECT_SOURCE_DIR}/Data.dat.old
0057 ${PROJECT_BINARY_DIR}/Data.dat COPYONLY)
0058 endif()
0059
0060 # copy over files in share
0061 foreach(_script ${DICOM_SHARE})
0062 configure_file(
0063 ${PROJECT_SOURCE_DIR}/share/${_script}
0064 ${PROJECT_BINARY_DIR}/${_script}
0065 COPYONLY)
0066 endforeach()
0067
0068 # copy over macros
0069 foreach(_script ${DICOM_MACROS})
0070 configure_file(
0071 ${PROJECT_SOURCE_DIR}/${_script}
0072 ${PROJECT_BINARY_DIR}/${_script}
0073 COPYONLY)
0074 endforeach()
0075