From 3ac13d4ee6903e2bd0832109c0d3c6296d92912a Mon Sep 17 00:00:00 2001 From: Pau Gargallo Date: Thu, 16 Jun 2016 10:28:12 +0200 Subject: [PATCH] Make SLAM build optional Former-commit-id: d38ccab000a5fe946e69bc40669c9419958813c8 --- CMakeLists.txt | 4 +++- SuperBuild/CMakeLists.txt | 10 ++++++++-- SuperBuild/cmake/External-OpenCV.cmake | 4 ++-- modules/CMakeLists.txt | 4 +++- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ca45386..a8a441d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,5 +12,7 @@ set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/SuperBuild/install") # move binaries to the same bin directory set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) +option(ODM_BUILD_SLAM "Build SLAM module" OFF) + # Add ODM sub-modules -add_subdirectory(modules) \ No newline at end of file +add_subdirectory(modules) diff --git a/SuperBuild/CMakeLists.txt b/SuperBuild/CMakeLists.txt index 5d77b648..f7a68d19 100644 --- a/SuperBuild/CMakeLists.txt +++ b/SuperBuild/CMakeLists.txt @@ -11,6 +11,8 @@ set(CMAKE_MODULE_PATH ${SB_ROOT_DIR}/cmake) include(ExternalProject) include(ExternalProject-Setup) +option(ODM_BUILD_SLAM "Build SLAM module" OFF) + ################################ # Setup SuperBuild directories # @@ -101,10 +103,14 @@ set(custom_libs OpenGV CMVS Catkin Ecto - PDAL - LAStools + PDAL) + +# Dependencies of the SLAM module +if(ODM_BUILD_SLAM) + list(APPEND custom_libs Pangolin ORB_SLAM2) +endif() foreach(lib ${custom_libs}) SETUP_EXTERNAL_PROJECT_CUSTOM(${lib}) diff --git a/SuperBuild/cmake/External-OpenCV.cmake b/SuperBuild/cmake/External-OpenCV.cmake index 0e39d6b1..232059c9 100644 --- a/SuperBuild/cmake/External-OpenCV.cmake +++ b/SuperBuild/cmake/External-OpenCV.cmake @@ -27,9 +27,9 @@ ExternalProject_Add(${_proj_name} -DBUILD_opencv_photo=ON -DBUILD_opencv_legacy=ON -DBUILD_opencv_python=ON - -DWITH_FFMPEG=ON + -DWITH_FFMPEG=${ODM_BUILD_SLAM} -DWITH_CUDA=OFF - -DWITH_GTK=ON + -DWITH_GTK=${ODM_BUILD_SLAM} -DWITH_VTK=OFF -DWITH_EIGEN=OFF -DWITH_OPENNI=OFF diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index 54d4f04d..d4f15cfe 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -4,4 +4,6 @@ add_subdirectory(odm_georef) add_subdirectory(odm_meshing) add_subdirectory(odm_orthophoto) add_subdirectory(odm_texturing) -add_subdirectory(odm_slam) +if (ODM_BUILD_SLAM) + add_subdirectory(odm_slam) +endif ()