init GPU
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
###############################################################################
|
||||
#
|
||||
# CMake script for finding the Eigen library.
|
||||
#
|
||||
# http://eigen.tuxfamily.org/index.php?title=Main_Page
|
||||
#
|
||||
# Copyright (c) 2006, 2007 Montel Laurent, <[email protected]>
|
||||
# Copyright (c) 2008, 2009 Gael Guennebaud, <[email protected]>
|
||||
# Copyright (c) 2009 Benoit Jacob <[email protected]>
|
||||
# Redistribution and use is allowed according to the terms of the 2-clause BSD
|
||||
# license.
|
||||
#
|
||||
#
|
||||
# Input variables:
|
||||
#
|
||||
# - Eigen_ROOT_DIR (optional): When specified, header files and libraries
|
||||
# will be searched for in `${Eigen_ROOT_DIR}/include` and
|
||||
# `${Eigen_ROOT_DIR}/libs` respectively, and the default CMake search order
|
||||
# will be ignored. When unspecified, the default CMake search order is used.
|
||||
# This variable can be specified either as a CMake or environment variable.
|
||||
# If both are set, preference is given to the CMake variable.
|
||||
# Use this variable for finding packages installed in a nonstandard location,
|
||||
# or for enforcing that one of multiple package installations is picked up.
|
||||
#
|
||||
# Cache variables (not intended to be used in CMakeLists.txt files)
|
||||
#
|
||||
# - Eigen_INCLUDE_DIR: Absolute path to package headers.
|
||||
#
|
||||
#
|
||||
# Output variables:
|
||||
#
|
||||
# - Eigen_FOUND: Boolean that indicates if the package was found
|
||||
# - Eigen_INCLUDE_DIRS: Paths to the necessary header files
|
||||
# - Eigen_VERSION: Version of Eigen library found
|
||||
# - Eigen_DEFINITIONS: Definitions to be passed on behalf of eigen
|
||||
#
|
||||
#
|
||||
# Example usage:
|
||||
#
|
||||
# # Passing the version means Eigen_FOUND will only be TRUE if a
|
||||
# # version >= the provided version is found.
|
||||
# find_package(Eigen 3.1.2)
|
||||
# if(NOT Eigen_FOUND)
|
||||
# # Error handling
|
||||
# endif()
|
||||
# ...
|
||||
# add_definitions(${Eigen_DEFINITIONS})
|
||||
# ...
|
||||
# include_directories(${Eigen_INCLUDE_DIRS} ...)
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(PC_EIGEN eigen3)
|
||||
set(EIGEN_DEFINITIONS ${PC_EIGEN_CFLAGS_OTHER})
|
||||
|
||||
|
||||
find_path(EIGEN_INCLUDE_DIR Eigen/Core
|
||||
HINTS ${PC_EIGEN_INCLUDEDIR} ${PC_EIGEN_INCLUDE_DIRS}
|
||||
"${Eigen_ROOT_DIR}" "$ENV{EIGEN_ROOT_DIR}"
|
||||
"${EIGEN_ROOT}" "$ENV{EIGEN_ROOT}" # Backwards Compatibility
|
||||
PATHS "$ENV{PROGRAMFILES}/Eigen" "$ENV{PROGRAMW6432}/Eigen"
|
||||
"$ENV{PROGRAMFILES}/Eigen 3.0.0" "$ENV{PROGRAMW6432}/Eigen 3.0.0"
|
||||
PATH_SUFFIXES eigen3 include/eigen3 include)
|
||||
|
||||
set(EIGEN_INCLUDE_DIRS ${EIGEN_INCLUDE_DIR})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Eigen DEFAULT_MSG EIGEN_INCLUDE_DIR)
|
||||
|
||||
mark_as_advanced(EIGEN_INCLUDE_DIR)
|
||||
|
||||
if(EIGEN_FOUND)
|
||||
message(STATUS "Eigen found (include: ${EIGEN_INCLUDE_DIRS})")
|
||||
endif(EIGEN_FOUND)
|
||||
|
||||
|
||||
set(Eigen_INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS})
|
||||
set(Eigen_FOUND ${EIGEN_FOUND})
|
||||
set(Eigen_VERSION ${EIGEN_VERSION})
|
||||
set(Eigen_DEFINITIONS ${EIGEN_DEFINITIONS})
|
||||
@@ -0,0 +1,113 @@
|
||||
# Find the header files
|
||||
|
||||
FIND_PATH(G2O_INCLUDE_DIR g2o/core/base_vertex.h
|
||||
${G2O_ROOT}/include
|
||||
$ENV{G2O_ROOT}/include
|
||||
$ENV{G2O_ROOT}
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
/opt/local/include
|
||||
/sw/local/include
|
||||
/sw/include
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
# Macro to unify finding both the debug and release versions of the
|
||||
# libraries; this is adapted from the OpenSceneGraph FIND_LIBRARY
|
||||
# macro.
|
||||
|
||||
MACRO(FIND_G2O_LIBRARY MYLIBRARY MYLIBRARYNAME)
|
||||
|
||||
FIND_LIBRARY("${MYLIBRARY}_DEBUG"
|
||||
NAMES "g2o_${MYLIBRARYNAME}_d"
|
||||
PATHS
|
||||
${G2O_ROOT}/lib/Debug
|
||||
${G2O_ROOT}/lib
|
||||
$ENV{G2O_ROOT}/lib/Debug
|
||||
$ENV{G2O_ROOT}/lib
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
FIND_LIBRARY("${MYLIBRARY}_DEBUG"
|
||||
NAMES "g2o_${MYLIBRARYNAME}_d"
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local/lib
|
||||
/usr/local/lib64
|
||||
/usr/lib
|
||||
/usr/lib64
|
||||
/opt/local/lib
|
||||
/sw/local/lib
|
||||
/sw/lib
|
||||
)
|
||||
|
||||
FIND_LIBRARY(${MYLIBRARY}
|
||||
NAMES "g2o_${MYLIBRARYNAME}"
|
||||
PATHS
|
||||
${G2O_ROOT}/lib/Release
|
||||
${G2O_ROOT}/lib
|
||||
$ENV{G2O_ROOT}/lib/Release
|
||||
$ENV{G2O_ROOT}/lib
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
FIND_LIBRARY(${MYLIBRARY}
|
||||
NAMES "g2o_${MYLIBRARYNAME}"
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local/lib
|
||||
/usr/local/lib64
|
||||
/usr/lib
|
||||
/usr/lib64
|
||||
/opt/local/lib
|
||||
/sw/local/lib
|
||||
/sw/lib
|
||||
)
|
||||
|
||||
IF(NOT ${MYLIBRARY}_DEBUG)
|
||||
IF(MYLIBRARY)
|
||||
SET(${MYLIBRARY}_DEBUG ${MYLIBRARY})
|
||||
ENDIF(MYLIBRARY)
|
||||
ENDIF( NOT ${MYLIBRARY}_DEBUG)
|
||||
|
||||
ENDMACRO(FIND_G2O_LIBRARY LIBRARY LIBRARYNAME)
|
||||
|
||||
# Find the core elements
|
||||
FIND_G2O_LIBRARY(G2O_STUFF_LIBRARY stuff)
|
||||
FIND_G2O_LIBRARY(G2O_CORE_LIBRARY core)
|
||||
|
||||
# Find the CLI library
|
||||
FIND_G2O_LIBRARY(G2O_CLI_LIBRARY cli)
|
||||
|
||||
# Find the pluggable solvers
|
||||
FIND_G2O_LIBRARY(G2O_SOLVER_CHOLMOD solver_cholmod)
|
||||
FIND_G2O_LIBRARY(G2O_SOLVER_CSPARSE solver_csparse)
|
||||
FIND_G2O_LIBRARY(G2O_SOLVER_CSPARSE_EXTENSION csparse_extension)
|
||||
FIND_G2O_LIBRARY(G2O_SOLVER_DENSE solver_dense)
|
||||
FIND_G2O_LIBRARY(G2O_SOLVER_PCG solver_pcg)
|
||||
FIND_G2O_LIBRARY(G2O_SOLVER_SLAM2D_LINEAR solver_slam2d_linear)
|
||||
FIND_G2O_LIBRARY(G2O_SOLVER_STRUCTURE_ONLY solver_structure_only)
|
||||
FIND_G2O_LIBRARY(G2O_SOLVER_EIGEN solver_eigen)
|
||||
|
||||
# Find the predefined types
|
||||
FIND_G2O_LIBRARY(G2O_TYPES_DATA types_data)
|
||||
FIND_G2O_LIBRARY(G2O_TYPES_ICP types_icp)
|
||||
FIND_G2O_LIBRARY(G2O_TYPES_SBA types_sba)
|
||||
FIND_G2O_LIBRARY(G2O_TYPES_SCLAM2D types_sclam2d)
|
||||
FIND_G2O_LIBRARY(G2O_TYPES_SIM3 types_sim3)
|
||||
FIND_G2O_LIBRARY(G2O_TYPES_SLAM2D types_slam2d)
|
||||
FIND_G2O_LIBRARY(G2O_TYPES_SLAM3D types_slam3d)
|
||||
|
||||
# G2O solvers declared found if we found at least one solver
|
||||
SET(G2O_SOLVERS_FOUND "NO")
|
||||
IF(G2O_SOLVER_CHOLMOD OR G2O_SOLVER_CSPARSE OR G2O_SOLVER_DENSE OR G2O_SOLVER_PCG OR G2O_SOLVER_SLAM2D_LINEAR OR G2O_SOLVER_STRUCTURE_ONLY OR G2O_SOLVER_EIGEN)
|
||||
SET(G2O_SOLVERS_FOUND "YES")
|
||||
ENDIF(G2O_SOLVER_CHOLMOD OR G2O_SOLVER_CSPARSE OR G2O_SOLVER_DENSE OR G2O_SOLVER_PCG OR G2O_SOLVER_SLAM2D_LINEAR OR G2O_SOLVER_STRUCTURE_ONLY OR G2O_SOLVER_EIGEN)
|
||||
|
||||
# G2O itself declared found if we found the core libraries and at least one solver
|
||||
SET(G2O_FOUND "NO")
|
||||
IF(G2O_STUFF_LIBRARY AND G2O_CORE_LIBRARY AND G2O_INCLUDE_DIR AND G2O_SOLVERS_FOUND)
|
||||
SET(G2O_FOUND "YES")
|
||||
ENDIF(G2O_STUFF_LIBRARY AND G2O_CORE_LIBRARY AND G2O_INCLUDE_DIR AND G2O_SOLVERS_FOUND)
|
||||
Reference in New Issue
Block a user