Search code examples
qtcmakecmake-gui

How to set qt5 path with cmake find_package on Windows?


I am adding QT like this:

find_package(Qt5 COMPONENTS Core Quick REQUIRED)
...
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Quick ${OpenCV_LIBS})

but cmake finds some python artifacts instead of expected C:\QT...

enter image description here

How can I change this? Tried to find some examples, but didn't find any clear instruction, which subfolder of C:\QT\ I should specify (any where).


Solution

  • My workaround was to put desired QT to the top of PATH variable. It has to be in PATH if you want CMAKE to find it.