Using compiled Qt5 with CMake on ARM Linux
-
Hi, I tried to build Qt5 Desktop Open-Source natively on an ARM dev board, I was able to get everything except Qt Multimedia built, but I couldn't get it build and I only actually need Qt Base so I'm trying to use Qt Base even though Qt5 hasn't been fully built & installed. I can build & run the various Qt5 examples using the supplied Makefiles, but I'm trying to use CMake in my project, and can't figure out how to get CMake to find Qt5. Does anyone know how to get CMake to find Qt5, if I know where the CMake files are?
When I run cmake I get the error:
CMake Error at CMakeLists.txt:18 (find_package): By not providing "FindQt5Widgets.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5Widgets", but CMake did not find one. Could not find a package configuration file provided by "Qt5Widgets" with any of the following names: Qt5WidgetsConfig.cmake qt5widgets-config.cmake Add the installation prefix of "Qt5Widgets" to CMAKE_PREFIX_PATH or set "Qt5Widgets_DIR" to a directory containing one of the above files. If "Qt5Widgets" provides a separate development package or SDK, be sure it has been installed.
I found that file: "~/qt-everywhere-opensource-src-5.6.0/qtbase/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake" but if I set CMAKE_PREFIX_PATH or Qt5Widgets_DIR to that folder, it still doesn't work. Any ideas?
-
Hi and welcome to devnet,
It's
CMAKE_PREFIX_PATH=~/qt-everywhere-opensource-src-5.6.0/qtbase/lib/cmake
and you should be good to go. -
@SGaist Thanks it worked! I thought I had already tried that combination but I guess not. Any chance you also know how to build Qt5 from source but skip Qt Multimedia? I tried "-skip multimedia" when configuring Qt5 but it still ended up trying to build Qt Multimedia.
-
If skip doesn't work, just move the qtmultimedia folder out of the source tree when calling configure.