Ask Your Question
1

How to set the path to QT5 in cmake?

asked 2013-10-21 12:37:13 -0600

Brixus gravatar image

updated 2013-10-21 12:41:48 -0600

berak gravatar image

Hello,

I am not able to install OpenCV 2.4.6.1 properly. Poorly Cmake does not find the QT stuff and I get the following warning:

"CMake Warning at cmake/OpenCVFindLibsGUI.cmake:20 (find_package): By not providing "FindQt5Gui.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5Gui", but CMake did not find one.

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

Qt5GuiConfig.cmake
qt5gui-config.cmake"

I know the correct path to this things, but I do not know how to tell it Cmake. Also with google I found no solution.

This is the normal command I use: cmake -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..

How can I add the path to the Qt sources or is there another solution?

Thank you very much :)

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted
1

answered 2013-10-24 06:43:27 -0600

Brixus gravatar image

Thank you very much.

Your answer gave me the right hint.

Qt5 was not installed correct. On Ubuntu it is not enough to use the Qt installer.

This guide here solved my problems: Guide

Ater this I could install OpenCv without problems. :)

edit flag offensive delete link more

Comments

glad to hear that!

antonio gravatar imageantonio ( 2013-10-24 07:21:47 -0600 )edit
0

answered 2013-10-21 13:10:57 -0600

antonio gravatar image

Here are the steps that worked for me in configuring OpenCV with Qt and Visual Studio:

  1. Make sure you download the Qt source from here (make sure you download the zip file, in the Qt download page look for: "The source code is available as a zip..."
  2. Extract the zip file (say in: C:\Qt\QtSource485)
  3. Then you need to build it. Start up a Visual Studio Command Prompt (2010).
  4. Now navigate to the extracted folder and enter inside it by using the console window.
  5. Enter the following command (it worked for me fine):

    configure.exe -release -no-webkit -no-phonon -no-phonon-backend -no-script -no-scripttools -no-qt3support -no-multimedia -no-ltcg

  6. Then enter

    nmake

  7. Then add the built binary files path to the system path...If you have Matlab installed, make sure the C:\Qt\QtSource485\bin path is set BEFORE the Matlab path (this is crucial it took me hours to find why it does not worked otherwise!)

  8. Now start the CMake (cmake-gui). Check the 'Advanced' tick box before pressing Configure.
  9. After configuration tick 'WITH_QT'.
  10. Untick the 'Advanced' tick box.
  11. Press again Configure.
  12. Look for the 'QT_QMAKE_EXECUTABLE' option and browse: 'C:/Qt/QtSource485/bin/qmake.exe'
  13. Press generate and you're done. Then you are ready to build OpenCV with Qt! Good luck!
edit flag offensive delete link more

Comments

Thank you very very much :-) I forgot to tell that I use Linux, my fault. Sorry for this :-/

Brixus gravatar imageBrixus ( 2013-10-21 16:06:17 -0600 )edit

Question Tools

Stats

Asked: 2013-10-21 12:37:13 -0600

Seen: 27,605 times

Last updated: Oct 24 '13