blob: eef5e5e127b754e427308e2ef8dd930350e94dc5 [file] [log] [blame]
Keir Mierle8ebb0732012-04-30 23:09:08 -07001# Ceres Solver - A fast non-linear least squares minimizer
Keir Mierle7492b0d2015-03-17 22:30:16 -07002# Copyright 2015 Google Inc. All rights reserved.
3# http://ceres-solver.org/
Keir Mierle8ebb0732012-04-30 23:09:08 -07004#
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
Alex Stewartea765852014-05-07 20:46:17 +010031# 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.
Alex Stewartcc8d47a2015-08-09 15:18:42 +010034if (BUILD_SHARED_LIBS)
35 remove_definitions(-DCERES_BUILDING_SHARED_LIBRARY)
36endif()
Björn Piltz5d7eed82014-04-23 22:13:37 +020037
Alex Stewartcc8d47a2015-08-09 15:18:42 +010038add_executable(helloworld helloworld.cc)
39target_link_libraries(helloworld ceres)
Sameer Agarwalfaf33e62012-07-15 15:46:10 -070040
Alex Stewartcc8d47a2015-08-09 15:18:42 +010041add_executable(helloworld_numeric_diff helloworld_numeric_diff.cc)
42target_link_libraries(helloworld_numeric_diff ceres)
Sameer Agarwal085cd4a2013-02-06 14:31:07 -080043
Alex Stewartcc8d47a2015-08-09 15:18:42 +010044add_executable(helloworld_analytic_diff helloworld_analytic_diff.cc)
45target_link_libraries(helloworld_analytic_diff ceres)
Sameer Agarwal085cd4a2013-02-06 14:31:07 -080046
Alex Stewartcc8d47a2015-08-09 15:18:42 +010047add_executable(curve_fitting curve_fitting.cc)
48target_link_libraries(curve_fitting ceres)
Sameer Agarwal085cd4a2013-02-06 14:31:07 -080049
Alex Stewartcc8d47a2015-08-09 15:18:42 +010050add_executable(rosenbrock rosenbrock.cc)
51target_link_libraries(rosenbrock ceres)
Sameer Agarwal092b9492014-09-05 11:56:29 -070052
Alex Stewartcc8d47a2015-08-09 15:18:42 +010053add_executable(curve_fitting_c curve_fitting.c)
54target_link_libraries(curve_fitting_c ceres)
Alex Stewart6414bd02015-05-03 13:52:05 +010055# 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.
Alex Stewartcc8d47a2015-08-09 15:18:42 +010058set_target_properties(curve_fitting_c PROPERTIES LINKER_LANGUAGE C)
Alex Stewart6a2bcaa2013-10-23 14:06:44 +010059# 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.
Alex Stewartcc8d47a2015-08-09 15:18:42 +010062if (NOT MSVC)
63 target_link_libraries(curve_fitting_c m)
64endif (NOT MSVC)
Keir Mierlef9566152013-05-07 02:59:32 -070065
Alex Stewartcc8d47a2015-08-09 15:18:42 +010066add_executable(ellipse_approximation ellipse_approximation.cc)
67target_link_libraries(ellipse_approximation ceres)
Richard Stebbing32530782014-04-26 07:42:23 +010068
Alex Stewartcc8d47a2015-08-09 15:18:42 +010069add_executable(robust_curve_fitting robust_curve_fitting.cc)
70target_link_libraries(robust_curve_fitting ceres)
Sameer Agarwal085cd4a2013-02-06 14:31:07 -080071
Alex Stewartcc8d47a2015-08-09 15:18:42 +010072add_executable(simple_bundle_adjuster simple_bundle_adjuster.cc)
73target_link_libraries(simple_bundle_adjuster ceres)
Sameer Agarwal085cd4a2013-02-06 14:31:07 -080074
Alex Stewartcc8d47a2015-08-09 15:18:42 +010075if (GFLAGS)
Alex Stewartcc8d47a2015-08-09 15:18:42 +010076 add_executable(powell powell.cc)
77 target_link_libraries(powell ceres ${GFLAGS_LIBRARIES})
Alex Stewart9aa0e3c2013-07-05 20:22:37 +010078
Alex Stewartcc8d47a2015-08-09 15:18:42 +010079 add_executable(nist nist.cc)
80 target_link_libraries(nist ceres ${GFLAGS_LIBRARIES})
Sameer Agarwalea117042012-08-29 18:18:48 -070081
Alex Stewartcc8d47a2015-08-09 15:18:42 +010082 add_executable(more_garbow_hillstrom more_garbow_hillstrom.cc)
83 target_link_libraries(more_garbow_hillstrom ceres ${GFLAGS_LIBRARIES})
Sameer Agarwal840c89f2014-02-18 09:36:21 -080084
Alex Stewartcc8d47a2015-08-09 15:18:42 +010085 add_executable(circle_fit circle_fit.cc)
86 target_link_libraries(circle_fit ceres ${GFLAGS_LIBRARIES})
Keir Mierle8ebb0732012-04-30 23:09:08 -070087
Alex Stewartcc8d47a2015-08-09 15:18:42 +010088 add_executable(bundle_adjuster
Sameer Agarwaldaa98242012-05-11 11:26:38 -070089 bundle_adjuster.cc
90 bal_problem.cc)
Alex Stewartcc8d47a2015-08-09 15:18:42 +010091 target_link_libraries(bundle_adjuster ceres ${GFLAGS_LIBRARIES})
Petter Strandmarkfce6aeb2012-08-21 11:00:55 -070092
Alex Stewartcc8d47a2015-08-09 15:18:42 +010093 add_executable(libmv_bundle_adjuster
Sergey Sharybin9869c3d2013-05-10 13:28:15 +060094 libmv_bundle_adjuster.cc)
Alex Stewartcc8d47a2015-08-09 15:18:42 +010095 target_link_libraries(libmv_bundle_adjuster ceres ${GFLAGS_LIBRARIES})
Sergey Sharybin9869c3d2013-05-10 13:28:15 +060096
Alex Stewartcc8d47a2015-08-09 15:18:42 +010097 add_executable(libmv_homography
Sergey Sharybin36c2ce82014-01-13 21:18:08 +060098 libmv_homography.cc)
Alex Stewartcc8d47a2015-08-09 15:18:42 +010099 target_link_libraries(libmv_homography ceres ${GFLAGS_LIBRARIES})
Sergey Sharybin36c2ce82014-01-13 21:18:08 +0600100
Alex Stewartcc8d47a2015-08-09 15:18:42 +0100101 add_executable(denoising
Petter Strandmarkfce6aeb2012-08-21 11:00:55 -0700102 denoising.cc
103 fields_of_experts.cc)
Alex Stewartcc8d47a2015-08-09 15:18:42 +0100104 target_link_libraries(denoising ceres ${GFLAGS_LIBRARIES})
Joydeep Biswas8e099132014-04-22 10:40:47 -0400105
Alex Stewartcc8d47a2015-08-09 15:18:42 +0100106 add_executable(robot_pose_mle
Joydeep Biswas8e099132014-04-22 10:40:47 -0400107 robot_pose_mle.cc)
Alex Stewartcc8d47a2015-08-09 15:18:42 +0100108 target_link_libraries(robot_pose_mle ceres ${GFLAGS_LIBRARIES})
Joydeep Biswas8e099132014-04-22 10:40:47 -0400109
Alex Stewartcc8d47a2015-08-09 15:18:42 +0100110endif (GFLAGS)
Mike Vitusa04490b2016-07-14 10:10:13 -0700111
Mike Vitusf5546812016-07-25 18:30:48 -0700112add_subdirectory(sampled_function)
Alex Stewart29888182016-11-12 18:36:28 +0000113add_subdirectory(slam)