Skip to content
Snippets Groups Projects
Commit 6fb6a08b authored by Sergey Sharybin's avatar Sergey Sharybin
Browse files

Move Ceres to extern/

Even tho it's currently only used by Libmv we might use it for something
else in the future. Plus, it's actually where it logically belongs to.
parent 0b856dd9
No related branches found
No related tags found
No related merge requests found
Showing
with 59 additions and 18 deletions
......@@ -2600,6 +2600,46 @@ if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
)
endif()
#-----------------------------------------------------------------------------
# Configure Ceres
if(WITH_LIBMV)
set(CERES_DEFINES)
TEST_SHARED_PTR_SUPPORT()
if(SHARED_PTR_FOUND)
if(SHARED_PTR_TR1_MEMORY_HEADER)
list(APPEND CERES_DEFINES -DCERES_TR1_MEMORY_HEADER)
endif()
if(SHARED_PTR_TR1_NAMESPACE)
list(APPEND CERES_DEFINES -DCERES_TR1_SHARED_PTR)
endif()
else()
message(FATAL_ERROR "Ceres: Unable to find shared_ptr.")
endif()
TEST_UNORDERED_MAP_SUPPORT()
if(HAVE_STD_UNORDERED_MAP_HEADER)
if(HAVE_UNORDERED_MAP_IN_STD_NAMESPACE)
list(APPEND CERES_DEFINES -DCERES_STD_UNORDERED_MAP)
else()
if(HAVE_UNORDERED_MAP_IN_TR1_NAMESPACE)
list(APPEND CERES_DEFINES -DCERES_STD_UNORDERED_MAP_IN_TR1_NAMESPACE)
else()
list(APPEND CERES_DEFINES -DCERES_NO_UNORDERED_MAP)
message(STATUS "Ceres: Replacing unordered_map/set with map/set (warning: slower!)")
endif()
endif()
else()
if(HAVE_UNORDERED_MAP_IN_TR1_NAMESPACE)
list(APPEND CERES_DEFINES -DCERES_TR1_UNORDERED_MAP)
else()
list(APPEND CERES_DEFINES -DCERES_NO_UNORDERED_MAP)
message(STATUS "Ceres: Replacing unordered_map/set with map/set (warning: slower!)")
endif()
endif()
endif()
#-----------------------------------------------------------------------------
# Extra compile flags
......
......@@ -86,6 +86,10 @@ if(WITH_X11 AND WITH_GHOST_XDND)
add_subdirectory(xdnd)
endif()
if(WITH_LIBMV)
add_subdirectory(ceres)
endif()
if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
add_subdirectory(gflags)
add_subdirectory(glog)
......
......@@ -31,8 +31,7 @@ set(INC
include
internal
config
../../../gflags/src
../../
../gflags/src
)
set(INC_SYS
......@@ -131,6 +130,7 @@ set(SRC
include/ceres/covariance.h
include/ceres/crs_matrix.h
include/ceres/dynamic_autodiff_cost_function.h
include/ceres/dynamic_cost_function_to_functor.h
include/ceres/dynamic_numeric_diff_cost_function.h
include/ceres/fpclassify.h
include/ceres/gradient_checker.h
......@@ -153,6 +153,7 @@ set(SRC
include/ceres/loss_function.h
include/ceres/normal_prior.h
include/ceres/numeric_diff_cost_function.h
include/ceres/numeric_diff_options.h
include/ceres/ordered_groups.h
include/ceres/problem.h
include/ceres/rotation.h
......@@ -200,6 +201,7 @@ set(SRC
internal/ceres/gradient_problem_evaluator.h
internal/ceres/graph_algorithms.h
internal/ceres/graph.h
internal/ceres/householder_vector.h
internal/ceres/implicit_schur_complement.h
internal/ceres/integral_types.h
internal/ceres/iterative_schur_complement_solver.h
......@@ -298,20 +300,18 @@ endif()
if(WIN32)
list(APPEND INC
../../../glog/src/windows
../glog/src/windows
)
if(NOT MINGW)
list(APPEND INC
../msinttypes
)
endif()
else()
list(APPEND INC
../../../glog/src
../glog/src
)
endif()
add_definitions(${GFLAGS_DEFINES})
add_definitions(${GLOG_DEFINES})
add_definitions(${CERES_DEFINES})
add_definitions(
-DCERES_HAVE_PTHREAD
-DCERES_NO_SUITESPARSE
......
File moved
File moved
File moved
......@@ -124,8 +124,7 @@ set(INC
include
internal
config
../gflags
../../
../gflags/src
)
set(INC_SYS
......@@ -150,18 +149,16 @@ if(WIN32)
list(APPEND INC
../glog/src/windows
)
if(NOT MINGW)
list(APPEND INC
../msinttypes
)
endif()
else()
list(APPEND INC
../glog/src
)
endif()
add_definitions(\${GFLAGS_DEFINES})
add_definitions(\${GLOG_DEFINES})
add_definitions(\${CERES_DEFINES})
add_definitions(
-DCERES_HAVE_PTHREAD
-DCERES_NO_SUITESPARSE
......
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment