3

I followed these instructions in the configuration of OpenCV SDK for using it in Qt Creator IDE, but I couldn't conclude point 6.5, due to configuration errors in Cmake-GUI. I setup the configuration in CMake of the compilers gcc and g++ contained in Qt folder for MinGW32, and all looks Ok. But when Cmake-GUI starts the process of build configuration it ends up saying

"Error in configuration process, project files may be invalid".

It can't find the following:

  • QT_QMAKE_EXECUTABLE;
  • Qt5Concurrent_DIR;
  • QT5Core_DIR;
  • QT5Gui_DIR;
  • QT5Test_DIR;
  • QT5Widgets_DIR.

After this issue I tried to go on with following points of configuration tutorial, without reaching the final instruction of mingw32-make install. I'm using the following versions of softwares: Qt 5.3.0, OpenCV 2.4.9, CMake 2.8.12.2. My OS is Windows 7.

How can I recover the missing Qt files in CMake configuration? Is there an alternative way for configuring OpenCV with Qt (like using precompiled build of OpenCV libraries)?

5
  • How is CMake called? Have you passed the QT5Core_DIR? Commented May 28, 2014 at 13:16
  • I just tried to locate the files manually into the QT folders, now I'm waiting the result of mingw32-make instruction on cmd prompt... and then mingw32-make install has to work, this last step never worked before. I'll post soon the result. Commented May 28, 2014 at 14:42
  • It's ok, it is working now! Commented May 29, 2014 at 13:36
  • Great, does this include running "make install" from your old original question? I created an answer below, please accept it. Commented May 29, 2014 at 17:01
  • Yes, I concluded the whole configuration, now openCV works with QT Creator. Commented May 29, 2014 at 20:47

2 Answers 2

8

You just need to indicate CMake the correct paths to each one. Click oh the path to browse and set each one individually:

  • QT_QMAKE_EXECUTABLE; For this one, you need to search inside the Qt installation folder for the /bin directory. On it, you' ll find the qmake.exe. In my case it was C:/Qt/5.3/winrt_x64/bin/qmake.exe

    All the following ones are in the Qt's /lib/cmake directory. In my case: C:/Qt/5.3/winrt_x64/lib/cmake :

  • Qt5Concurrent_DIR;
    C:/Qt/5.3/winrt_x64/lib/cmake/Qt5Concurrent

  • QT5Core_DIR;
    C:/Qt/5.3/winrt_x64/lib/cmake/Qt5Core

  • QT5Gui_DIR;
    C:/Qt/5.3/winrt_x64/lib/cmake/Qt5Gui

  • QT5Test_DIR;
    C:/Qt/5.3/winrt_x64/lib/cmake/Qt5Test

  • QT5Widgets_DIR.
    C:/Qt/5.3/winrt_x64/lib/cmake/Qt5Widgets

Then click generate. It' ll show a new error and ask you for the QT5OpenGL_DIR. Just as before, show CMake the correct directory. In my case: C:/Qt/5.3/winrt_x64/lib/cmake/Qt5OpenGL. Finally, click Configure again, and then Generate, and now you're done creating the build files.

Sign up to request clarification or add additional context in comments.

1 Comment

thank you so much life-saver! this should be the accepted answer.
0

You have to specify the location of Qt manually by passing it as an argument for QT5Core_DIR. Qt5_DIR or CMAKE_PREFIX_PATH does also the trick.

Example
Given your Qt 5 is installed at /opt/selfcompiled/Qt5. When calling cmake, add the flag from above:

cmake -DQt5_DIR=/opt/selfcompiled/Qt5 <pathToSourceDir>

Once the Qt 5 directory is set and found by CMake, all the other variables related to Qt 5 should be found from there, too.

1 Comment

This answer is not precise enough. Please specify the steps needed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.