80e64046534dd11b40dee021d4de4c03a2ae25d3
[blender.git] / extern / libmv / CMakeLists.txt
1 # ***** BEGIN GPL LICENSE BLOCK *****
2 #
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 #
17 # The Original Code is Copyright (C) 2011, Blender Foundation
18 # All rights reserved.
19 #
20 # Contributor(s): Blender Foundation,
21 #                 Sergey Sharybin
22 #
23 # ***** END GPL LICENSE BLOCK *****
24
25 # NOTE: This file is automatically generated by bundle.sh script
26 #       If you're doing changes in this file, please update template
27 #       in that script too
28
29 set(INC
30         .
31 )
32
33 set(INC_SYS
34 )
35
36 set(SRC
37         libmv-capi.h
38 )
39
40 if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
41         list(APPEND INC
42                 third_party/gflags
43                 third_party/gflags/gflags
44                 third_party/glog/src
45                 third_party/ceres/include
46                 third_party/ceres/config
47                 ../../intern/guardedalloc
48         )
49
50         list(APPEND INC_SYS
51                 ../Eigen3
52                 ${PNG_INCLUDE_DIRS}
53                 ${ZLIB_INCLUDE_DIRS}
54         )
55
56         if(WIN32)
57                 list(APPEND INC
58                         third_party/glog/src/windows
59                 )
60
61                 if(NOT MINGW)
62                         list(APPEND INC
63                                 third_party/msinttypes
64                         )
65                 endif()
66         endif()
67
68         add_definitions(
69                 -DWITH_LIBMV_GUARDED_ALLOC
70                 -DGOOGLE_GLOG_DLL_DECL=
71                 -DLIBMV_NO_FAST_DETECTOR=
72         )
73 endif()
74
75 if(WITH_LIBMV)
76         TEST_SHARED_PTR_SUPPORT()
77         if(SHARED_PTR_FOUND)
78                 if(SHARED_PTR_TR1_MEMORY_HEADER)
79                         add_definitions(-DCERES_TR1_MEMORY_HEADER)
80                 endif()
81                 if(SHARED_PTR_TR1_NAMESPACE)
82                         add_definitions(-DCERES_TR1_SHARED_PTR)
83                 endif()
84         else()
85                 message(FATAL_ERROR "Unable to find shared_ptr.")
86         endif()
87
88         list(APPEND SRC
89                 intern/autotrack.cc
90                 intern/camera_intrinsics.cc
91                 intern/detector.cc
92                 intern/frame_accessor.cc
93                 intern/homography.cc
94                 intern/image.cc
95                 intern/logging.cc
96                 intern/reconstruction.cc
97                 intern/track_region.cc
98                 intern/tracks.cc
99                 intern/tracksN.cc
100                 libmv/autotrack/autotrack.cc
101                 libmv/autotrack/predict_tracks.cc
102                 libmv/autotrack/tracks.cc
103                 libmv/base/aligned_malloc.cc
104                 libmv/image/array_nd.cc
105                 libmv/image/convolve.cc
106                 libmv/multiview/conditioning.cc
107                 libmv/multiview/euclidean_resection.cc
108                 libmv/multiview/fundamental.cc
109                 libmv/multiview/homography.cc
110                 libmv/multiview/panography.cc
111                 libmv/multiview/panography_kernel.cc
112                 libmv/multiview/projection.cc
113                 libmv/multiview/triangulation.cc
114                 libmv/numeric/numeric.cc
115                 libmv/numeric/poly.cc
116                 libmv/simple_pipeline/bundle.cc
117                 libmv/simple_pipeline/camera_intrinsics.cc
118                 libmv/simple_pipeline/detect.cc
119                 libmv/simple_pipeline/distortion_models.cc
120                 libmv/simple_pipeline/initialize_reconstruction.cc
121                 libmv/simple_pipeline/intersect.cc
122                 libmv/simple_pipeline/keyframe_selection.cc
123                 libmv/simple_pipeline/modal_solver.cc
124                 libmv/simple_pipeline/pipeline.cc
125                 libmv/simple_pipeline/reconstruction.cc
126                 libmv/simple_pipeline/reconstruction_scale.cc
127                 libmv/simple_pipeline/resect.cc
128                 libmv/simple_pipeline/tracks.cc
129                 libmv/tracking/brute_region_tracker.cc
130                 libmv/tracking/hybrid_region_tracker.cc
131                 libmv/tracking/klt_region_tracker.cc
132                 libmv/tracking/pyramid_region_tracker.cc
133                 libmv/tracking/retrack_region_tracker.cc
134                 libmv/tracking/track_region.cc
135                 libmv/tracking/trklt_region_tracker.cc
136
137
138                 intern/autotrack.h
139                 intern/camera_intrinsics.h
140                 intern/detector.h
141                 intern/frame_accessor.h
142                 intern/homography.h
143                 intern/image.h
144                 intern/logging.h
145                 intern/reconstruction.h
146                 intern/track_region.h
147                 intern/tracks.h
148                 intern/tracksN.h
149                 libmv/autotrack/autotrack.h
150                 libmv/autotrack/callbacks.h
151                 libmv/autotrack/frame_accessor.h
152                 libmv/autotrack/marker.h
153                 libmv/autotrack/model.h
154                 libmv/autotrack/predict_tracks.h
155                 libmv/autotrack/quad.h
156                 libmv/autotrack/reconstruction.h
157                 libmv/autotrack/region.h
158                 libmv/autotrack/tracks.h
159                 libmv/base/aligned_malloc.h
160                 libmv/base/id_generator.h
161                 libmv/base/scoped_ptr.h
162                 libmv/base/vector.h
163                 libmv/base/vector_utils.h
164                 libmv/image/array_nd.h
165                 libmv/image/convolve.h
166                 libmv/image/correlation.h
167                 libmv/image/image_converter.h
168                 libmv/image/image_drawing.h
169                 libmv/image/image.h
170                 libmv/image/sample.h
171                 libmv/image/tuple.h
172                 libmv/logging/logging.h
173                 libmv/multiview/conditioning.h
174                 libmv/multiview/euclidean_resection.h
175                 libmv/multiview/fundamental.h
176                 libmv/multiview/homography_error.h
177                 libmv/multiview/homography.h
178                 libmv/multiview/homography_parameterization.h
179                 libmv/multiview/nviewtriangulation.h
180                 libmv/multiview/panography.h
181                 libmv/multiview/panography_kernel.h
182                 libmv/multiview/projection.h
183                 libmv/multiview/resection.h
184                 libmv/multiview/triangulation.h
185                 libmv/multiview/two_view_kernel.h
186                 libmv/numeric/dogleg.h
187                 libmv/numeric/function_derivative.h
188                 libmv/numeric/levenberg_marquardt.h
189                 libmv/numeric/numeric.h
190                 libmv/numeric/poly.h
191                 libmv/simple_pipeline/bundle.h
192                 libmv/simple_pipeline/callbacks.h
193                 libmv/simple_pipeline/camera_intrinsics.h
194                 libmv/simple_pipeline/camera_intrinsics_impl.h
195                 libmv/simple_pipeline/detect.h
196                 libmv/simple_pipeline/distortion_models.h
197                 libmv/simple_pipeline/initialize_reconstruction.h
198                 libmv/simple_pipeline/intersect.h
199                 libmv/simple_pipeline/keyframe_selection.h
200                 libmv/simple_pipeline/modal_solver.h
201                 libmv/simple_pipeline/pipeline.h
202                 libmv/simple_pipeline/reconstruction.h
203                 libmv/simple_pipeline/reconstruction_scale.h
204                 libmv/simple_pipeline/resect.h
205                 libmv/simple_pipeline/tracks.h
206                 libmv/tracking/brute_region_tracker.h
207                 libmv/tracking/hybrid_region_tracker.h
208                 libmv/tracking/kalman_filter.h
209                 libmv/tracking/klt_region_tracker.h
210                 libmv/tracking/pyramid_region_tracker.h
211                 libmv/tracking/region_tracker.h
212                 libmv/tracking/retrack_region_tracker.h
213                 libmv/tracking/track_region.h
214                 libmv/tracking/trklt_region_tracker.h
215
216                 third_party/msinttypes/inttypes.h
217                 third_party/msinttypes/stdint.h
218         )
219
220
221         if(WITH_GTESTS)
222                 blender_add_lib(libmv_test_dataset "./libmv/multiview/test_data_sets.cc" "" "")
223
224                 BLENDER_SRC_GTEST("libmv_predict_tracks" "./libmv/autotrack/predict_tracks_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
225                 BLENDER_SRC_GTEST("libmv_tracks" "./libmv/autotrack/tracks_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
226                 BLENDER_SRC_GTEST("libmv_scoped_ptr" "./libmv/base/scoped_ptr_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
227                 BLENDER_SRC_GTEST("libmv_vector" "./libmv/base/vector_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
228                 BLENDER_SRC_GTEST("libmv_array_nd" "./libmv/image/array_nd_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
229                 BLENDER_SRC_GTEST("libmv_convolve" "./libmv/image/convolve_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
230                 BLENDER_SRC_GTEST("libmv_image" "./libmv/image/image_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
231                 BLENDER_SRC_GTEST("libmv_sample" "./libmv/image/sample_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
232                 BLENDER_SRC_GTEST("libmv_tuple" "./libmv/image/tuple_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
233                 BLENDER_SRC_GTEST("libmv_euclidean_resection" "./libmv/multiview/euclidean_resection_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
234                 BLENDER_SRC_GTEST("libmv_fundamental" "./libmv/multiview/fundamental_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
235                 BLENDER_SRC_GTEST("libmv_homography" "./libmv/multiview/homography_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
236                 BLENDER_SRC_GTEST("libmv_nviewtriangulation" "./libmv/multiview/nviewtriangulation_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
237                 BLENDER_SRC_GTEST("libmv_panography" "./libmv/multiview/panography_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
238                 BLENDER_SRC_GTEST("libmv_projection" "./libmv/multiview/projection_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
239                 BLENDER_SRC_GTEST("libmv_resection" "./libmv/multiview/resection_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
240                 BLENDER_SRC_GTEST("libmv_triangulation" "./libmv/multiview/triangulation_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
241                 BLENDER_SRC_GTEST("libmv_dogleg" "./libmv/numeric/dogleg_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
242                 BLENDER_SRC_GTEST("libmv_function_derivative" "./libmv/numeric/function_derivative_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
243                 BLENDER_SRC_GTEST("libmv_levenberg_marquardt" "./libmv/numeric/levenberg_marquardt_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
244                 BLENDER_SRC_GTEST("libmv_numeric" "./libmv/numeric/numeric_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
245                 BLENDER_SRC_GTEST("libmv_poly" "./libmv/numeric/poly_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
246                 BLENDER_SRC_GTEST("libmv_camera_intrinsics" "./libmv/simple_pipeline/camera_intrinsics_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
247                 BLENDER_SRC_GTEST("libmv_detect" "./libmv/simple_pipeline/detect_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
248                 BLENDER_SRC_GTEST("libmv_intersect" "./libmv/simple_pipeline/intersect_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
249                 BLENDER_SRC_GTEST("libmv_keyframe_selection" "./libmv/simple_pipeline/keyframe_selection_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
250                 BLENDER_SRC_GTEST("libmv_modal_solver" "./libmv/simple_pipeline/modal_solver_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
251                 BLENDER_SRC_GTEST("libmv_resect" "./libmv/simple_pipeline/resect_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
252                 BLENDER_SRC_GTEST("libmv_brute_region_tracker" "./libmv/tracking/brute_region_tracker_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
253                 BLENDER_SRC_GTEST("libmv_klt_region_tracker" "./libmv/tracking/klt_region_tracker_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
254                 BLENDER_SRC_GTEST("libmv_pyramid_region_tracker" "./libmv/tracking/pyramid_region_tracker_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
255         endif()
256 else()
257         list(APPEND SRC
258                 intern/stub.cc
259         )
260 endif()
261
262 blender_add_lib(extern_libmv "${SRC}" "${INC}" "${INC_SYS}")
263
264 if(WITH_LIBMV)
265         add_subdirectory(third_party)
266 endif()
267
268 # make GLog a separate target, so it can be used for gtest as well.
269 if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
270         # We compile GLog together with GFlag so we don't worry about
271         # adding extra lib to linker.
272         set(GLOG_SRC
273                 third_party/gflags/gflags.cc
274                 third_party/gflags/gflags_completions.cc
275                 third_party/gflags/gflags_reporting.cc
276
277                 third_party/gflags/config.h
278                 third_party/gflags/gflags/gflags_completions.h
279                 third_party/gflags/gflags/gflags_declare.h
280                 third_party/gflags/gflags/gflags.h
281                 third_party/gflags/mutex.h
282                 third_party/gflags/util.h
283         )
284
285         if(WIN32)
286                 list(APPEND GLOG_SRC
287                         third_party/glog/src/logging.cc
288                         third_party/glog/src/raw_logging.cc
289                         third_party/glog/src/utilities.cc
290                         third_party/glog/src/vlog_is_on.cc
291                         third_party/glog/src/windows/port.cc
292
293                         third_party/glog/src/utilities.h
294                         third_party/glog/src/stacktrace_generic-inl.h
295                         third_party/glog/src/stacktrace.h
296                         third_party/glog/src/stacktrace_x86_64-inl.h
297                         third_party/glog/src/base/googleinit.h
298                         third_party/glog/src/base/mutex.h
299                         third_party/glog/src/base/commandlineflags.h
300                         third_party/glog/src/stacktrace_powerpc-inl.h
301                         third_party/glog/src/stacktrace_x86-inl.h
302                         third_party/glog/src/config.h
303                         third_party/glog/src/stacktrace_libunwind-inl.h
304                         third_party/glog/src/windows/glog/raw_logging.h
305                         third_party/glog/src/windows/glog/vlog_is_on.h
306                         third_party/glog/src/windows/glog/logging.h
307                         third_party/glog/src/windows/glog/log_severity.h
308                         third_party/glog/src/windows/port.h
309                         third_party/glog/src/windows/config.h
310
311                         third_party/gflags/windows_port.cc
312                         third_party/gflags/windows_port.h
313                 )
314         else()
315                 list(APPEND GLOG_SRC
316                         third_party/glog/src/demangle.cc
317                         third_party/glog/src/logging.cc
318                         third_party/glog/src/raw_logging.cc
319                         third_party/glog/src/signalhandler.cc
320                         third_party/glog/src/symbolize.cc
321                         third_party/glog/src/utilities.cc
322                         third_party/glog/src/vlog_is_on.cc
323
324                         third_party/glog/src/base/commandlineflags.h
325                         third_party/glog/src/base/googleinit.h
326                         third_party/glog/src/base/mutex.h
327                         third_party/glog/src/config_freebsd.h
328                         third_party/glog/src/config.h
329                         third_party/glog/src/config_hurd.h
330                         third_party/glog/src/config_linux.h
331                         third_party/glog/src/config_mac.h
332                         third_party/glog/src/demangle.h
333                         third_party/glog/src/glog/logging.h
334                         third_party/glog/src/glog/log_severity.h
335                         third_party/glog/src/glog/raw_logging.h
336                         third_party/glog/src/glog/vlog_is_on.h
337                         third_party/glog/src/stacktrace_generic-inl.h
338                         third_party/glog/src/stacktrace.h
339                         third_party/glog/src/stacktrace_libunwind-inl.h
340                         third_party/glog/src/stacktrace_powerpc-inl.h
341                         third_party/glog/src/stacktrace_x86_64-inl.h
342                         third_party/glog/src/stacktrace_x86-inl.h
343                         third_party/glog/src/symbolize.h
344                         third_party/glog/src/utilities.h
345                 )
346         endif()
347
348         blender_add_lib(extern_glog "${GLOG_SRC}" "${INC}" "${INC_SYS}")
349 endif()