-
Notifications
You must be signed in to change notification settings - Fork 13
/
CMakeLists.txt
178 lines (128 loc) · 4.93 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
CMAKE_MINIMUM_REQUIRED (VERSION 2.8)
# This project is designed to be built outside the RTK source tree.
#test
PROJECT(CbctRecon)
# Find the RTK libraries and includes
SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
FIND_PACKAGE(RTK REQUIRED)
INCLUDE(${RTK_USE_FILE})
FIND_PACKAGE(CUDA)
FIND_PACKAGE(OpenCL)
get_filename_component(MY_PARENT_DIR ${CUDA_LIBRARIES} PATH)
set (CUDA_FFT_LIB ${MY_PARENT_DIR}/cufft.lib)
FIND_PACKAGE(QT4 REQUIRED)
find_package (Plastimatch)
message (STATUS "Plastimatch_FOUND = ${Plastimatch_FOUND}")
message (STATUS "Plastimatch_DIR = ${Plastimatch_DIR}")
message (STATUS "Plastimatch_SOURCE = ${Plastimatch_SRC}")
message (STATUS "PLM_SRC_ROOT = ${PLM_SRC_ROOT}")
message (STATUS "CMAKE_CURRENT_BINARY_DIR = ${CMAKE_CURRENT_BINARY_DIR}")
message (STATUS "CMAKE_CURRENT_SOURCE_DIR = ${CMAKE_CURRENT_SOURCE_DIR}")
message (STATUS "MY_PARENT_DIR = ${MY_PARENT_DIR}")
message (STATUS "PLASTIMATCH_LIBRARIES = ${PLASTIMATCH_LIBRARIES}")
message (STATUS "PLASTIMATCH_LIBRARY = ${PLASTIMATCH_LIBRARY}")
message (STATUS "PLASTIMATCH_INCLUDE_DIRS = ${PLASTIMATCH_INCLUDE_DIRS}")
message (STATUS "PLASTIMATCH_INCLUDE_DIRS = ${PLASTIMATCH_INCLUDE_DIRS}")
message (STATUS "PLASTIMATCH_SOURCE_DIR = ${PLASTIMATCH_DIR}")
#MESSAGE(STATUS "PLASTIMATCH_LINK_DIRECTORIES = ${Plastimatch_LINK_DIRECTORIES}")
#MESSAGE(STATUS "PLASTIMATCH_LINK_DIRECTORIES = ${Plastimatch_LINK_DIRS}")
#MESSAGE(STATUS "PLASTIMATCH_SOURCE_DIRECTORY = ${PLASTIMATCH_LINK_DIR}")
if (QT4_FOUND)
message (STATUS "Looking for Qt4 - found")
include (${QT_USE_FILE})
else ()
message (STATUS "Looking for Qt4 - not found")
endif ()
#Find ITk folder
FIND_PACKAGE(ITK)
IF(ITK_FOUND)
INCLUDE(${ITK_USE_FILE})
ELSE(ITK_FOUND)
MESSAGE(FATAL_ERROR
"Cannot build without ITK. Please set ITK_DIR.")
ENDIF(ITK_FOUND)
#Find DCMTK
find_package(DCMTK REQUIRED)
#LINK_DIRECTORIES(${DCMTK_LIBRARY_DIRS}) #not defined
#LINK_DIRECTORIES("H:/lib/dcmtk3.6.1/BUILD32/lib/Debug") #works
LINK_DIRECTORIES("${DCMTK_DIR}/lib")
#works But A lot of lInk error (detection...
MESSAGE(STATUS "DCMTK_FOUND = ${DCMTK_FOUND}")
MESSAGE(STATUS "DCMTK_DIR = ${DCMTK_DIR}")
MESSAGE(STATUS "DCMTK_ROOT_DIR = ${DCMTK_ROOT_DIR}")
MESSAGE(STATUS "DCMTK_INCLUDE_DIRS = ${DCMTK_INCLUDE_DIRS}")
MESSAGE(STATUS "DCMTK_LINK_DIRECTORIES = ${DCMTK_LINK_DIRECTORIES}")
MESSAGE(STATUS "DCMTK_LIBRARIES = ${DCMTK_LIBRARIES}")
message (STATUS "DCMTK_SOURCE_DIRECTORY = ${DCMTK_SOURCE_DIRECTORY}")
SET(CbctRecon_SOURCES
main.cpp
cbctrecon.cpp
YK16GrayImage.cxx
qyklabel.cpp
qcustomplot.cpp
DlgRegistration.cxx
DlgExternalCommand.cxx
)
SET(CbctRecon_HEADERS
cbctrecon.h
YK16GrayImage.h
qyklabel.h
qcustomplot.h
DlgRegistration.h
DlgExternalCommand.h
)
SET(CbctRecon_FORMS
cbctrecon.ui
DlgRegistration.ui
DlgExternalCommand.ui)
INCLUDE(${QT_USE_FILE})
ADD_DEFINITIONS(${QT_DEFINITIONS})
QT4_WRAP_CPP(CbctRecon_HEADERS_MOC ${CbctRecon_HEADERS})
QT4_WRAP_UI(CbctRecon_FORMS_HEADERS ${CbctRecon_FORMS})
QT4_ADD_RESOURCES(CbctRecon_RESOURCES_RCC ${CbctRecon_RESOURCES})
# Executable
ADD_EXECUTABLE(CbctRecon ${CbctRecon_SOURCES}
${CbctRecon_HEADERS}
${CbctRecon_HEADERS_MOC}
${CbctRecon_FORMS_HEADERS}
)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
IF (OpenCL_FOUND)
INCLUDE_DIRECTORIES(${OpenCL_INCLUDE_DIR})
ENDIF(OpenCL_FOUND)
#SET (PLASTIMATCH_INCLUDE_DIRS
# ${PLASTIMATCH_INCLUDE_DIRS}
# "H:/lib/plastimatch/SRC/src/plastimatch/segment"
# "H:/lib/plastimatch/SRC/src/plastimatch/cli"
# "H:/lib/plastimatch/SRC/src/plastimatch/clp")
#SET (PLASTIMATCH_INCLUDE_DIRS
# ${PLASTIMATCH_INCLUDE_DIRS})
message (STATUS "PLASTIMATCH_SOURCE_DIRECTORY = ${PLASTIMATCH_INCLUDE_DIRS}")
message (STATUS "CMAKE_LIBRARY_PATH = ${CMAKE_LIBRARY_PATH}")
message (STATUS "CMAKE_MODULE_PATH = ${CMAKE_MODULE_PATH}")
#this is for "C++ General-> Add below to Additional Include Directories"
INCLUDE_DIRECTORIES(${PLASTIMATCH_INCLUDE_DIRS})
SET(QT_USE_QTCORE TRUE)
SET(QT_USE_QTGUI TRUE)
SET(QT_USE_QTOPENGL TRUE)
#This is for "Linker->additional library directories" for DCMRT dir (to deal with oflog.lib not found error)
#LINK_DIRECTORIES("H:/lib/dcmtk3.6.1/BUILD32/lib/Debug")
#SET_TARGET_PROPERTIES (CbctRecon PROPERTIES LINK_FLAGS "H:\lib\dcmtk3.6.1\BUILD32\lib\Debug")
message (STATUS "RTK_USE_FILE = ${RTK_USE_FILE}")
message (STATUS "RTK_LIBRARY_DIRS = ${RTK_LIBRARY_DIRS}")
message (STATUS "DCMTK_LIBRARY_DIRS = ${DCMTK_LIBRARY_DIRS}")
message (STATUS "DCMTK_LIBRARIES = ${DCMTK_LIBRARIES}")
#this is for "Linker->Additional dependencies"
TARGET_LINK_LIBRARIES(CbctRecon
netapi32.lib
${ITK_LIBRARIES}
${RTK_LIBRARIES}
${QT_LIBRARIES}
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${QT_QTOPENGL_LIBRARY}
${CUDA_LIBRARIES}
${CUDA_FFT_LIB}
${PLASTIMATCH_LIBRARIES}
#${DCMTK_LIBRARIES} a lot of link error.. dectection..
)