Skip to content

Commit 49adda6

Browse files
committed
first commit
1 parent d349242 commit 49adda6

File tree

253 files changed

+56128
-11
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

253 files changed

+56128
-11
lines changed

Doxyfile

+2,479
Large diffs are not rendered by default.

cmake/FindEigen3.cmake

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# - Try to find Eigen3 lib
2+
#
3+
# This module supports requiring a minimum version, e.g. you can do
4+
# find_package(Eigen3 3.1.2)
5+
# to require version 3.1.2 or newer of Eigen3.
6+
#
7+
# Once done this will define
8+
#
9+
# EIGEN3_FOUND - system has eigen lib with correct version
10+
# EIGEN3_INCLUDE_DIR - the eigen include directory
11+
# EIGEN3_VERSION - eigen version
12+
13+
# Copyright (c) 2006, 2007 Montel Laurent, <[email protected]>
14+
# Copyright (c) 2008, 2009 Gael Guennebaud, <[email protected]>
15+
# Copyright (c) 2009 Benoit Jacob <[email protected]>
16+
# Redistribution and use is allowed according to the terms of the 2-clause BSD license.
17+
18+
if(NOT Eigen3_FIND_VERSION)
19+
if(NOT Eigen3_FIND_VERSION_MAJOR)
20+
set(Eigen3_FIND_VERSION_MAJOR 2)
21+
endif(NOT Eigen3_FIND_VERSION_MAJOR)
22+
if(NOT Eigen3_FIND_VERSION_MINOR)
23+
set(Eigen3_FIND_VERSION_MINOR 91)
24+
endif(NOT Eigen3_FIND_VERSION_MINOR)
25+
if(NOT Eigen3_FIND_VERSION_PATCH)
26+
set(Eigen3_FIND_VERSION_PATCH 0)
27+
endif(NOT Eigen3_FIND_VERSION_PATCH)
28+
29+
set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}")
30+
endif(NOT Eigen3_FIND_VERSION)
31+
32+
macro(_eigen3_check_version)
33+
file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header)
34+
35+
string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}")
36+
set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}")
37+
string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}")
38+
set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}")
39+
string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}")
40+
set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}")
41+
42+
set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION})
43+
if(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
44+
set(EIGEN3_VERSION_OK FALSE)
45+
else(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
46+
set(EIGEN3_VERSION_OK TRUE)
47+
endif(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
48+
49+
if(NOT EIGEN3_VERSION_OK)
50+
51+
message(STATUS "Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIR}, "
52+
"but at least version ${Eigen3_FIND_VERSION} is required")
53+
endif(NOT EIGEN3_VERSION_OK)
54+
endmacro(_eigen3_check_version)
55+
56+
if (EIGEN3_INCLUDE_DIR)
57+
58+
# in cache already
59+
_eigen3_check_version()
60+
set(EIGEN3_FOUND ${EIGEN3_VERSION_OK})
61+
62+
else (EIGEN3_INCLUDE_DIR)
63+
64+
find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
65+
PATHS
66+
${CMAKE_INSTALL_PREFIX}/include
67+
${KDE4_INCLUDE_DIR}
68+
PATH_SUFFIXES eigen3 eigen
69+
)
70+
71+
if(EIGEN3_INCLUDE_DIR)
72+
_eigen3_check_version()
73+
endif(EIGEN3_INCLUDE_DIR)
74+
75+
include(FindPackageHandleStandardArgs)
76+
find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK)
77+
78+
mark_as_advanced(EIGEN3_INCLUDE_DIR)
79+
80+
endif(EIGEN3_INCLUDE_DIR)
81+

cmake/FindGlog.cmake

+209
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
# 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: [email protected] (Alex Stewart)
30+
#
31+
32+
# FindGlog.cmake - Find Google glog logging library.
33+
#
34+
# This module defines the following variables:
35+
#
36+
# GLOG_FOUND: TRUE iff glog is found.
37+
# GLOG_INCLUDE_DIRS: Include directories for glog.
38+
# GLOG_LIBRARIES: Libraries required to link glog.
39+
#
40+
# The following variables control the behaviour of this module:
41+
#
42+
# GLOG_INCLUDE_DIR_HINTS: List of additional directories in which to
43+
# search for glog includes, e.g: /timbuktu/include.
44+
# GLOG_LIBRARY_DIR_HINTS: List of additional directories in which to
45+
# search for glog libraries, e.g: /timbuktu/lib.
46+
#
47+
# The following variables are also defined by this module, but in line with
48+
# CMake recommended FindPackage() module style should NOT be referenced directly
49+
# by callers (use the plural variables detailed above instead). These variables
50+
# do however affect the behaviour of the module via FIND_[PATH/LIBRARY]() which
51+
# are NOT re-called (i.e. search for library is not repeated) if these variables
52+
# are set with valid values _in the CMake cache_. This means that if these
53+
# variables are set directly in the cache, either by the user in the CMake GUI,
54+
# or by the user passing -DVAR=VALUE directives to CMake when called (which
55+
# explicitly defines a cache variable), then they will be used verbatim,
56+
# bypassing the HINTS variables and other hard-coded search locations.
57+
#
58+
# GLOG_INCLUDE_DIR: Include directory for glog, not including the
59+
# include directory of any dependencies.
60+
# GLOG_LIBRARY: glog library, not including the libraries of any
61+
# dependencies.
62+
63+
# Reset CALLERS_CMAKE_FIND_LIBRARY_PREFIXES to its value when
64+
# FindGlog was invoked.
65+
macro(GLOG_RESET_FIND_LIBRARY_PREFIX)
66+
if (MSVC)
67+
set(CMAKE_FIND_LIBRARY_PREFIXES "${CALLERS_CMAKE_FIND_LIBRARY_PREFIXES}")
68+
endif (MSVC)
69+
endmacro(GLOG_RESET_FIND_LIBRARY_PREFIX)
70+
71+
# Called if we failed to find glog or any of it's required dependencies,
72+
# unsets all public (designed to be used externally) variables and reports
73+
# error message at priority depending upon [REQUIRED/QUIET/<NONE>] argument.
74+
macro(GLOG_REPORT_NOT_FOUND REASON_MSG)
75+
unset(GLOG_FOUND)
76+
unset(GLOG_INCLUDE_DIRS)
77+
unset(GLOG_LIBRARIES)
78+
# Make results of search visible in the CMake GUI if glog has not
79+
# been found so that user does not have to toggle to advanced view.
80+
mark_as_advanced(CLEAR GLOG_INCLUDE_DIR
81+
GLOG_LIBRARY)
82+
83+
glog_reset_find_library_prefix()
84+
85+
# Note <package>_FIND_[REQUIRED/QUIETLY] variables defined by FindPackage()
86+
# use the camelcase library name, not uppercase.
87+
if (Glog_FIND_QUIETLY)
88+
message(STATUS "Failed to find glog - " ${REASON_MSG} ${ARGN})
89+
elseif (Glog_FIND_REQUIRED)
90+
message(FATAL_ERROR "Failed to find glog - " ${REASON_MSG} ${ARGN})
91+
else()
92+
# Neither QUIETLY nor REQUIRED, use no priority which emits a message
93+
# but continues configuration and allows generation.
94+
message("-- Failed to find glog - " ${REASON_MSG} ${ARGN})
95+
endif ()
96+
endmacro(GLOG_REPORT_NOT_FOUND)
97+
98+
# Handle possible presence of lib prefix for libraries on MSVC, see
99+
# also GLOG_RESET_FIND_LIBRARY_PREFIX().
100+
if (MSVC)
101+
# Preserve the caller's original values for CMAKE_FIND_LIBRARY_PREFIXES
102+
# s/t we can set it back before returning.
103+
set(CALLERS_CMAKE_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES}")
104+
# The empty string in this list is important, it represents the case when
105+
# the libraries have no prefix (shared libraries / DLLs).
106+
set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "" "${CMAKE_FIND_LIBRARY_PREFIXES}")
107+
endif (MSVC)
108+
109+
# Search user-installed locations first, so that we prefer user installs
110+
# to system installs where both exist.
111+
list(APPEND GLOG_CHECK_INCLUDE_DIRS
112+
/usr/local/include
113+
/usr/local/homebrew/include # Mac OS X
114+
/opt/local/var/macports/software # Mac OS X.
115+
/opt/local/include
116+
/usr/include)
117+
# Windows (for C:/Program Files prefix).
118+
list(APPEND GLOG_CHECK_PATH_SUFFIXES
119+
glog/include
120+
glog/Include
121+
Glog/include
122+
Glog/Include)
123+
124+
list(APPEND GLOG_CHECK_LIBRARY_DIRS
125+
/usr/local/lib
126+
/usr/local/homebrew/lib # Mac OS X.
127+
/opt/local/lib
128+
/usr/lib)
129+
# Windows (for C:/Program Files prefix).
130+
list(APPEND GLOG_CHECK_LIBRARY_SUFFIXES
131+
glog/lib
132+
glog/Lib
133+
Glog/lib
134+
Glog/Lib)
135+
136+
# Search supplied hint directories first if supplied.
137+
find_path(GLOG_INCLUDE_DIR
138+
NAMES glog/logging.h
139+
PATHS ${GLOG_INCLUDE_DIR_HINTS}
140+
${GLOG_CHECK_INCLUDE_DIRS}
141+
PATH_SUFFIXES ${GLOG_CHECK_PATH_SUFFIXES})
142+
if (NOT GLOG_INCLUDE_DIR OR
143+
NOT EXISTS ${GLOG_INCLUDE_DIR})
144+
glog_report_not_found(
145+
"Could not find glog include directory, set GLOG_INCLUDE_DIR "
146+
"to directory containing glog/logging.h")
147+
endif (NOT GLOG_INCLUDE_DIR OR
148+
NOT EXISTS ${GLOG_INCLUDE_DIR})
149+
150+
find_library(GLOG_LIBRARY NAMES glog
151+
PATHS ${GLOG_LIBRARY_DIR_HINTS}
152+
${GLOG_CHECK_LIBRARY_DIRS}
153+
PATH_SUFFIXES ${GLOG_CHECK_LIBRARY_SUFFIXES})
154+
if (NOT GLOG_LIBRARY OR
155+
NOT EXISTS ${GLOG_LIBRARY})
156+
glog_report_not_found(
157+
"Could not find glog library, set GLOG_LIBRARY "
158+
"to full path to libglog.")
159+
endif (NOT GLOG_LIBRARY OR
160+
NOT EXISTS ${GLOG_LIBRARY})
161+
162+
# Mark internally as found, then verify. GLOG_REPORT_NOT_FOUND() unsets
163+
# if called.
164+
set(GLOG_FOUND TRUE)
165+
166+
# Glog does not seem to provide any record of the version in its
167+
# source tree, thus cannot extract version.
168+
169+
# Catch case when caller has set GLOG_INCLUDE_DIR in the cache / GUI and
170+
# thus FIND_[PATH/LIBRARY] are not called, but specified locations are
171+
# invalid, otherwise we would report the library as found.
172+
if (GLOG_INCLUDE_DIR AND
173+
NOT EXISTS ${GLOG_INCLUDE_DIR}/glog/logging.h)
174+
glog_report_not_found(
175+
"Caller defined GLOG_INCLUDE_DIR:"
176+
" ${GLOG_INCLUDE_DIR} does not contain glog/logging.h header.")
177+
endif (GLOG_INCLUDE_DIR AND
178+
NOT EXISTS ${GLOG_INCLUDE_DIR}/glog/logging.h)
179+
# TODO: This regex for glog library is pretty primitive, we use lowercase
180+
# for comparison to handle Windows using CamelCase library names, could
181+
# this check be better?
182+
string(TOLOWER "${GLOG_LIBRARY}" LOWERCASE_GLOG_LIBRARY)
183+
if (GLOG_LIBRARY AND
184+
NOT "${LOWERCASE_GLOG_LIBRARY}" MATCHES ".*glog[^/]*")
185+
glog_report_not_found(
186+
"Caller defined GLOG_LIBRARY: "
187+
"${GLOG_LIBRARY} does not match glog.")
188+
endif (GLOG_LIBRARY AND
189+
NOT "${LOWERCASE_GLOG_LIBRARY}" MATCHES ".*glog[^/]*")
190+
191+
# Set standard CMake FindPackage variables if found.
192+
if (GLOG_FOUND)
193+
set(GLOG_INCLUDE_DIRS ${GLOG_INCLUDE_DIR})
194+
set(GLOG_LIBRARIES ${GLOG_LIBRARY})
195+
endif (GLOG_FOUND)
196+
197+
glog_reset_find_library_prefix()
198+
199+
# Handle REQUIRED / QUIET optional arguments.
200+
include(FindPackageHandleStandardArgs)
201+
find_package_handle_standard_args(Glog DEFAULT_MSG
202+
GLOG_INCLUDE_DIRS GLOG_LIBRARIES)
203+
204+
# Only mark internal variables as advanced if we found glog, otherwise
205+
# leave them visible in the standard GUI for the user to set manually.
206+
if (GLOG_FOUND)
207+
mark_as_advanced(FORCE GLOG_INCLUDE_DIR
208+
GLOG_LIBRARY)
209+
endif (GLOG_FOUND)

