I have a quick question about a function FIND_PACKAGEin CMake. I have a project that uses point cloud library (PCL). PCL is Boost dependent, and my project also works. So, at the top of my CMakeLists.txt, I have the following:
FIND_PACKAGE(Boost REQUIRED COMPONENTS program_options)
SET(Boost_PROJECT_LIBRARIES ${Boost_LIBRARIES})
FIND_PACKAGE(PCL 1.6 REQUIRED COMPONENTS common search)
My project uses the Boost.program_options library, and PCL uses a few others. When executed FIND_PACKAGE(PCL ...), it overwrites the previous one ${Boost_LIBRARIES}with its own required libraries. I came up with a job to save the Boost libraries needed for my project and then find the PCL package.
My question for CMake gurus is the best way to deal with such things in CMake? Or maybe this is an error in the FindBoost.cmake or FindPCL.cmake modules?
source
share