In my other tutorial, I showed you how to install your code in an arbitrary location in Unix/ Linux systems. In this tutorial, I’m gonna show you how to find them after installation. Here I have two examples: OpenCV, PCL point cloud
I can assume that you have compiled and installed them using the following command:
1 |
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX:PATH=~/usr .. && make -j8 all install |
1)PCL point cloud
put this line in your CMake file:
1 |
set(PCL_DIR "$ENV{HOME}/usr/share/pcl-1.8/") |
and check if everything is correct:
1 2 3 4 5 6 7 8 9 |
find_package(PCL 1.8.0 REQUIRED COMPONENTS common octree io kdtree search sample_consensus filters 2d features registration geometry visualization outofcore surface keypoints ml segmentation recognition people tracking stereo) MESSAGE("PCL_FOUND:" ${PCL_FOUND}) MESSAGE("PCL_INCLUDE_DIRS:" ${PCL_LIBRARY_DIRS}) MESSAGE("PCL_LIBRARIES:" ${PCL_LIBRARIES}) MESSAGE("PCL_LIBRARY_DIRS:" ${PCL_LIBRARY_DIRS}) MESSAGE("PCL_VERSION:" ${PCL_VERSION}) MESSAGE("PCL_COMPONENTS:" ${PCL_COMPONENTS}) MESSAGE("PCL_DEFINITIONS:" ${PCL_DEFINITIONS}) |
2)OpenCV
put this line in your CMake file:
1 |
set(OpenCV_DIR "$ENV{HOME}/usr/lib/cmake/opencv4") |
and check if everything is correct:
1 2 3 4 5 6 |
FIND_PACKAGE( OpenCV REQUIRED ) MESSAGE("OpenCV_DIR: " ${OpenCV_DIR}) MESSAGE("OpenCV_VERSION: " ${OpenCV_VERSION}) MESSAGE("OpenCV_INCLUDE_DIRS: " ${OpenCV_INCLUDE_DIRS}) MESSAGE("OpenCV_LIBS: " ${OpenCV_LIBS}) |
if you don’t want to make changes to your CMakeList.txt file you can send <>__DIR as CMake parameter. Example:
1 |
cmake -DCMAKE_BUILD_TYPE=Release -DOpenCV_DIR=~/usr/lib/cmake/opencv4 |