cmake/FindLibZip.cmake

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Finds libzip.
2+
#
3+
# This module defines:
4+
# LIBZIP_INCLUDE_DIR_ZIP
5+
# LIBZIP_INCLUDE_DIR_ZIPCONF
6+
# LIBZIP_LIBRARY
7+
#
8+
9+
find_package(PkgConfig)
10+
pkg_check_modules(PC_LIBZIP QUIET libzip)
11+
12+
find_path(LIBZIP_INCLUDE_DIR_ZIP
13+
NAMES zip.h
14+
HINTS ${PC_LIBZIP_INCLUDE_DIRS})
15+
16+
find_path(LIBZIP_INCLUDE_DIR_ZIPCONF
17+
NAMES zipconf.h
18+
HINTS ${PC_LIBZIP_INCLUDE_DIRS})
19+
20+
find_library(LIBZIP_LIBRARY
21+
NAMES zip)
22+
23+
include(FindPackageHandleStandardArgs)
24+
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
25+
LIBZIP DEFAULT_MSG
26+
LIBZIP_LIBRARY LIBZIP_INCLUDE_DIR_ZIP LIBZIP_INCLUDE_DIR_ZIPCONF)
27+
28+
set(LIBZIP_VERSION 0)
29+
30+
if (LIBZIP_INCLUDE_DIR_ZIPCONF)
31+
FILE(READ "${LIBZIP_INCLUDE_DIR_ZIPCONF}/zipconf.h" _LIBZIP_VERSION_CONTENTS)
32+
if (_LIBZIP_VERSION_CONTENTS)
33+
STRING(REGEX REPLACE ".*#define LIBZIP_VERSION \"([0-9.]+)\".*" "\\1" LIBZIP_VERSION "${_LIBZIP_VERSION_CONTENTS}")
34+
endif ()
35+
endif ()
36+
37+
set(LIBZIP_VERSION ${LIBZIP_VERSION} CACHE STRING "Version number of libzip")

examples/CMakeLists.txt

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# TUM_MONO dataset
2+
add_executable( run_dso_tum_mono run_dso_tum_mono.cc )
3+
target_link_libraries( run_dso_tum_mono
4+
ldso ${THIRD_PARTY_LIBS} )
5+
6+
# EUROC dataset
7+
add_executable( run_dso_euroc run_dso_euroc.cc )
8+
target_link_libraries( run_dso_euroc
9+
ldso ${THIRD_PARTY_LIBS} )
10+
11+
# Kitti dataset
12+
add_executable( run_dso_kitti run_dso_kitti.cc )
13+
target_link_libraries( run_dso_kitti
14+
ldso ${THIRD_PARTY_LIBS} )

0 commit comments

Comments
 (0)