0

I have a library that I installed from source. It looks fine, the install manifest shows that all files I need have been installed:

/usr/local/lib/cmake/Findaruco.cmake
/usr/local/lib/pkgconfig/aruco-uninstalled.pc
/usr/local/lib/pkgconfig/aruco.pc
/usr/local/lib/libaruco.so.2.0.7
/usr/local/lib/libaruco.so.2.0
/usr/local/lib/libaruco.so
/usr/local/include/aruco/marker.h
/usr/local/include/aruco/markerdetector.h
/usr/local/include/aruco/dictionary.h
/usr/local/include/aruco/levmarq.h
/usr/local/include/aruco/markermap.h
/usr/local/include/aruco/cameraparameters.h
/usr/local/include/aruco/posetracker.h
/usr/local/include/aruco/exports.h
/usr/local/include/aruco/markerlabeler.h
/usr/local/include/aruco/cvdrawingutils.h
/usr/local/include/aruco/ar_omp.h
/usr/local/include/aruco/aruco.h
/usr/local/include/aruco/dictionary_based.h
/usr/local/include/aruco/svmmarkers.h
/usr/local/bin/aruco_tracker
/usr/local/bin/aruco_simple
/usr/local/bin/aruco_test
/usr/local/bin/aruco_print_marker
/usr/local/bin/aruco_print_dictionary
/usr/local/bin/aruco_markermap_pix2meters
/usr/local/bin/aruco_simple_markermap
/usr/local/bin/aruco_test_markermap
/usr/local/bin/aruco_calibration
/usr/local/bin/aruco_calibration_fromimages

I can also include the headers that I need from that library in my project; they are found.

What does not work is actually linking the library. my cmakeLists has the following line:

find_package(aruco REQUIRED)

I would think that that would be enough, since the Findaruco.cmake file is in /usr/local/lib/cmake. However, cmake is unable to find the library. I also noticed that locate .so | grep aruco does not actually find the library. It's output is:

/usr/local/lib/libopencv_aruco.so
/usr/local/lib/libopencv_aruco.so.3.1
/usr/local/lib/libopencv_aruco.so.3.1.0

So something is obviously wrong. I additionally noticed that on installation cmake tells me the following (along with others from that library):

Removed runtime path from "/usr/local/lib/libaruco.so.2.0.7"

Does that have anything to do with it? If you need a look at the library, you can find it here on sourceforge. I can't build without it, how do I get this to work?

RunOrVeith
  • 4,487
  • 4
  • 32
  • 50

1 Answers1

0

so cmake modules are searched for in specific paths. I believe the default is something along the lines of /usr/share/cmake/<version>/modules

you could set the cmake_module_path variable to the directory you installed the Findaruco cmake file into, or move that module to the location wherever your other cmake files are.

side note: if you have not run $ sudo updatedb then $ locate will not reveal the new libraries you installed because it has not been added to the database for locate

kirinthos
  • 452
  • 2
  • 9
  • Alright thanks, I copied the Findaruco.cmake file to a /modules folder in my project and set the CMAKE_MODULE_PATH to that. It works now. I do think however that the creator of the aruco library should have made an arucoConfig.cmake file. – RunOrVeith Jun 20 '16 at 14:31
  • yes he should have, iirc it's relatively newer (maybe version 3 of cmake?) so maybe the aruco lib is older idk, glad that solved your problem – kirinthos Jun 20 '16 at 14:43