Public bug reported:

In PCLConfig.cmake line 115&116 says:

if(PCL_ALL_IN_ONE_INSTALLER)
    set(BOOST_ROOT "${PCL_ROOT}/3rdParty/Boost")

,in which PCL_ALL_IN_ONE_INSTALLER has already set to be ON in line 435
through a normal apt install procedure. That will lead to a link error
of libboost, if we firstly find boost and then find pcl. The following
is a simple example of CMakeList.txt:

cmake_minimum_required(VERSION 3.16)

project(main)

find_package(
  Boost
  COMPONENTS
  system
  thread
  chrono
  REQUIRED
  )
find_package(
  PCL
  REQUIRED
  )

include_directories(
  ${Boost_INCLUDE_DIRS}
  )
link_directories(
  ${Boost_LIBRARY_DIRS}
  )

add_executable(main main.cpp)

target_link_libraries(
        main
        ${Boost_LIBRARIES}
        )

Any used boost functions in main.cpp will lead to link error like this:
main.cpp:5: undefined reference to
`boost::thread::hardware_concurrency()', even though pcl remains unused
in the cpp file. Simply move find_package(Boost ...) to the back of
find_package(PCL ...) will solve the problem, because now we are using
the boost lib provided by pcl.However, such a solution is not
stragihtforward at all anc hart to be figured out. Hope you can help to
remove such a confusing change of BOOST_ROOT, given that libboost-dev
can also easily get installed by apt and already exists in many ubuntus.

** Affects: pcl (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1928819

Title:
  File "PCLConfig.cmake" will unexpectedly change BOOST_ROOT and lead to
  link error

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pcl/+bug/1928819/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to