stachenov / quazip

Qt/C++ wrapper over minizip
Other
578 stars 234 forks source link

CMake errors when configuring from latest QuaZip (1.4) #180

Closed bobhairgrove closed 8 months ago

bobhairgrove commented 1 year ago

Trying to build QuaZip on Linux Ubuntu 22.04 with Qt 6.5. My CMake version is 3.26.3.

I extracted the QuaZip sources to a directory such as this:

/home/myuser/../quazip/

Then I tried to run cmake like this:

cd /home/myuser/../quazip/
mkdir build
cd build
cmake -S .. -B . -D QUAZIP_QT_MAJOR_VERSION=6

This was the result:

CMake Warning (dev) at CMakeLists.txt:1 (project):
  cmake_minimum_required() should be called prior to this top-level project()
  call.  Please see the cmake-commands(7) manual for usage documentation of
  both commands.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning at CMakeLists.txt:1 (project):
  VERSION keyword not followed by a value or was followed by a value that
  expanded to nothing.

CMake Error at CMakeLists.txt:1 (project):
  VERSION not allowed unless CMP0048 is set to NEW

-- Configuring incomplete, errors occurred!

It isn't finding QuaZip's VERSION, apparently.

Some time ago, with QuaZip 1.3 and Qt 5, I was able to complete the build successfully by using the code in the ver branch. What do I need to do now?

cen1 commented 1 year ago

Why are you using the ver branch?

I tried master and 1.4 on Debian 12, very similar cmake version, no issues.

bobhairgrove commented 1 year ago

OK, I had two problems here ...

  1. I forgot to extract the entire project and only had extracted the source directory;
  2. I ran into a Qt6 bug concerning CMake.

The following command line built successfully now:

cmake -S .. -B . -DQUAZIP_QT_MAJOR_VERSION=6 -DCMAKE_PREFIX_PATH=/home/bob/code/Qt/6.5.3/gcc_64/lib/cmake/Qt6

Sorry for the noise ... however, it might be a good idea to add a note to the documentation that this is necessary for building with Qt 6?

cen1 commented 1 year ago

You seem to have Qt located in a specific directory so that makes sense. I installed it from package manager and did not have to add anything extra for example.

cen1 commented 8 months ago

Instructions to specify custom Qt install has been added to main readme.