5388570abecfd47ffb8082e14c8b780bdf12abda
[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         libmv-capi_intern.h
39 )
40
41 if(WITH_LIBMV)
42         add_definitions(
43                 -DWITH_LIBMV
44                 -DWITH_LIBMV_GUARDED_ALLOC
45                 -DGOOGLE_GLOG_DLL_DECL=
46                 -DLIBMV_NO_FAST_DETECTOR=
47         )
48
49         TEST_SHARED_PTR_SUPPORT()
50         if(SHARED_PTR_FOUND)
51                 if(SHARED_PTR_TR1_MEMORY_HEADER)
52                         add_definitions(-DCERES_TR1_MEMORY_HEADER)
53                 endif()
54                 if(SHARED_PTR_TR1_NAMESPACE)
55                         add_definitions(-DCERES_TR1_SHARED_PTR)
56                 endif()
57         else()
58                 message(FATAL_ERROR "Unable to find shared_ptr.")
59         endif()
60
61         list(APPEND INC
62                 third_party/gflags
63                 third_party/glog/src
64                 third_party/ceres/include
65                 third_party/ceres/config
66                 ../../intern/guardedalloc
67         )
68
69         set(INC_SYS
70                 ../Eigen3
71                 ${PNG_INCLUDE_DIR}
72                 ${ZLIB_INCLUDE_DIRS}
73         )
74
75         list(APPEND SRC
76                 libmv-capi.cc
77                 libmv-util.cc
78                 libmv/base/aligned_malloc.cc
79                 libmv/image/array_nd.cc
80                 libmv/image/convolve.cc
81                 libmv/multiview/conditioning.cc
82                 libmv/multiview/euclidean_resection.cc
83                 libmv/multiview/fundamental.cc
84                 libmv/multiview/homography.cc
85                 libmv/multiview/panography.cc
86                 libmv/multiview/panography_kernel.cc
87                 libmv/multiview/projection.cc
88                 libmv/multiview/triangulation.cc
89                 libmv/numeric/numeric.cc
90                 libmv/numeric/poly.cc
91                 libmv/simple_pipeline/bundle.cc
92                 libmv/simple_pipeline/camera_intrinsics.cc
93                 libmv/simple_pipeline/detect.cc
94                 libmv/simple_pipeline/distortion_models.cc
95                 libmv/simple_pipeline/initialize_reconstruction.cc
96                 libmv/simple_pipeline/intersect.cc
97                 libmv/simple_pipeline/keyframe_selection.cc
98                 libmv/simple_pipeline/modal_solver.cc
99                 libmv/simple_pipeline/pipeline.cc
100                 libmv/simple_pipeline/reconstruction.cc
101                 libmv/simple_pipeline/reconstruction_scale.cc
102                 libmv/simple_pipeline/resect.cc
103                 libmv/simple_pipeline/tracks.cc
104                 libmv/tracking/brute_region_tracker.cc
105                 libmv/tracking/hybrid_region_tracker.cc
106                 libmv/tracking/klt_region_tracker.cc
107                 libmv/tracking/pyramid_region_tracker.cc
108                 libmv/tracking/retrack_region_tracker.cc
109                 libmv/tracking/track_region.cc
110                 libmv/tracking/trklt_region_tracker.cc
111
112                 libmv-util.h
113                 libmv/base/aligned_malloc.h
114                 libmv/base/id_generator.h
115                 libmv/base/scoped_ptr.h
116                 libmv/base/vector.h
117                 libmv/base/vector_utils.h
118                 libmv/image/array_nd.h
119                 libmv/image/convolve.h
120                 libmv/image/correlation.h
121                 libmv/image/image_converter.h
122                 libmv/image/image_drawing.h
123                 libmv/image/image.h
124                 libmv/image/sample.h
125                 libmv/image/tuple.h
126                 libmv/logging/logging.h
127                 libmv/multiview/conditioning.h
128                 libmv/multiview/euclidean_resection.h
129                 libmv/multiview/fundamental.h
130                 libmv/multiview/homography_error.h
131                 libmv/multiview/homography.h
132                 libmv/multiview/homography_parameterization.h
133                 libmv/multiview/nviewtriangulation.h
134                 libmv/multiview/panography.h
135                 libmv/multiview/panography_kernel.h
136                 libmv/multiview/projection.h
137                 libmv/multiview/resection.h
138                 libmv/multiview/triangulation.h
139                 libmv/multiview/two_view_kernel.h
140                 libmv/numeric/dogleg.h
141                 libmv/numeric/function_derivative.h
142                 libmv/numeric/levenberg_marquardt.h
143                 libmv/numeric/numeric.h
144                 libmv/numeric/poly.h
145                 libmv/simple_pipeline/bundle.h
146                 libmv/simple_pipeline/callbacks.h
147                 libmv/simple_pipeline/camera_intrinsics.h
148                 libmv/simple_pipeline/camera_intrinsics_impl.h
149                 libmv/simple_pipeline/detect.h
150                 libmv/simple_pipeline/distortion_models.h
151                 libmv/simple_pipeline/initialize_reconstruction.h
152                 libmv/simple_pipeline/intersect.h
153                 libmv/simple_pipeline/keyframe_selection.h
154                 libmv/simple_pipeline/modal_solver.h
155                 libmv/simple_pipeline/pipeline.h
156                 libmv/simple_pipeline/reconstruction.h
157                 libmv/simple_pipeline/reconstruction_scale.h
158                 libmv/simple_pipeline/resect.h
159                 libmv/simple_pipeline/tracks.h
160                 libmv/tracking/brute_region_tracker.h
161                 libmv/tracking/hybrid_region_tracker.h
162                 libmv/tracking/klt_region_tracker.h
163                 libmv/tracking/pyramid_region_tracker.h
164                 libmv/tracking/region_tracker.h
165                 libmv/tracking/retrack_region_tracker.h
166                 libmv/tracking/track_region.h
167                 libmv/tracking/trklt_region_tracker.h
168
169                 third_party/msinttypes/inttypes.h
170                 third_party/msinttypes/stdint.h
171         )
172
173         if(WIN32)
174                 list(APPEND INC
175                         third_party/glog/src/windows
176                 )
177
178                 if(NOT MINGW)
179                         list(APPEND INC
180                                 third_party/msinttypes
181                         )
182                 endif()
183         endif()
184
185         if(WITH_GTESTS)
186                 blender_add_lib(libmv_test_dataset "./libmv/multiview/test_data_sets.cc" "" "")
187
188                 BLENDER_SRC_GTEST("libmv_scoped_ptr" "./libmv/base/scoped_ptr_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
189                 BLENDER_SRC_GTEST("libmv_vector" "./libmv/base/vector_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
190                 BLENDER_SRC_GTEST("libmv_array_nd" "./libmv/image/array_nd_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
191                 BLENDER_SRC_GTEST("libmv_convolve" "./libmv/image/convolve_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
192                 BLENDER_SRC_GTEST("libmv_image" "./libmv/image/image_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
193                 BLENDER_SRC_GTEST("libmv_sample" "./libmv/image/sample_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
194                 BLENDER_SRC_GTEST("libmv_tuple" "./libmv/image/tuple_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
195                 BLENDER_SRC_GTEST("libmv_euclidean_resection" "./libmv/multiview/euclidean_resection_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
196                 BLENDER_SRC_GTEST("libmv_fundamental" "./libmv/multiview/fundamental_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
197                 BLENDER_SRC_GTEST("libmv_homography" "./libmv/multiview/homography_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
198                 BLENDER_SRC_GTEST("libmv_nviewtriangulation" "./libmv/multiview/nviewtriangulation_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
199                 BLENDER_SRC_GTEST("libmv_panography" "./libmv/multiview/panography_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
200                 BLENDER_SRC_GTEST("libmv_projection" "./libmv/multiview/projection_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
201                 BLENDER_SRC_GTEST("libmv_resection" "./libmv/multiview/resection_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
202                 BLENDER_SRC_GTEST("libmv_triangulation" "./libmv/multiview/triangulation_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
203                 BLENDER_SRC_GTEST("libmv_dogleg" "./libmv/numeric/dogleg_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
204                 BLENDER_SRC_GTEST("libmv_function_derivative" "./libmv/numeric/function_derivative_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
205                 BLENDER_SRC_GTEST("libmv_levenberg_marquardt" "./libmv/numeric/levenberg_marquardt_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
206                 BLENDER_SRC_GTEST("libmv_numeric" "./libmv/numeric/numeric_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
207                 BLENDER_SRC_GTEST("libmv_poly" "./libmv/numeric/poly_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
208                 BLENDER_SRC_GTEST("libmv_camera_intrinsics" "./libmv/simple_pipeline/camera_intrinsics_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
209                 BLENDER_SRC_GTEST("libmv_detect" "./libmv/simple_pipeline/detect_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
210                 BLENDER_SRC_GTEST("libmv_intersect" "./libmv/simple_pipeline/intersect_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
211                 BLENDER_SRC_GTEST("libmv_keyframe_selection" "./libmv/simple_pipeline/keyframe_selection_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
212                 BLENDER_SRC_GTEST("libmv_modal_solver" "./libmv/simple_pipeline/modal_solver_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
213                 BLENDER_SRC_GTEST("libmv_resect" "./libmv/simple_pipeline/resect_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
214                 BLENDER_SRC_GTEST("libmv_brute_region_tracker" "./libmv/tracking/brute_region_tracker_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
215                 BLENDER_SRC_GTEST("libmv_klt_region_tracker" "./libmv/tracking/klt_region_tracker_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
216                 BLENDER_SRC_GTEST("libmv_pyramid_region_tracker" "./libmv/tracking/pyramid_region_tracker_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
217         endif()
218 else()
219         list(APPEND SRC
220                 libmv-capi_stub.cc
221         )
222 endif()
223
224 blender_add_lib(extern_libmv "${SRC}" "${INC}" "${INC_SYS}")
225
226 if(WITH_LIBMV)
227         add_subdirectory(third_party)
228 endif()
229
230 # make GLog a separate target, so it can be used for gtest as well.
231 if(WITH_LIBMV OR WITH_GTESTS)
232         # We compile GLog together with GFlag so we don't worry about
233         # adding extra lib to linker.
234         set(GLOG_SRC
235                 third_party/gflags/gflags.cc
236                 third_party/gflags/gflags_completions.cc
237                 third_party/gflags/gflags_reporting.cc
238
239                 third_party/gflags/config.h
240                 third_party/gflags/gflags/gflags_completions.h
241                 third_party/gflags/gflags/gflags_declare.h
242                 third_party/gflags/gflags/gflags.h
243                 third_party/gflags/mutex.h
244                 third_party/gflags/util.h
245         )
246
247         if(WIN32)
248                 list(APPEND GLOG_SRC
249                         third_party/glog/src/logging.cc
250                         third_party/glog/src/raw_logging.cc
251                         third_party/glog/src/utilities.cc
252                         third_party/glog/src/vlog_is_on.cc
253                         third_party/glog/src/windows/port.cc
254
255                         third_party/glog/src/utilities.h
256                         third_party/glog/src/stacktrace_generic-inl.h
257                         third_party/glog/src/stacktrace.h
258                         third_party/glog/src/stacktrace_x86_64-inl.h
259                         third_party/glog/src/base/googleinit.h
260                         third_party/glog/src/base/mutex.h
261                         third_party/glog/src/base/commandlineflags.h
262                         third_party/glog/src/stacktrace_powerpc-inl.h
263                         third_party/glog/src/stacktrace_x86-inl.h
264                         third_party/glog/src/config.h
265                         third_party/glog/src/stacktrace_libunwind-inl.h
266                         third_party/glog/src/windows/glog/raw_logging.h
267                         third_party/glog/src/windows/glog/vlog_is_on.h
268                         third_party/glog/src/windows/glog/logging.h
269                         third_party/glog/src/windows/glog/log_severity.h
270                         third_party/glog/src/windows/port.h
271                         third_party/glog/src/windows/config.h
272                 )
273         else()
274                 list(APPEND GLOG_SRC
275                         third_party/glog/src/demangle.cc
276                         third_party/glog/src/logging.cc
277                         third_party/glog/src/raw_logging.cc
278                         third_party/glog/src/signalhandler.cc
279                         third_party/glog/src/symbolize.cc
280                         third_party/glog/src/utilities.cc
281                         third_party/glog/src/vlog_is_on.cc
282
283                         third_party/glog/src/base/commandlineflags.h
284                         third_party/glog/src/base/googleinit.h
285                         third_party/glog/src/base/mutex.h
286                         third_party/glog/src/config_freebsd.h
287                         third_party/glog/src/config.h
288                         third_party/glog/src/config_hurd.h
289                         third_party/glog/src/config_linux.h
290                         third_party/glog/src/config_mac.h
291                         third_party/glog/src/demangle.h
292                         third_party/glog/src/glog/logging.h
293                         third_party/glog/src/glog/log_severity.h
294                         third_party/glog/src/glog/raw_logging.h
295                         third_party/glog/src/glog/vlog_is_on.h
296                         third_party/glog/src/stacktrace_generic-inl.h
297                         third_party/glog/src/stacktrace.h
298                         third_party/glog/src/stacktrace_libunwind-inl.h
299                         third_party/glog/src/stacktrace_powerpc-inl.h
300                         third_party/glog/src/stacktrace_x86_64-inl.h
301                         third_party/glog/src/stacktrace_x86-inl.h
302                         third_party/glog/src/symbolize.h
303                         third_party/glog/src/utilities.h
304                 )
305         endif()
306
307         set(GLOG_INC
308                 third_party/gflags
309                 third_party/glog/src
310         )
311
312         set(GLOG_INC_SYS
313         )
314
315         blender_add_lib(extern_glog "${GLOG_SRC}" "${GLOG_INC}" "${GLOG_INC_SYS}")
316 endif()