How to go back to QT4 after failing to work with QT5?
I ran into issues with QT5, so I am trying to go back to QT4.
Somehow CMake still wants QT5 and I don't know how it knows QT5 was ever installed. How can I tell CMake to forget QT5?
Here is my failed CMake output (just the beginning):
CMake Warning at cmake/OpenCVFindLibsGUI.cmake:19 (find_package): By not providing "FindQt5Core.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5Core", but CMake did not find one.
Could not find a package configuration file provided by "Qt5Core" with any of the following names:
Qt5CoreConfig.cmake
qt5core-config.cmake
I still can't answer my own questions, though I am a member now for much longer than two days =)
The answer is that you have to edit cmake/OpenCVFindLibsGUI.cmake to do this, or else delete all of the QT5 files. I didn't want to delete QT5 so I commented out the conditional at the beginning of that file which searches for QT5 packages, and if it finds them then it will cause you to use QT5:
if(WITH_QT)
if(NOT CMAKE_VERSION VERSION_LESS 2.8.3 AND NOT WITH_QT EQUAL 4)
# find_package(Qt5Core) # find_package(Qt5Gui) # find_package(Qt5Widgets) #find_package(Qt5Test)
find_package(Qt5Concurrent)
if(Qt5Core_FOUND AND Qt5Gui_FOUND AND Qt5Widgets_FOUND AND #Qt5Test_FOUND AND Qt5Concurrent_FOUND)
set(HAVE_QT5 ON)
set(HAVE_QT ON)
add_definitions(-DHAV
Worked for me!