Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

find_package(Boost) returns empty Boost_LIBRARIES

Tags:

boost

cmake version 3.8.2

I have a strange problem. When I do find_package(Boost), then the Boost_LIBRARIES is empty. But when I do find_package(Boost REQUIRED filesystem), the Boost_LIBRARIES variable shows the corresponding libraries.

In both the cases, Boost is found, because it shows that the Boost version is 1.64.

with REQUIRED

-- Boost version: 1.64.0
-- Found the following Boost libraries:
--   filesystem
--   system
       Boost_INCLUDE_DIRS: /usr/local/include
       OpenCV_INCLUDE_DIRS: /usr/local/include;/usr/local/include/opencv
       Boost_LIBRARIES: /usr/local/lib/libboost_filesystem.so;/usr/local/lib/libboost_system.so
       OpenCV_LIBRARIES: opencv_calib3d;opencv_core;opencv_features2d;opencv_flann;opencv_highgui;opencv_imgcodecs;opencv_imgproc;opencv_ml;opencv_objdetect;opencv_photo;opencv_shape;opencv_stitching;opencv_superres;opencv_video;opencv_videoio;opencv_videostab

Without REQUIRED

-- Boost version: 1.64.0
       Boost_INCLUDE_DIRS: /usr/local/include
       OpenCV_INCLUDE_DIRS: /usr/local/include;/usr/local/include/opencv
       Boost_LIBRARIES: 
       OpenCV_LIBRARIES: opencv_calib3d;opencv_core;opencv_features2d;opencv_flann;opencv_highgui;opencv_imgcodecs;opencv_imgproc;opencv_ml;opencv_objdetect;opencv_photo;opencv_shape;opencv_stitching;opencv_superres;opencv_video;opencv_videoio;opencv_videostab

Shouldnt the boost libraries, also show just the libraries and not the whole path, like the opencv?

Although I have the program_options in the same folder, the Boost cannot find it and cmake throws an error.

  Could not find the following Boost libraries:

          boost_program_options

Please see the ll.

truncated ll output.....
-rw-r--r-- 1 root root 1558464 Aug 12 06:23 /usr/local/lib/libboost_program_options.a
lrwxrwxrwx 1 root root      34 Aug 12 06:23 /usr/local/lib/libboost_program_options.so -> libboost_program_options.so.1.64.0*
-rwxr-xr-x 1 root root  658920 Aug 12 06:23 /usr/local/lib/libboost_program_options.so.1.64.0*
like image 837
infoclogged Avatar asked Oct 17 '22 07:10

infoclogged


1 Answers

No matter REQUIRED is present or not, it's always empty.

Mac High Sierra/CMake 3.10.1.

It seems a bug of FindBoost.cmake

like image 90
Li Zhanhui Avatar answered Oct 21 '22 08:10

Li Zhanhui