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

[BUG] [cpp-qt] Unable to run cmake and use Qt5 anymore #17712

Closed
1 of 6 tasks
xconverge opened this issue Jan 25, 2024 · 2 comments
Closed
1 of 6 tasks

[BUG] [cpp-qt] Unable to run cmake and use Qt5 anymore #17712

xconverge opened this issue Jan 25, 2024 · 2 comments

Comments

@xconverge
Copy link
Contributor

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

I am unable to run the generator after updating to a newer version (7.2.0) and using Qt5. I didn't change anything about my Qt installation, just the openapi-generator version, and ran into failures. (I also upgraded CMake just to be sure).

I set CMAKE_PREFIX_PATH before running like this (to set my Qt version):

export CMAKE_PREFIX_PATH=C:\\Qt\\5.15.16\\msvc2019_64\\lib\\cmake
cmake  ../src/client/

I get this:

-- Building for: Visual Studio 17 2022
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Selecting Windows SDK version 10.0.20348.0 to target Windows 10.0.22631.
-- The C compiler identification is MSVC 19.38.33134.0
-- The CXX compiler identification is MSVC 19.38.33134.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning (dev) at CMakeLists.txt:5 (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.28/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Qt3 (missing: QT_QT_LIBRARY QT_INCLUDE_DIR
  QT_MOC_EXECUTABLE)
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files/CMake/share/cmake-3.28/Modules/FindQt3.cmake:213 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  C:/Program Files/CMake/share/cmake-3.28/Modules/FindQt.cmake:160 (include)
  CMakeLists.txt:5 (find_package)


-- Configuring incomplete, errors occurred!

If I add find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Network Gui) back in, all works fine and generates

@MartinDelille do you remember why in #14968 this line was removed?

@MartinDelille
Copy link
Contributor

This is indeed an error that passed review without anyone noticing it! Would you be able to submit a PR to fix it ? You'll need to update both the CMakeLists.txt.mustache and CMakeLists.txt files.

@xconverge
Copy link
Contributor Author

This allowed me to build the client but I ran into linker errors when I went to use it, is there more to that file/changeset that looks like an error to you? or just the 1 line missing?

I probably wont be able to make a PR as I am phasing away from using this client but I will see if I have my dev environment setup still later in case I find some time

MartinDelille added a commit to MartinDelille/openapi-generator that referenced this issue Jan 27, 2024
@wing328 wing328 closed this as completed in c71eb5d Feb 8, 2024
kota65535 pushed a commit to kota65535/openapi-generator that referenced this issue Feb 23, 2024
fix OpenAPITools#17712) (OpenAPITools#17721)

* [cpp-qt-client] Fix CMakeLists.txt.mustache and CMakeLists.txt for Qt5
(fix OpenAPITools#17712)

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

No branches or pull requests

2 participants