문제

I already compiled Open Scene Graph 3.2 against Qt4. I managed it through an initial cache setting the following variables:

set(ENV{QTDIR} "path/to/qt4" CACHE PATH "") set(Qt_FIND_VERSION "4.8.5" CACHE PATH "")

But when I try to change this to qt5 it doesn't work. Qt5 is not found. Any hints what settings should be used when copiling Open Scene Graph 3.2 with Qt5 and Qt5 should be found (most parts) automatically with the find script of CMake?

도움이 되었습니까?

해결책

Just set these variables to feed the cache:

set(DESIRED_QT_VERSION "5" CACHE STRING "")
set(CMAKE_PREFIX_PATH "C:/Qt/5.1.1/msvc2012_64_opengl" CACHE PATH "")

다른 팁

With Qt 5 new CMake macros have been defined. The method to find and use Qt in a CMake project has been deeply updated. A good starting point is the doc about CMake usage (https://qt-project.org/doc/qt-5.1/qtdoc/cmake-manual.html).

In general, the easiest way to help CMake finding Qt is to add the Qt bin folder to your path variable (the folder containing qmake binary). If you can't/don't want to do so, I suggest you to use CMAKE_PREFIX_PATH variable.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top