blob: 3d86be8e2de7977e59bcda10b7b06697941b480f [file] [log] [blame]
Austin Schuh70cc9552019-01-21 19:46:48 -08001# Ceres Solver - A fast non-linear least squares minimizer
2# Copyright 2015 Google Inc. All rights reserved.
3# http://ceres-solver.org/
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are met:
7#
8# * Redistributions of source code must retain the above copyright notice,
9# this list of conditions and the following disclaimer.
10# * Redistributions in binary form must reproduce the above copyright notice,
11# this list of conditions and the following disclaimer in the documentation
12# and/or other materials provided with the distribution.
13# * Neither the name of Google Inc. nor the names of its contributors may be
14# used to endorse or promote products derived from this software without
15# specific prior written permission.
16#
17# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27# POSSIBILITY OF SUCH DAMAGE.
28#
29# Author: keir@google.com (Keir Mierle)
30
31# Only Ceres itself should be compiled with CERES_BUILDING_SHARED_LIBRARY
32# defined, any users of Ceres will have CERES_USING_SHARED_LIBRARY defined
33# for them in Ceres' config.h if appropriate.
34if (BUILD_SHARED_LIBS)
35 remove_definitions(-DCERES_BUILDING_SHARED_LIBRARY)
36endif()
37
38add_executable(helloworld helloworld.cc)
39target_link_libraries(helloworld ceres)
40
41add_executable(helloworld_numeric_diff helloworld_numeric_diff.cc)
42target_link_libraries(helloworld_numeric_diff ceres)
43
44add_executable(helloworld_analytic_diff helloworld_analytic_diff.cc)
45target_link_libraries(helloworld_analytic_diff ceres)
46
47add_executable(curve_fitting curve_fitting.cc)
48target_link_libraries(curve_fitting ceres)
49
50add_executable(rosenbrock rosenbrock.cc)
51target_link_libraries(rosenbrock ceres)
52
53add_executable(curve_fitting_c curve_fitting.c)
54target_link_libraries(curve_fitting_c ceres)
55# Force CMake to link curve_fitting_c using the C linker, this is important
56# when Ceres was compiled using C++11 to ensure that -std=c++11 is not passed
57# through.
58set_target_properties(curve_fitting_c PROPERTIES LINKER_LANGUAGE C)
59# As this is a C file #including <math.h> we have to explicitly add the math
60# library (libm). Although some compilers (dependent upon options) will accept
61# the indirect link to libm via Ceres, at least GCC 4.8 on pure Debian won't.
62if (NOT MSVC)
63 target_link_libraries(curve_fitting_c m)
64endif (NOT MSVC)
65
66add_executable(ellipse_approximation ellipse_approximation.cc)
67target_link_libraries(ellipse_approximation ceres)
68
69add_executable(robust_curve_fitting robust_curve_fitting.cc)
70target_link_libraries(robust_curve_fitting ceres)
71
72add_executable(simple_bundle_adjuster simple_bundle_adjuster.cc)
73target_link_libraries(simple_bundle_adjuster ceres)
74
75if (GFLAGS)
76 add_executable(powell powell.cc)
77 target_link_libraries(powell ceres ${GFLAGS_LIBRARIES})
78
79 add_executable(nist nist.cc)
80 target_link_libraries(nist ceres ${GFLAGS_LIBRARIES})
81 if (MSVC)
82 target_compile_options(nist PRIVATE "/bigobj")
83 endif()
84
85 add_executable(more_garbow_hillstrom more_garbow_hillstrom.cc)
86 target_link_libraries(more_garbow_hillstrom ceres ${GFLAGS_LIBRARIES})
87
88 add_executable(circle_fit circle_fit.cc)
89 target_link_libraries(circle_fit ceres ${GFLAGS_LIBRARIES})
90
91 add_executable(bundle_adjuster
92 bundle_adjuster.cc
93 bal_problem.cc)
94 target_link_libraries(bundle_adjuster ceres ${GFLAGS_LIBRARIES})
95
96 add_executable(libmv_bundle_adjuster
97 libmv_bundle_adjuster.cc)
98 target_link_libraries(libmv_bundle_adjuster ceres ${GFLAGS_LIBRARIES})
99
100 add_executable(libmv_homography
101 libmv_homography.cc)
102 target_link_libraries(libmv_homography ceres ${GFLAGS_LIBRARIES})
103
104 add_executable(denoising
105 denoising.cc
106 fields_of_experts.cc)
107 target_link_libraries(denoising ceres ${GFLAGS_LIBRARIES})
108
109 add_executable(robot_pose_mle
110 robot_pose_mle.cc)
111 target_link_libraries(robot_pose_mle ceres ${GFLAGS_LIBRARIES})
112
113endif (GFLAGS)
114
115add_subdirectory(sampled_function)
116add_subdirectory(slam)