From 4af37228e470589d39f887125734d1e407d1fa8b Mon Sep 17 00:00:00 2001 From: Georgi Tinchev Date: Fri, 8 Sep 2017 16:10:09 +0100 Subject: [PATCH] Added PCL 1.8 support. --- src/maps-lcm/CMakeLists.txt | 25 ++++++++++++++++++++----- src/maps/CMakeLists.txt | 26 +++++++++++++++++++++----- src/plane-seg/CMakeLists.txt | 22 +++++++++++++++++++--- 3 files changed, 60 insertions(+), 13 deletions(-) diff --git a/src/maps-lcm/CMakeLists.txt b/src/maps-lcm/CMakeLists.txt index 77778d0..7ebc580 100644 --- a/src/maps-lcm/CMakeLists.txt +++ b/src/maps-lcm/CMakeLists.txt @@ -8,6 +8,25 @@ add_library(maps-lcm SHARED ViewClient.cpp ) +find_package(PkgConfig REQUIRED) +pkg_check_modules(PCL_IO pcl_io-1.7) +if(PCL_IO_FOUND) + message("---- PCL IO was found\n") + set(REQ_PKGS pcl_common-1.7 pcl_filters-1.7 pcl_features-1.7 pcl_io-1.7 pcl_surface-1.7) +endif() + +pkg_check_modules(PCL_IO_1_8 pcl_io-1.8) +if(PCL_IO_1_8_FOUND) + message("---- PCL IO_1_8 was found\n") + set(REQ_PKGS pcl_common-1.8 pcl_filters-1.8 pcl_features-1.8 pcl_io-1.8 pcl_surface-1.8) +endif() + +if(NOT PCL_IO_FOUND AND NOT PCL_IO_1_8_FOUND) + message("---- PCL NOT FOUND. Not building maps_server") + return() +endif() + + # make the header public # install it to include/maps pods_install_headers( @@ -25,11 +44,7 @@ pods_install_libraries(maps-lcm) set(REQUIRED_PACKAGES eigen3 - pcl_common-1.7 - pcl_filters-1.7 - pcl_features-1.7 - pcl_io-1.7 - pcl_surface-1.7 + ${REQ_PKGS} octomap glib-2.0 bot2-frames diff --git a/src/maps/CMakeLists.txt b/src/maps/CMakeLists.txt index 22496ac..1166b88 100644 --- a/src/maps/CMakeLists.txt +++ b/src/maps/CMakeLists.txt @@ -53,13 +53,29 @@ pods_install_headers( # make the library public pods_install_libraries(maps) +find_package(PkgConfig REQUIRED) +pkg_check_modules(PCL_IO pcl_io-1.7) +if(PCL_IO_FOUND) + message("---- PCL IO was found\n") + set(REQ_PKGS pcl_common-1.7 pcl_filters-1.7 pcl_features-1.7 pcl_io-1.7 pcl_surface-1.7) +endif() + +pkg_check_modules(PCL_IO_1_8 pcl_io-1.8) +if(PCL_IO_1_8_FOUND) + message("---- PCL IO_1_8 was found\n") + set(REQ_PKGS pcl_common-1.8 pcl_filters-1.8 pcl_features-1.8 pcl_io-1.8 pcl_surface-1.8) +endif() + +if(NOT PCL_IO_FOUND AND NOT PCL_IO_1_8_FOUND) + message("---- PCL NOT FOUND. Not building maps_server") + return() +endif() + + + set(REQUIRED_PACKAGES eigen3 - pcl_common-1.7 - pcl_filters-1.7 - pcl_features-1.7 - pcl_io-1.7 - pcl_surface-1.7 + ${REQ_PKGS} octomap glib-2.0 zlib diff --git a/src/plane-seg/CMakeLists.txt b/src/plane-seg/CMakeLists.txt index 3865979..97008e6 100644 --- a/src/plane-seg/CMakeLists.txt +++ b/src/plane-seg/CMakeLists.txt @@ -1,13 +1,29 @@ add_definitions(-std=c++1y -Wall) set(MODULE_NAME plane-seg) +find_package(PkgConfig REQUIRED) +pkg_check_modules(PCL_IO pcl_io-1.7) +if(PCL_IO_FOUND) + message("---- PCL IO was found\n") + set(REQ_PKGS pcl_io-1.7 pcl_surface-1.7 pcl_segmentation-1.7) +endif() + +pkg_check_modules(PCL_IO_1_8 pcl_io-1.8) +if(PCL_IO_1_8_FOUND) + message("---- PCL IO_1_8 was found\n") + set(REQ_PKGS pcl_io-1.8 pcl_surface-1.8 pcl_segmentation-1.8) +endif() + +if(NOT PCL_IO_FOUND AND NOT PCL_IO_1_8_FOUND) + message("---- PCL NOT FOUND. Not building maps_server") + return() +endif() + # create library set(LIB_NAME ${MODULE_NAME}) set(REQUIRED_PACKAGES eigen3 - pcl_io-1.7 - pcl_surface-1.7 - pcl_segmentation-1.7 + ${REQ_PKGS} ) add_library(${LIB_NAME} SHARED PlaneFitter.cpp