SNS
SNS

Reputation: 205

Run ArUco example using Cmake


I am new to Cmake and to build projects using it. I have not used this tool before and hence have less knowledge on how it works.
I am trying to get the examples of the ArUco library run. But the README provided by the ArUco library suggests to use the Cmake to run them. I have Windows 8.1 and Visual studio 2013 and I have also downloaded and installed the Cmake3.4.0 .
After installing it I searched for examples or tutorials on Cmake, and found a few video tutorials that showed how to compile programs using cmake. But while followed the same steps I got errors. Error is as shown

I went through different questions posted in the forum but didn't find an answer. I am not sure I need to set Environment variables and paths. Some suggestions on this would be really helpful.
Thank you very much for the help.

Error:

The C compiler identification is MSVC 18.0.40629.0
The CXX compiler identification is MSVC 18.0.40629.0

Check for working C compiler using: Visual Studio 12 2013
Check for working C compiler using: Visual Studio 12 2013 -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler using: Visual Studio 12 2013
Check for working CXX compiler using: Visual Studio 12 2013 -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
CMake Error at CMakeLists.txt:5 (find_package):
By not providing "Findaruco.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "aruco", but
CMake did not find one.

Could not find a package configuration file provided by "aruco" with any of the following names:

arucoConfig.cmake<br/>
aruco-config.cmake<br/>

Add the installation prefix of "aruco" to CMAKE_PREFIX_PATH or set "aruco_DIR" to a directory containing one of the above files. If "aruco" provides a separate development package or SDK, be sure it has been installed.

Configuring incomplete, errors occurred!
See also "E:/../aruco_testproject/build/CMakeFiles/CMakeOutput.log".

Upvotes: 0

Views: 3253

Answers (2)

user3209599
user3209599

Reputation: 11

I had the same issue on Mac, hope Windows users find this useful too.

Most probably you did't install aruco. Go to the aruco source folder that you dowloaded (ie ~/Downloads/aruco-2.0.14) and run following commands cmake . make make install

Then you will be able to build aruco_testproject cmake . make Hope this helps

Upvotes: 1

MarkusAtCvlabDotDe
MarkusAtCvlabDotDe

Reputation: 1042

Actually its pretty clear whats goin wrong. CMake cant find certain packages.

Quick and dirty solution

One solution is to do what the error message suggests:

Go into the specific CMakeLists.txt file and set the aruco_Dir variable like that

set( auruco_Dir /PATH/TO/ARUCO/WHERE/AURUCOCONFIG.CMAKE/IS/LOCATED/AS/WELL )

The true way

A better approach is to provide the Findaruco.cmake module in the CMAKE_MODULE_PATH. This is called module because it integrates with CMake's find_package mechanism (https://cmake.org/cmake/help/v3.0/command/find_package.html, Last accessed at 11.12.2015) and provides the central information about where aruco can be found in your file system. (Aruco is just exemplary here. Same goes for any other module)

What is this good for, why do I need find_packageand those modules?

Answer is simple. You have only one central place to manage and not many. Imagine the location of your pacjage changes. Do you want to fix every single CMakeLists.txt file referencing this package? Its like basic programming paradigms

  • Dont repeat yourself

  • Dont hardcode anything

Upvotes: 0

Related Questions