Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

make g2o optional for building

  • Loading branch information...
commit 49841898bf09b90d90fd98ecfa4d7964553d5d98 1 parent bfdf116
@vrabaud vrabaud authored
View
10 CMakeLists.txt
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8)
project(opencv_candidate)
find_package(catkin REQUIRED)
-find_package(libg2o)
+find_package(libg2o QUIET)
find_package(OpenCV)
find_library(DEPTH_SENSE_LIBRARIES DepthSense /opt/DepthSenseSDK/lib)
@@ -13,13 +13,17 @@ else()
endif()
if (${catkin_VERSION} VERSION_GREATER "0.5.28")
+if (libg2o_FOUND)
+ set(EXTRA_DEPENDS libg2o)
+ set(EXTRA_LIBRARIES opencv_candidate_reconst3d)
+endif()
catkin_package(CFG_EXTRAS depends.cmake
- DEPENDS OpenCV libg2o
+ DEPENDS OpenCV ${EXTRA_DEPENDS}
INCLUDE_DIRS include
LIBRARIES opencv_candidate
${OPENCV_CREATIVE}
opencv_rgbd
- opencv_candidate_reconst3d
+ ${opencv_candidate_reconst3d}
)
else()
catkin_stack()
View
14 src/reconst3d/CMakeLists.txt
@@ -1,3 +1,9 @@
+find_package(libg2o QUIET)
+
+if (NOT libg2o_FOUND)
+return()
+endif()
+
find_package(OpenCV REQUIRED)
# Model capture stuff
@@ -25,3 +31,11 @@ target_link_libraries(opencv_candidate_reconst3d ${catkin_LIBRARIES}
cxsparse
)
set_target_properties(opencv_candidate_reconst3d PROPERTIES COMPILE_FLAGS "-fopenmp" LINK_FLAGS "-fopenmp")
+
+# add model capture sample
+add_executable(model_capture samples/model_capture.cpp)
+target_link_libraries(model_capture ${OpenCV_LIBRARIES}
+ opencv_rgbd
+ opencv_candidate_reconst3d
+)
+set_target_properties(model_capture PROPERTIES COMPILE_FLAGS "-fopenmp" LINK_FLAGS "-fopenmp")
View
0  src/rgbd/samples/model_capture.cpp → src/reconst3d/samples/model_capture.cpp
File renamed without changes
View
21 src/rgbd/CMakeLists.txt
@@ -45,24 +45,3 @@ target_link_libraries(rgbd_tests ${OpenCV_LIBRARIES}
)
add_test(rgbd_tests rgbd_tests)
-
-# Model capture stuff
-find_package(PCL REQUIRED COMPONENTS io filters visualization features segmentation surface)
-include_directories(SYSTEM ${PCL_INCLUDE_DIRS}
- /usr/include/suitesparse
-)
-
-# Find Eigen3
-FIND_PACKAGE(Eigen)
-find_package(libg2o)
-
-include_directories(SYSTEM ${EIGEN_INCLUDE_DIRS})
-
-# add model capture sample
-include_directories(${reconst3d_dir}/include)
-add_executable(model_capture samples/model_capture.cpp)
-target_link_libraries(model_capture ${OpenCV_LIBRARIES}
- opencv_rgbd
- opencv_candidate_reconst3d
-)
-set_target_properties(model_capture PROPERTIES COMPILE_FLAGS "-fopenmp" LINK_FLAGS "-fopenmp")
Please sign in to comment.
Something went wrong with that request. Please try again.