blob: 7f9b117d1bcea36e5dbffc52f355abc8ba2eab86 [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)
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080039target_link_libraries(helloworld Ceres::ceres)
Austin Schuh70cc9552019-01-21 19:46:48 -080040
41add_executable(helloworld_numeric_diff helloworld_numeric_diff.cc)
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080042target_link_libraries(helloworld_numeric_diff Ceres::ceres)
Austin Schuh70cc9552019-01-21 19:46:48 -080043
44add_executable(helloworld_analytic_diff helloworld_analytic_diff.cc)
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080045target_link_libraries(helloworld_analytic_diff Ceres::ceres)
Austin Schuh70cc9552019-01-21 19:46:48 -080046
47add_executable(curve_fitting curve_fitting.cc)
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080048target_link_libraries(curve_fitting Ceres::ceres)
Austin Schuh70cc9552019-01-21 19:46:48 -080049
50add_executable(rosenbrock rosenbrock.cc)
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080051target_link_libraries(rosenbrock Ceres::ceres)
Austin Schuh70cc9552019-01-21 19:46:48 -080052
53add_executable(curve_fitting_c curve_fitting.c)
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080054target_link_libraries(curve_fitting_c Ceres::ceres)
55# Force CMake to link curve_fitting_c using the C linker.
Austin Schuh70cc9552019-01-21 19:46:48 -080056set_target_properties(curve_fitting_c PROPERTIES LINKER_LANGUAGE C)
57# As this is a C file #including <math.h> we have to explicitly add the math
58# library (libm). Although some compilers (dependent upon options) will accept
59# the indirect link to libm via Ceres, at least GCC 4.8 on pure Debian won't.
60if (NOT MSVC)
61 target_link_libraries(curve_fitting_c m)
62endif (NOT MSVC)
63
64add_executable(ellipse_approximation ellipse_approximation.cc)
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080065target_link_libraries(ellipse_approximation Ceres::ceres)
Austin Schuh70cc9552019-01-21 19:46:48 -080066
67add_executable(robust_curve_fitting robust_curve_fitting.cc)
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080068target_link_libraries(robust_curve_fitting Ceres::ceres)
Austin Schuh70cc9552019-01-21 19:46:48 -080069
70add_executable(simple_bundle_adjuster simple_bundle_adjuster.cc)
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080071target_link_libraries(simple_bundle_adjuster Ceres::ceres)
Austin Schuh70cc9552019-01-21 19:46:48 -080072
73if (GFLAGS)
74 add_executable(powell powell.cc)
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080075 target_link_libraries(powell Ceres::ceres gflags)
Austin Schuh70cc9552019-01-21 19:46:48 -080076
77 add_executable(nist nist.cc)
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080078 target_link_libraries(nist Ceres::ceres gflags)
Austin Schuh70cc9552019-01-21 19:46:48 -080079 if (MSVC)
80 target_compile_options(nist PRIVATE "/bigobj")
81 endif()
82
83 add_executable(more_garbow_hillstrom more_garbow_hillstrom.cc)
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080084 target_link_libraries(more_garbow_hillstrom Ceres::ceres gflags)
Austin Schuh70cc9552019-01-21 19:46:48 -080085
86 add_executable(circle_fit circle_fit.cc)
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080087 target_link_libraries(circle_fit Ceres::ceres gflags)
Austin Schuh70cc9552019-01-21 19:46:48 -080088
89 add_executable(bundle_adjuster
90 bundle_adjuster.cc
91 bal_problem.cc)
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080092 target_link_libraries(bundle_adjuster Ceres::ceres gflags)
Austin Schuh70cc9552019-01-21 19:46:48 -080093
94 add_executable(libmv_bundle_adjuster
95 libmv_bundle_adjuster.cc)
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080096 target_link_libraries(libmv_bundle_adjuster Ceres::ceres gflags)
Austin Schuh70cc9552019-01-21 19:46:48 -080097
98 add_executable(libmv_homography
99 libmv_homography.cc)
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800100 target_link_libraries(libmv_homography Ceres::ceres gflags)
Austin Schuh70cc9552019-01-21 19:46:48 -0800101
102 add_executable(denoising
103 denoising.cc
104 fields_of_experts.cc)
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800105 target_link_libraries(denoising Ceres::ceres gflags)
Austin Schuh70cc9552019-01-21 19:46:48 -0800106
107 add_executable(robot_pose_mle
108 robot_pose_mle.cc)
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800109 target_link_libraries(robot_pose_mle Ceres::ceres gflags)
Austin Schuh70cc9552019-01-21 19:46:48 -0800110
111endif (GFLAGS)
112
113add_subdirectory(sampled_function)
114add_subdirectory(slam)