Skip to content

[Cpp][Qt][Client] Fix CMakeLists.txt, Qt::Gui, Find_Package(OpenSSL)#11967

Merged
wing328 merged 2 commits intoOpenAPITools:masterfrom
Thaulino:Cpp]-Qt]-Fix-CmakeList.txt-qt-Gui-FindPackage(OpenSSL)
May 15, 2022
Merged

[Cpp][Qt][Client] Fix CMakeLists.txt, Qt::Gui, Find_Package(OpenSSL)#11967
wing328 merged 2 commits intoOpenAPITools:masterfrom
Thaulino:Cpp]-Qt]-Fix-CmakeList.txt-qt-Gui-FindPackage(OpenSSL)

Conversation

@Thaulino
Copy link
Copy Markdown
Contributor

Note replacement of : #11950

Description

Changed: Always add Qt5::Gui to build, needed because {{prefix}}Oauth.h is always part of the build
Added: find_package for OpenSSL, should be done prior target_link_libraries

Tests that have been done :

(ubuntu)
install deps (reference #11371 ):
sudo apt install -y --no-install-recommends qt5-default
run code generator:
java -jar openapi-generator-cli-5.4.0.jar generate -t cpp-qt-templates -i petstore.json -g cpp-qt-client -o petstore
run cmake:
cmake -S petstore -B petstore/build

(windows)
run code generator:
java -jar openapi-generator-cli-5.4.0.jar generate -t cpp-qt-templates -i petstore.json -g cpp-qt-client -o petstore
run cmake:
cmake -S petstore -B petstore/build

Issue

fixes #11371

technical commitee

@wing328
cc @ravinikam (2017/07) @stkrwork (2017/07) @etherealjoy (2018/02) @MartinDelille (2018/03) @muttleyxd (2019/08)

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master (5.3.0), 6.0.x
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

Changed: Always add Qt5::Gui to build
Added: find_package for OpenSSL (if not Apple)
@MartinDelille
Copy link
Copy Markdown
Contributor

I'd like to add the same kind check for qmake but I wondered how to disable oauth?

When generating the example (which you should do to make this PR happy), the Qt5::Gui is indeed present.

Copy link
Copy Markdown
Contributor

@MartinDelille MartinDelille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generate the sample code.

Copy link
Copy Markdown
Contributor

@muttleyxd muttleyxd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks okay for me

@Thaulino
Copy link
Copy Markdown
Contributor Author

Thaulino commented Apr 8, 2022

@wing328, @muttleyxd , @MartinDelille Is there anything left to do for me ?

@wing328
Copy link
Copy Markdown
Member

wing328 commented May 15, 2022

Tested locally and the result is good:

PASS   : UserApiTests::deleteUserTest()
QDEBUG : UserApiTests::getUserByNameTest() Error happened while issuing request :  "Error transferring http://petstore.swagger.io/v2/user/johndoe - server replied: Not Found, {\"code\":1,\"type\":\"error\",\"message\":\"User not found\"}"
PASS   : UserApiTests::getUserByNameTest()
QDEBUG : UserApiTests::loginUserTest() "{\"code\":200,\"type\":\"unknown\",\"message\":\"logged in user session:1652607683824\"}"
PASS   : UserApiTests::loginUserTest()
PASS   : UserApiTests::logoutUserTest()
QDEBUG : UserApiTests::updateUserTest() got a request body
PASS   : UserApiTests::updateUserTest()
PASS   : UserApiTests::cleanupTestCase()
Totals: 10 passed, 0 failed, 0 skipped, 0 blacklisted, 111ms
********* Finished testing of UserApiTests *********
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:46 min
[INFO] Finished at: 2022-05-15T17:41:23+08:00
[INFO] ------------------------------------------------------------------------

@wing328 wing328 merged commit d23e95a into OpenAPITools:master May 15, 2022
@wing328 wing328 added this to the 6.0.0 milestone May 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] CMakeLists.txt gernerated by cpp-qt-client is missing Qt5:.Gui dependency / linking

4 participants