meta-ros/recipes-ros/moveit/moveit-ros-perception/0001-moveit_ros_perception-...

107 lines
3.4 KiB
Diff

From f86d6ca6c56d90e983a8074d4a8d6ac22cdee8cf Mon Sep 17 00:00:00 2001
From: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
Date: Tue, 24 Jan 2017 17:27:28 +0200
Subject: [PATCH 1/2] moveit_ros_perception: make OpenGL parts optional
But build everything by default.
Upstream-Status: Inappropriate [WONTFIX for stable indigo-devel branch]
Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
---
CMakeLists.txt | 35 ++++++++++++++++++++---------------
1 file changed, 20 insertions(+), 15 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e984b17..fd91cc6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 2.8.3)
project(moveit_ros_perception)
+option(BUILD_OPENGL "Build the parts that depends on OpenGL" ON)
+
if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
@@ -9,12 +11,16 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
find_package(Boost REQUIRED thread signals)
-find_package(OpenGL REQUIRED)
-find_package(GLEW REQUIRED)
-find_package(GLUT REQUIRED)
-if (OPENGL_FOUND)
- set(gl_LIBS ${gl_LIBS} ${OPENGL_LIBRARIES})
-endif(OPENGL_FOUND)
+if (BUILD_OPENGL)
+ find_package(OpenGL REQUIRED)
+ find_package(GLEW REQUIRED)
+ find_package(GLUT REQUIRED)
+ if (OPENGL_FOUND)
+ set(gl_LIBS ${gl_LIBS} ${OPENGL_LIBRARIES})
+ endif(OPENGL_FOUND)
+ set(perception_GL_INCLUDE_DIRS "mesh_filter/include" "depth_image_octomap_updater/include")
+ set(SYSTEM_GL_INCLUDE_DIRS ${GLEW_INCLUDE_DIR} ${GLUT_INCLUDE_DIR})
+endif(BUILD_OPENGL)
find_package(catkin REQUIRED COMPONENTS
moveit_core
@@ -39,13 +45,12 @@ find_package(OpenCV)
catkin_package(
INCLUDE_DIRS
- mesh_filter/include
lazy_free_space_updater/include
- depth_image_octomap_updater/include
point_containment_filter/include
occupancy_map_monitor/include
pointcloud_octomap_updater/include
semantic_world/include
+ ${perception_GL_INCLUDE_DIRS}
${OCTOMAP_INCLUDE_DIRS}
LIBRARIES
moveit_lazy_free_space_updater
@@ -59,21 +64,19 @@ catkin_package(
image_transport
moveit_msgs)
-include_directories(mesh_filter/include
- lazy_free_space_updater/include
- depth_image_octomap_updater/include
+include_directories(lazy_free_space_updater/include
point_containment_filter/include
occupancy_map_monitor/include
pointcloud_octomap_updater/include
semantic_world/include
+ ${perception_GL_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
)
include_directories(SYSTEM
${EIGEN_INCLUDE_DIRS}
- ${GLEW_INCLUDE_DIR}
- ${GLUT_INCLUDE_DIR}
+ ${SYSTEM_GL_INCLUDE_DIR}
)
link_directories(${Boost_LIBRARY_DIRS})
@@ -83,8 +86,10 @@ add_subdirectory(lazy_free_space_updater)
add_subdirectory(point_containment_filter)
add_subdirectory(occupancy_map_monitor)
add_subdirectory(pointcloud_octomap_updater)
-add_subdirectory(mesh_filter)
-add_subdirectory(depth_image_octomap_updater)
+if (BUILD_OPENGL)
+ add_subdirectory(mesh_filter)
+ add_subdirectory(depth_image_octomap_updater)
+endif(BUILD_OPENGL)
add_subdirectory(semantic_world)
--
2.7.4