CMakeLists.txt 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. # Ceres Solver - A fast non-linear least squares minimizer
  2. # Copyright 2022 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. add_executable(helloworld helloworld.cc)
  31. target_link_libraries(helloworld PRIVATE Ceres::ceres)
  32. add_executable(helloworld_numeric_diff helloworld_numeric_diff.cc)
  33. target_link_libraries(helloworld_numeric_diff PRIVATE Ceres::ceres)
  34. add_executable(helloworld_analytic_diff helloworld_analytic_diff.cc)
  35. target_link_libraries(helloworld_analytic_diff PRIVATE Ceres::ceres)
  36. add_executable(curve_fitting curve_fitting.cc)
  37. target_link_libraries(curve_fitting PRIVATE Ceres::ceres)
  38. add_executable(rosenbrock rosenbrock.cc)
  39. target_link_libraries(rosenbrock PRIVATE Ceres::ceres)
  40. add_executable(rosenbrock_analytic_diff rosenbrock_analytic_diff.cc)
  41. target_link_libraries(rosenbrock_analytic_diff PRIVATE Ceres::ceres)
  42. add_executable(rosenbrock_numeric_diff rosenbrock_numeric_diff.cc)
  43. target_link_libraries(rosenbrock_numeric_diff PRIVATE Ceres::ceres)
  44. add_executable(curve_fitting_c curve_fitting.c)
  45. target_link_libraries(curve_fitting_c PRIVATE Ceres::ceres)
  46. # Force CMake to link curve_fitting_c using the C++ linker.
  47. set_target_properties(curve_fitting_c PROPERTIES LINKER_LANGUAGE CXX)
  48. # As this is a C file #including <math.h> we have to explicitly add the math
  49. # library (libm). Although some compilers (dependent upon options) will accept
  50. # the indirect link to libm via Ceres, at least GCC 4.8 on pure Debian won't.
  51. if (HAVE_LIBM)
  52. target_link_libraries(curve_fitting_c PRIVATE m)
  53. endif (HAVE_LIBM)
  54. add_executable(ellipse_approximation ellipse_approximation.cc)
  55. target_link_libraries(ellipse_approximation PRIVATE Ceres::ceres)
  56. add_executable(robust_curve_fitting robust_curve_fitting.cc)
  57. target_link_libraries(robust_curve_fitting PRIVATE Ceres::ceres)
  58. add_executable(simple_bundle_adjuster simple_bundle_adjuster.cc)
  59. target_link_libraries(simple_bundle_adjuster PRIVATE Ceres::ceres)
  60. add_executable(bicubic_interpolation bicubic_interpolation.cc)
  61. target_link_libraries(bicubic_interpolation PRIVATE Ceres::ceres)
  62. add_executable(bicubic_interpolation_analytic bicubic_interpolation_analytic.cc)
  63. target_link_libraries(bicubic_interpolation_analytic PRIVATE Ceres::ceres)
  64. if (GFLAGS)
  65. add_executable(powell powell.cc)
  66. target_link_libraries(powell PRIVATE Ceres::ceres gflags)
  67. add_executable(nist nist.cc)
  68. target_link_libraries(nist PRIVATE Ceres::ceres gflags)
  69. if (HAVE_BIGOBJ)
  70. target_compile_options(nist PRIVATE /bigobj)
  71. endif()
  72. add_executable(more_garbow_hillstrom more_garbow_hillstrom.cc)
  73. target_link_libraries(more_garbow_hillstrom PRIVATE Ceres::ceres gflags)
  74. add_executable(circle_fit circle_fit.cc)
  75. target_link_libraries(circle_fit PRIVATE Ceres::ceres gflags)
  76. add_executable(bundle_adjuster
  77. bundle_adjuster.cc
  78. bal_problem.cc)
  79. target_link_libraries(bundle_adjuster PRIVATE Ceres::ceres gflags)
  80. add_executable(libmv_bundle_adjuster
  81. libmv_bundle_adjuster.cc)
  82. target_link_libraries(libmv_bundle_adjuster PRIVATE Ceres::ceres gflags)
  83. add_executable(libmv_homography
  84. libmv_homography.cc)
  85. target_link_libraries(libmv_homography PRIVATE Ceres::ceres gflags)
  86. add_executable(denoising
  87. denoising.cc
  88. fields_of_experts.cc)
  89. target_link_libraries(denoising PRIVATE Ceres::ceres gflags)
  90. add_executable(robot_pose_mle
  91. robot_pose_mle.cc)
  92. target_link_libraries(robot_pose_mle PRIVATE Ceres::ceres gflags)
  93. endif (GFLAGS)
  94. add_subdirectory(sampled_function)
  95. add_subdirectory(slam)