add Ceres + function for ExternalProject setup

Former-commit-id: 40f17804d0
pull/1161/head
edgarriba 2015-11-12 00:10:41 +01:00
rodzic 71e58fed58
commit 960f92e780
5 zmienionych plików z 56 dodań i 24 usunięć

Wyświetl plik

@ -0,0 +1,15 @@
ExternalProject_Add(ceres
URL http://ceres-solver.org/ceres-solver-1.10.0.tar.gz
URL_MD5 dbf9f452bd46e052925b835efea9ab16
BINARY_DIR ${SB_BUILD_DIR}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${SB_DOWNLOAD_LOCATION}
CMAKE_ARGS
-DCMAKE_C_FLAGS=-fPIC
-DCMAKE_CXX_FLAGS=-fPIC
-DBUILD_EXAMPLES=OFF
-DBUILD_TESTING=OFF
-DCMAKE_INSTALL_PREFIX:PATH=${SB_INSTALL_PREFIX}
)
set(CERES_DIR ${SB_INSTALL_PREFIX}/share)

Wyświetl plik

@ -1,10 +1,9 @@
ExternalProject_Add(opencv
URL https://github.com/Itseez/opencv/archive/2.4.11.zip
URL_MD5 b517e83489c709eee1d8be76b16976a7
BINARY_DIR ${SB_BUILD_DIR}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
DOWNLOAD_DIR ${SB_DOWNLOAD_LOCATION}
CMAKE_ARGS
-DBUILD_opencv_core=ON
-DBUILD_opencv_imgproc=ON

Wyświetl plik

@ -1,10 +1,9 @@
ExternalProject_Add(pcl
URL https://github.com/PointCloudLibrary/pcl/archive/pcl-1.7.2.tar.gz
URL_MD5 02c72eb6760fcb1f2e359ad8871b9968
BINARY_DIR ${SB_BUILD_DIR}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
DOWNLOAD_DIR ${SB_DOWNLOAD_LOCATION}
CMAKE_ARGS
-DBUILD_features=OFF
-DBUILD_filters=OFF

Wyświetl plik

@ -0,0 +1,21 @@
function(SETUP_EXTERNAL_PROJECT name version force_build)
set(ADD_LIB_MSG "--- Adding External project")
if(NOT ${force_build})
find_package(Ceres ${version} EXACT QUIET)
if(${${name}_FOUND})
message(STATUS "${name} ${${name}_VERSION} found")
set(${name}_DIR ${${name}_DIR})
else()
message(STATUS "${name} ${version} not found ${ADD_LIB_MSG}")
include(External-${name})
endif()
else()
message(STATUS "${name} ${version} force build ${ADD_LIB_MSG}")
include(External-${name})
endif()
endfunction()

Wyświetl plik

@ -6,12 +6,14 @@ project(ODM-SuperBuild)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake)
include(ExternalProject)
include(ExternalProject-Setup)
# Setup location where source tar-balls are downloaded
set (DOWNLOAD_LOCATION "${CMAKE_SOURCE_DIR}/Downloads"
set (SB_DOWNLOAD_LOCATION "${CMAKE_SOURCE_DIR}/Downloads"
CACHE PATH "Location where source tar-balls are (to be) downloaded.")
mark_as_advanced(DOWNLOAD_LOCATION)
# Setup where the files will be installed
set(SB_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
# Check if CMAKE_INSTALL_PREFIX is set by default
@ -31,30 +33,26 @@ endif()
# ---------------------------------------------------------------------------------------------
# OpenCV
#
set(ODM_OpenCV_RequiredVersion 2.4.11)
set(ODM_OpenCV_Version 2.4.11)
option(ODM_BUILD_OpenCV "Force to build OpenCV library" OFF)
find_package( OpenCV ${ODM_OpenCV_RequiredVersion} EXACT QUIET)
if(${OpenCV_FOUND})
message(STATUS "OpenCV found --- ${OpenCV_VERSION} ( < ${ODM_OpenCV_RequiredVersion} )")
set(OPENCV_DIR ${OpenCV_DIR})
else()
message(STATUS "OpenCV not found --> Adding External project - OpenCV ${ODM_OpenCV_RequiredVersion}")
include(External-OpenCV)
endif()
SETUP_EXTERNAL_PROJECT(OpenCV ${ODM_OpenCV_Version} ${ODM_BUILD_OpenCV})
# ---------------------------------------------------------------------------------------------
# Point Cloud Library (PCL)
#
set(ODM_PCL_RequiredVersion 1.7.2)
set(ODM_PCL_Version 1.7.2)
option(ODM_BUILD_PCL "Force to build PCL library" OFF)
find_package( PCL ${ODM_PCL_RequiredVersion} EXACT QUIET)
SETUP_EXTERNAL_PROJECT(PCL ${ODM_PCL_Version} ${ODM_BUILD_PCL})
if(${PCL_FOUND})
message(STATUS "PCL found --- ${PCL_VERSION} ( < ${ODM_PCL_RequiredVersion} )")
set(PCL_DIR ${PCL_DIR})
else()
message(STATUS "PCL not found --> Adding External project - PCL ${ODM_PCL_RequiredVersion}")
include(External-PCL)
endif()
# ---------------------------------------------------------------------------------------------
# Ceres Solver
#
set(ODM_Ceres_Version 1.10.0)
option(ODM_BUILD_Ceres "Force to build Ceres library" OFF)
SETUP_EXTERNAL_PROJECT(Ceres ${ODM_Ceres_Version} ${ODM_BUILD_Ceres})