Skip to content

Commit

Permalink
make g2o optional for building
Browse files Browse the repository at this point in the history
  • Loading branch information
vrabaud committed Jan 17, 2013
1 parent bfdf116 commit 4984189
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 24 deletions.
10 changes: 7 additions & 3 deletions CMakeLists.txt
Expand Up @@ -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)

Expand All @@ -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()
Expand Down
14 changes: 14 additions & 0 deletions 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
Expand Down Expand Up @@ -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")
File renamed without changes.
21 changes: 0 additions & 21 deletions src/rgbd/CMakeLists.txt
Expand Up @@ -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")

0 comments on commit 4984189

Please sign in to comment.