Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to execute cmake #611

Open
H-hzh opened this issue Apr 6, 2024 · 5 comments
Open

Failed to execute cmake #611

H-hzh opened this issue Apr 6, 2024 · 5 comments

Comments

@H-hzh
Copy link

H-hzh commented Apr 6, 2024

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

@lnjX
Copy link
Member

lnjX commented Apr 6, 2024

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)

@H-hzh
Copy link
Author

H-hzh commented Apr 7, 2024

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!

@lnjX
Copy link
Member

lnjX commented Apr 7, 2024

Sorry! My mistake, I actually wanted to write:

find_package(Qt6 6.0 REQUIRED COMPONENTS Core Network Xml)

@H-hzh
Copy link
Author

H-hzh commented Apr 7, 2024

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

@lnjX
Copy link
Member

lnjX commented Apr 7, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants