-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
96 lines (84 loc) · 3.67 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# This is the root ITK CMakeLists file.
CMAKE_MINIMUM_REQUIRED (VERSION 2.8)
# This project is designed to be built outside the Insight source tree.
PROJECT(ProtonCT)
#=========================================================
# Help function to debug CMake
MACRO (DD in)
MESSAGE(${in}=${${in}})
ENDMACRO(DD)
#=========================================================
# CMake packages
SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake"
CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/Modules"
${CMAKE_MODULE_PATH})
FIND_PACKAGE(Gengetopt REQUIRED)
find_package(ITK 5.0.0 REQUIRED COMPONENTS RTK)
include(${ITK_USE_FILE})
IF(NOT WIN32)
FIND_PACKAGE(ROOT REQUIRED)
INCLUDE_DIRECTORIES(${ROOT_INCLUDE_DIR})
SET(LINK_DIRECTORIES ${ROOT_LIBRARY_DIR})
ENDIF(NOT WIN32)
IF(NOT ITK_USE_FFTWD OR NOT ITK_USE_FFTWF)
MESSAGE(FATAL_ERROR "You must recompile ITK with ITK_USE_FFTWF and ITK_USE_FFTWD. Then, recompile RTK first and pct second.")
ENDIF()
#=========================================================
# Geant4 stuff
OPTION(PCT_WITH_GEANT4 "Use Geant4" OFF)
IF(PCT_WITH_GEANT4)
FIND_PACKAGE(Geant4 REQUIRED)
INCLUDE(${Geant4_USE_FILE})
ADD_SUBDIRECTORY(geant4)
ADD_DEFINITIONS(-DPCT_GEANT4)
INCLUDE_DIRECTORIES(geant4)
STRING(REGEX REPLACE "-ansi" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
STRING(REGEX REPLACE "-pedantic" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
ELSE()
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
ENDIF()
#=========================================================
# We remove the warning option "shadow", because there are tons of
# such warning related to clhep/g4 system of units.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-shadow")
#=========================================================
# Executables
MACRO (ADD_PCT_EXECUTABLE EXE_NAME)
WRAP_GGO(${EXE_NAME}_GGO_C ${EXE_NAME}.ggo)
ADD_EXECUTABLE(${EXE_NAME} ${EXE_NAME}.cxx ${${EXE_NAME}_GGO_C} ${ARGN})
TARGET_LINK_LIBRARIES(${EXE_NAME} ${ITK_LIBRARIES})
IF(PCT_WITH_GEANT4)
TARGET_LINK_LIBRARIES(${EXE_NAME} pctGeant4)
ENDIF(PCT_WITH_GEANT4)
ENDMACRO (ADD_PCT_EXECUTABLE)
# Executables
IF(NOT WIN32)
ADD_PCT_EXECUTABLE(pctpairprotons pctpairprotons.cxx)
TARGET_LINK_LIBRARIES(pctpairprotons ${ROOT_LIBRARIES})
ADD_PCT_EXECUTABLE(pctpairprotonsLomaLinda pctpairprotonsLomaLinda.cxx)
TARGET_LINK_LIBRARIES(pctpairprotonsLomaLinda ${ROOT_LIBRARIES})
ADD_PCT_EXECUTABLE(pctpairprotonsLMU_IMPCT pctpairprotonsLMU_IMPCT.cxx)
TARGET_LINK_LIBRARIES(pctpairprotonsLMU_IMPCT ${ROOT_LIBRARIES})
ENDIF(NOT WIN32)
ADD_PCT_EXECUTABLE(pctpaircuts pctpaircuts.cxx)
TARGET_LINK_LIBRARIES(pctpaircuts ${ROOT_LIBRARIES} RooFit RooFitCore Minuit)
ADD_PCT_EXECUTABLE(pctlluconverter pctlluconverter.cxx)
TARGET_LINK_LIBRARIES(pctlluconverter ${ROOT_LIBRARIES})
ADD_PCT_EXECUTABLE(pctpairgeometry pctpairgeometry.cxx)
ADD_PCT_EXECUTABLE(pctmostlikelypath pctmostlikelypath.cxx)
ADD_PCT_EXECUTABLE(pctbinning pctbinning.cxx)
ADD_PCT_EXECUTABLE(pctfillholl pctfillholl.cxx)
ADD_PCT_EXECUTABLE(pctbackprojectionbinning pctbackprojectionbinning.cxx)
ADD_PCT_EXECUTABLE(pctzengbackprojections pctzengbackprojections.cxx)
ADD_PCT_EXECUTABLE(pctparkershortscanweighting pctparkershortscanweighting.cxx)
ADD_PCT_EXECUTABLE(pctprojections pctprojections.cxx)
ADD_PCT_EXECUTABLE(pctbackprojections pctbackprojections.cxx)
ADD_PCT_EXECUTABLE(pctfdktwodweights pctfdktwodweights.cxx)
ADD_PCT_EXECUTABLE(pctfdk pctfdk.cxx)
ADD_PCT_EXECUTABLE(pctschulte pctschulte.cxx)
ADD_PCT_EXECUTABLE(pctswapcoordinates pctswapcoordinates.cxx)
ADD_PCT_EXECUTABLE(pctpairarithm pctpairarithm.cxx)
IF(PCT_WITH_GEANT4)
ADD_PCT_EXECUTABLE(pctdiffxsection pctdiffxsection.cxx)
ENDIF(PCT_WITH_GEANT4)
CONFIGURE_FILE("pcttoftowepl.py" "pcttoftowepl.py" COPYONLY)