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