diff --git a/pcl_ros/CMakeLists.txt b/pcl_ros/CMakeLists.txt index af79302c..7d845687 100644 --- a/pcl_ros/CMakeLists.txt +++ b/pcl_ros/CMakeLists.txt @@ -18,6 +18,21 @@ if(NOT "${PCL_LIBRARIES}" STREQUAL "") "vtkRenderingQt") endif() +# There is a bug in the Ubuntu Artful (17.10) version of the VTK package, +# where it includes /usr/include/*-linux-gnu/freetype2 in the include +# directories (which doesn't exist). This filters down to the PCL_INCLUDE_DIRS, +# and causes downstream projects trying to use these libraries to fail to +# configure properly. Here we remove those bogus entries so that downstream +# consumers of this package succeed. +if(NOT "${PCL_INCLUDE_DIRS}" STREQUAL "") + foreach(item ${PCL_INCLUDE_DIRS}) + string(REGEX MATCH "/usr/include/.*-linux-gnu/freetype2" item ${item}) + if(item) + list(REMOVE_ITEM PCL_INCLUDE_DIRS ${item}) + endif() + endforeach() +endif() + ## Find catkin packages find_package(catkin REQUIRED COMPONENTS dynamic_reconfigure