Closed allenck closed 8 months ago
I think something must be wrong with your install. I don't have Ubuntu Desktop with me right now but the path to the file should be Qt/5.15.2/<compiler>/lib/cmake/Qt5/Qt5Config.cmake
.
I verified this on Mac OS, Windows 10 and Fedora using Qt Online Installer.
Seems as if no proper version can be found at all. You can set QUAZIP_QT_MAJOR_VERSION
to 6
to enforce a specific version, see
This is what I used for a custom Qt6 build:
export PATH="${HOME}/Projects/GitHub/qt6_dev/qt6-install:$PATH"
where qt6-install
contains all bin/
, lib/
, etc folders of my Qt installation.
Thw Qt online installer is definitely not the same as the Qt Maintenance Tool! I use the Qt Maintenance tool because I don't want a version of QT installed to /usr/... whatever.
I use the Qt maintenance tool as well on Windows, macOS and Linux (Kubuntu). It installs Qt to $HOME/Qt
per default, I think (or to C:\Qt
on Windows). Add the correct Qt version to your $PATH
(as in my example above) and try to run CMake again. As far as I know, QuaZip's CMakeLists.txt first tries to find Qt6, and if it does not find it, tries to load Qt5. If that is also not found, it fails with the error message you got. :-)
CMake detects a Qt installation by looking for qmake
or qmake.exe
in your PATH
.
If you are not using the "system" Qt, then you must manually specify where the version of Qt you wish to use was installed.
Otherwise, how could your build system possibly know which version of Qt you want to use?
Qt Creator specifies this as part of the chosen "Kit", for both cmake (cmakelists.txt) and qmake (*.pro) builds.
When building using command-line tools, there are several different ways you can specify which version of Qt you wish to use:
<Qt>/5.<minor>.<patch>/<compiler>/lib/cmake/Qt5
<Qt>/5.<minor>.<patch>/<compiler>
Qt6 is similar.
According to my research, CMAKE_PREFIX_PATH
is the preferred way which should work for either version. Documented in readme.
I have two versions of Qt on my machine, both installed using the Qt Maintenance tool. I have not installed a standard Ubuntu 'package'. To do so would take up unnecessary space and possibly cause conflicts.
When I tried to build version 1.3, I got this error: `CMake Error at CMakeLists.txt:59 (find_package): By not providing "FindQt5.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5", but CMake did not find one.
Could not find a package configuration file provided by "Qt5" with any of the following names:
Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR" to a directory containing one of the above files. If "Qt5" provides a separate development package or SDK, be sure it has been installed.
-- Configuring incomplete, errors occurred! ` I have been unable to locate any files like Qt5Config.cmake or qt5-config.cmake in my Qt installation. Obviously, these are files which exist in some 'package' but not in the Qt versions installed by Qt Maitenance Tool.
It seems to me that the proper way of building QaZip would be to provide a QtCreator .pro file or recognize the directory structure constructed by the Qt Maintenance Tool.