Bug#894656: libpcl-dev 1.8.0 exports the Qt5::Widgets target but doesn't provide it
Mikael Arguedas
mikael.arguedas at gmail.com
Mon Apr 2 23:11:38 BST 2018
Package: pcl
Version: 1.8.0+dfsg1-3
When I find_package PCL, I'm unable to create shared libraries linking
against PCL due to the target "Qt5::Widgets" being exported.
This has been fixed in pcl 1.8.1 by adding a dependency on
libvtk6-qt-dev in the libpcl-dev package. 1.8.0 is missing that
dependency.
I am using Debian GNU/Linux 9.4 (stretch), kernel 4.13.0-36-generic,
libc6 2.24-11+deb9u3.
libpcl-dev package information:
Architecture: amd64
Source: pcl (1.8.0+dfsg1-3)
Version: 1.8.0+dfsg1-3+b2
Depends: libboost-all-dev, libeigen3-dev, libflann-dev, libvtk6-dev,
libqhull-dev, libopenni-dev, libopenni2-dev, libpcl-apps1.8 (=
1.8.0+dfsg1-3+b2), libpcl-common1.8 (= 1.8.0+dfsg1-3+b2),
libpcl-features1.8 (= 1.8.0+dfsg1-3+b2), libpcl-filters1.8 (=
1.8.0+dfsg1-3+b2), libpcl-io1.8 (= 1.8.0+dfsg1-3+b2), libpcl-kdtree1.8
(= 1.8.0+dfsg1-3+b2), libpcl-keypoints1.8 (= 1.8.0+dfsg1-3+b2),
libpcl-ml1.8 (= 1.8.0+dfsg1-3+b2), libpcl-octree1.8 (=
1.8.0+dfsg1-3+b2), libpcl-outofcore1.8 (= 1.8.0+dfsg1-3+b2),
libpcl-people1.8 (= 1.8.0+dfsg1-3+b2), libpcl-recognition1.8 (=
1.8.0+dfsg1-3+b2), libpcl-registration1.8 (= 1.8.0+dfsg1-3+b2),
libpcl-sample-consensus1.8 (= 1.8.0+dfsg1-3+b2), libpcl-search1.8 (=
1.8.0+dfsg1-3+b2), libpcl-segmentation1.8 (= 1.8.0+dfsg1-3+b2),
libpcl-stereo1.8 (= 1.8.0+dfsg1-3+b2), libpcl-surface1.8 (=
1.8.0+dfsg1-3+b2), libpcl-tracking1.8 (= 1.8.0+dfsg1-3+b2),
libpcl-visualization1.8 (= 1.8.0+dfsg1-3+b2)
Reproducible example:
1. mkdir /tmp/test_pcl_bug
2. cd /tmp/test_pcl_bug && mkdir src && mkdir build
3. touch CMakelists.txt
4. add the following content to the CMakeLists.txt
CMakeLists.txt:
```
cmake_minimum_required(VERSION 2.8)
project(bug_pcl_qt)
find_package(PCL REQUIRED)
message(STATUS "${PCL_LIBRARIES}")
message(STATUS "${PCL_INCLUDE_DIRS}")
include_directories("${PCL_INCLUDE_DIRS}")
add_library(test_pcl src/test.cpp)
target_include_directories(test_pcl SYSTEM PUBLIC ${PCL_INCLUDE_DIRS})
target_link_libraries(test_pcl ${PCL_LIBRARIES})
```
5. touch src/test.cpp
6. add the following content to the src/test.cpp file (code copied from
http://pointclouds.org/documentation/tutorials/writing_pcd.php#writing-pcd)
```
#include <iostream>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
int foo (int argc, char** argv)
{
pcl::PointCloud<pcl::PointXYZ> cloud;
// Fill in the cloud data
cloud.width = 5;
cloud.height = 1;
cloud.is_dense = false;
cloud.points.resize (cloud.width * cloud.height);
for (size_t i = 0; i < cloud.points.size (); ++i)
{
cloud.points[i].x = 1024 * rand () / (RAND_MAX + 1.0f);
cloud.points[i].y = 1024 * rand () / (RAND_MAX + 1.0f);
cloud.points[i].z = 1024 * rand () / (RAND_MAX + 1.0f);
}
pcl::io::savePCDFileASCII ("test_pcd.pcd", cloud);
std::cerr << "Saved " << cloud.points.size () << " data points to
test_pcd.pcd." << std::endl;
for (size_t i = 0; i < cloud.points.size (); ++i)
std::cerr << " " << cloud.points[i].x << " " << cloud.points[i].y <<
" " << cloud.points[i].z << std::endl;
return (0);
}
```
7. cd /tmp/test_pcl_bug/build
8. cmake -DBUILD_SHARED_LIBS=ON ..
8) throws the following warning:
```
CMake Warning (dev) at CMakeLists.txt:10 (add_library):
Policy CMP0028 is not set: Double colon in target name means ALIAS or
IMPORTED target. Run "cmake --help-policy CMP0028" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.
Target "test_pcl" links to target "Qt5::Widgets" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target,
or
an ALIAS target is missing?
```
9. make
9) fails with error message:
```
[100%] Linking CXX shared library libtest_pcl.so
/usr/bin/ld: cannot find -lQt5::Widgets
collect2: error: ld returned 1 exit status
CMakeFiles/test_pcl.dir/build.make:364: recipe for target 'libtest_pcl.so'
failed
make[2]: *** [libtest_pcl.so] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/test_pcl.dir/all'
failed
make[1]: *** [CMakeFiles/test_pcl.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
```
Installing "libvtk6-qt-dev" and repeating the steps above fixes the issue.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/debian-science-maintainers/attachments/20180402/06bcc087/attachment-0003.html>
More information about the debian-science-maintainers
mailing list