qxmpp icon indicating copy to clipboard operation
qxmpp copied to clipboard

Failed to execute cmake

Open H-hzh opened this issue 10 months ago • 5 comments

Hi, this is my first time using qxmpp, but I am having problems as follows

-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.22631.
CMake Error at CMakeLists.txt:22 (find_package):
  Could not find a configuration file for package "QT" that is compatible
  with requested version "".

  The following configuration files were considered but not accepted:

    D:/qt6.0/6.2.4/mingw_64/lib/cmake/Qt6/Qt6Config.cmake, version: 6.2.4 (64bit)

-- Configuring incomplete, errors occurred!

find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Network Xml)//22 As I said, this is my first time to use it, and it's a little bad, so please explain it to me

H-hzh avatar Apr 06 '24 13:04 H-hzh

Not sure whats the problem here.

Does it make any difference if you try to replace the line with:

find_package(Qt 6 REQUIRED COMPONENTS Core Network Xml)

lnjX avatar Apr 06 '24 20:04 lnjX

After the change is

CMake Warning (dev) at CMakeLists.txt:23 (find_package):
  Policy CMP0084 is not set: The FindQt module does not exist for
  find_package().  Run "cmake --help-policy CMP0084" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at C:/Program Files/CMake/share/cmake-3.26/Modules/FindQt.cmake:87 (message):
  FindQt was called with invalid version '6'.  Only Qt major versions 3 or 4
  are supported.  If you do not need to support both Qt3 and Qt4 in your
  source consider calling find_package(Qt3) or find_package(Qt4) instead of
  find_package(Qt) instead.
Call Stack (most recent call first):
  CMakeLists.txt:23 (find_package)


-- Configuring incomplete, errors occurred!

H-hzh avatar Apr 07 '24 02:04 H-hzh

Sorry! My mistake, I actually wanted to write:

find_package(Qt6 6.0 REQUIRED COMPONENTS Core Network Xml)

lnjX avatar Apr 07 '24 12:04 lnjX

Sorry, it is still the same error, is it that I did not configure this path properly D:/qt6.0/6.2.4/mingw_64/lib/cmake/Qt6/Qt6Config.cmake How to configure this, please

H-hzh avatar Apr 07 '24 13:04 H-hzh

You can set the path using cmake with -DQt6_DIR=D:/qt6.0/6.2.4/mingw_64/lib/cmake/Qt6/, but it seems like cmake has already found that directory, I'm not sure what's the error here.

lnjX avatar Apr 07 '24 13:04 lnjX