-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathCMakeLists.txt
291 lines (255 loc) · 8.85 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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
cmake_minimum_required(VERSION 2.8.11)
project(MultilinearReconstruction)
# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()
# Boost
find_package(Boost COMPONENTS filesystem timer program_options REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
link_libraries(${Boost_LIBRARIES} -lboost_filesystem -lboost_system)
# OpenCV
find_package( OpenCV REQUIRED )
if (OpenCV_FOUND)
message("-- Found OpenCV")
message("-- Linking with OpenCV libraries: ${OpenCV_LIBS}")
link_libraries(${OpenCV_LIBS})
else (OpenCV_FOUND)
message("-- OpenCV not found.")
endif()
# OpenMP
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
# OpenGL
find_package(OpenGL REQUIRED)
find_package(GLUT REQUIRED)
include_directories( ${OPENGL_INCLUDE_DIRS} ${GLUT_INCLUDE_DIRS} )
link_libraries(${OPENGL_LIBRARIES} ${GLUT_LIBRARY})
find_package(GLEW REQUIRED)
if (GLEW_FOUND)
include_directories(${GLEW_INCLUDE_DIRS})
link_libraries(${GLEW_LIBRARIES})
endif()
# Eigen
find_package(Eigen)
include_directories(${EIGEN_INCLUDE_DIR})
# SuiteSparse
set(SUITESPARSE_INCLUDE_DIR "/usr/include/suitesparse")
include_directories(${SUITESPARSE_INCLUDE_DIR})
# MKL
set(MKL_INCLUDE_DIRS "/opt/intel/mkl/include")
message([] ${MKL_INCLUDE_DIRS} )
include_directories(${MKL_INCLUDE_DIRS})
set(MKLROOT "/opt/intel/mkl")
set(MKLLIBS_DIRS "${MKLROOT}/lib/intel64/" "/opt/intel/lib/intel64_lin")
link_directories(${MKLLIBS_DIRS})
set(MKLLIBS "-Wl,--start-group -lmkl_intel_lp64 -lmkl_core -lmkl_intel_thread -Wl,--end-group -liomp5 -ldl -lpthread -lm")
# PhGLib
include_directories("$ENV{HOME}/SDKs/PhGLib/include")
link_directories("$ENV{HOME}/SDKs/PhGLib/lib")
set(PhGLib "-lPhGLib")
# Qt5
find_package(Qt5Core)
find_package(Qt5Widgets)
find_package(Qt5OpenGL)
find_package(Qt5Test)
# Ceres solver
find_package(Ceres REQUIRED)
include_directories(${CERES_INCLUDE_DIRS})
link_libraries(${CERES_LIBRARIES})
# Openmesh
set(OPENMESH_DIR "$ENV{HOME}/SDKs/OpenMesh-6.3")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${OPENMESH_DIR}/cmake)
include(ACGCommon)
include_directories("/usr/local/include")
link_libraries(OpenMeshCore OpenMeshTools)
# json
message(STATUS "Found json cpp")
message(STATUS "${CMAKE_CURRENT_LIST_DIR}/third_party/json/include")
include_directories("${CMAKE_CURRENT_LIST_DIR}/third_party/json/include")
# Targets
add_library(multilinearmodel multilinearmodel.cpp)
target_link_libraries(multilinearmodel
Qt5::Widgets
Qt5::OpenGL
${MKLLIBS}
${PhGLib})
add_library(basicmesh basicmesh.cpp)
target_link_libraries(basicmesh
Qt5::Widgets
Qt5::OpenGL
${MKLLIBS}
${PhGLib})
add_library(meshvisualizer meshvisualizer.cpp)
target_link_libraries(meshvisualizer
Qt5::Widgets
Qt5::OpenGL
${MKLLIBS}
${PhGLib})
add_library(meshvisualizer2 meshvisualizer2.cpp)
target_link_libraries(meshvisualizer2
Qt5::Widgets
Qt5::OpenGL
${MKLLIBS}
${PhGLib})
add_library(offscreenmeshvisualizer OffscreenMeshVisualizer.cpp)
target_link_libraries(offscreenmeshvisualizer
Qt5::Widgets
Qt5::OpenGL
${MKLLIBS}
${PhGLib})
add_library(tensor tensor.hpp)
target_link_libraries(tensor ${MKLLIBS})
add_library(ioutilities ioutilities.cpp)
target_link_libraries(ioutilities Qt5::Core Qt5::Widgets)
add_library(reporter reporter.cpp)
target_link_libraries(reporter ${Boost_LIBRARIES})
#configure_file(vert.glsl vert.glsl COPYONLY)
configure_file(frag.glsl frag.glsl COPYONLY)
# Single image reconstruction program
add_executable(SingleImageReconstruction singleimagereconstruction.cpp singleimagereconstructor.hpp utils.hpp ioutilities.h)
target_link_libraries(SingleImageReconstruction
meshvisualizer
meshvisualizer2
multilinearmodel
basicmesh
ioutilities
tensor
Qt5::Core
Qt5::Widgets
Qt5::OpenGL
Qt5::Test
${MKLLIBS}
${PhGLib})
# Single image reconstruction with blendshapes program
add_executable(SingleImageReconstruction_exp singleimagereconstruction_exp.cpp singleimagereconstructor_exp.hpp utils.hpp ioutilities.h)
target_link_libraries(SingleImageReconstruction_exp
meshvisualizer
meshvisualizer2
offscreenmeshvisualizer
multilinearmodel
basicmesh
ioutilities
tensor
Qt5::Core
Qt5::Widgets
Qt5::OpenGL
Qt5::Test
${MKLLIBS}
${PhGLib})
# Multiple image reconstruction program
add_executable(MultiImageReconstruction multiimagereconstruction.cpp multiimagereconstructor.h singleimagereconstructor.hpp utils.hpp multiimagereconstruction.cpp ioutilities.h)
target_link_libraries(MultiImageReconstruction
meshvisualizer
multilinearmodel
basicmesh
ioutilities
offscreenmeshvisualizer
tensor
aammodel
Qt5::Core
Qt5::Widgets
Qt5::OpenGL
Qt5::Test
${MKLLIBS}
${PhGLib})
add_executable(VideoReconstruction videoreconstruction.cpp videoreconstructor.hpp utils.hpp ioutilities.h costfunctions_exp.h)
target_link_libraries(VideoReconstruction
meshvisualizer
multilinearmodel
basicmesh
ioutilities
offscreenmeshvisualizer
tensor
aammodel
Qt5::Core
Qt5::Widgets
Qt5::OpenGL
Qt5::Test
${MKLLIBS}
${PhGLib})
# Multiple image reconstruction with blendshapes program
add_executable(MultiImageReconstruction_exp multiimagereconstruction_exp.cpp singleimagereconstructor_exp.hpp utils.hpp ioutilities.h)
target_link_libraries(MultiImageReconstruction_exp
meshvisualizer
meshvisualizer2
offscreenmeshvisualizer
multilinearmodel
basicmesh
ioutilities
tensor
aammodel
Qt5::Core
Qt5::Widgets
Qt5::OpenGL
Qt5::Test
${MKLLIBS}
${PhGLib})
# Multiple image reconstruction program for ML weights initialized using dense point clouds as constraints
add_executable(MultiImageReconstruction_dense multiimagereconstruction_dense.cpp singleimagereconstructor.hpp utils.hpp ioutilities.h)
target_link_libraries(MultiImageReconstruction_dense
meshvisualizer
meshvisualizer2
offscreenmeshvisualizer
multilinearmodel
basicmesh
ioutilities
tensor
aammodel
Qt5::Core
Qt5::Widgets
Qt5::OpenGL
Qt5::Test
${MKLLIBS}
${PhGLib})
# Multilinear model builder
add_executable(MultilinearModelBuilder multilinearmodelbuilder.cpp)
target_link_libraries(MultilinearModelBuilder multilinearmodel)
# Mesh Matcher
add_executable(mesh_matcher mesh_matcher.cpp)
target_link_libraries(mesh_matcher
meshvisualizer
meshvisualizer2
offscreenmeshvisualizer
multilinearmodel
basicmesh
ioutilities
tensor
aammodel
Qt5::Core
Qt5::Widgets
Qt5::OpenGL
Qt5::Test
${MKLLIBS}
${PhGLib})
# Mesh Visualization tool
add_executable(visualize_mesh visualize_mesh.cpp)
target_link_libraries(visualize_mesh
meshvisualizer
meshvisualizer2
offscreenmeshvisualizer
multilinearmodel
basicmesh
ioutilities
tensor
aammodel
Qt5::Core
Qt5::Widgets
Qt5::OpenGL
Qt5::Test
${MKLLIBS}
${PhGLib}
)
add_subdirectory(AAM)
add_subdirectory(ImageDedup)
add_subdirectory(tests)