From db5c3423b92410115f4c3d5f8b6ca0cabb58f9f6 Mon Sep 17 00:00:00 2001
From: Thi <thilozirnstein@gmail.com>
Date: Wed, 23 Mar 2022 16:19:01 +0100
Subject: [PATCH 1/3] [cpp-qt-client] Fix CMakeLists.txt

Changed: Always add Qt5::Gui to build
Added: find_package for OpenSSL (if not Apple)
---
 .../main/resources/cpp-qt-client/CMakeLists.txt.mustache   | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/CMakeLists.txt.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/CMakeLists.txt.mustache
index 86b1d5affeb..71d4bfdc05c 100644
--- a/modules/openapi-generator/src/main/resources/cpp-qt-client/CMakeLists.txt.mustache
+++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/CMakeLists.txt.mustache
@@ -12,8 +12,8 @@ else ()
 endif ()
 
 find_package(Qt5Core REQUIRED)
-find_package(Qt5Network REQUIRED){{#authMethods}}{{#isOAuth}}
-find_package(Qt5Gui REQUIRED){{/isOAuth}}{{/authMethods}}{{#contentCompression}}
+find_package(Qt5Network REQUIRED)
+find_package(Qt5Gui REQUIRED){{#contentCompression}}
 find_package(ZLIB REQUIRED){{/contentCompression}}
 
 add_library(${PROJECT_NAME}
@@ -34,8 +34,9 @@ add_library(${PROJECT_NAME}
     {{prefix}}HttpFileElement.cpp
     {{prefix}}Oauth.cpp
 )
-target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Network{{#authMethods}}{{#isOAuth}} Qt5::Gui{{/isOAuth}}{{/authMethods}}{{#contentCompression}} ${ZLIB_LIBRARIES}{{/contentCompression}})
+target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Network Qt5::Gui{{#contentCompression}} ${ZLIB_LIBRARIES}{{/contentCompression}})
 if(NOT APPLE)
+  find_package(OpenSSL REQUIRED)
   target_link_libraries(${PROJECT_NAME} PRIVATE ssl crypto)
 endif()
 
-- 
GitLab


From c4f055f3cdf666b3ce265fa14e297c3b11d803d9 Mon Sep 17 00:00:00 2001
From: Thi <thilozirnstein@gmail.com>
Date: Wed, 23 Mar 2022 21:18:01 +0100
Subject: [PATCH 2/3] Revert "[cpp-qt-client] Fix CMakeLists.txt"

This reverts commit db5c3423b92410115f4c3d5f8b6ca0cabb58f9f6.
---
 .../main/resources/cpp-qt-client/CMakeLists.txt.mustache   | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/CMakeLists.txt.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/CMakeLists.txt.mustache
index 71d4bfdc05c..86b1d5affeb 100644
--- a/modules/openapi-generator/src/main/resources/cpp-qt-client/CMakeLists.txt.mustache
+++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/CMakeLists.txt.mustache
@@ -12,8 +12,8 @@ else ()
 endif ()
 
 find_package(Qt5Core REQUIRED)
-find_package(Qt5Network REQUIRED)
-find_package(Qt5Gui REQUIRED){{#contentCompression}}
+find_package(Qt5Network REQUIRED){{#authMethods}}{{#isOAuth}}
+find_package(Qt5Gui REQUIRED){{/isOAuth}}{{/authMethods}}{{#contentCompression}}
 find_package(ZLIB REQUIRED){{/contentCompression}}
 
 add_library(${PROJECT_NAME}
@@ -34,9 +34,8 @@ add_library(${PROJECT_NAME}
     {{prefix}}HttpFileElement.cpp
     {{prefix}}Oauth.cpp
 )
-target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Network Qt5::Gui{{#contentCompression}} ${ZLIB_LIBRARIES}{{/contentCompression}})
+target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Network{{#authMethods}}{{#isOAuth}} Qt5::Gui{{/isOAuth}}{{/authMethods}}{{#contentCompression}} ${ZLIB_LIBRARIES}{{/contentCompression}})
 if(NOT APPLE)
-  find_package(OpenSSL REQUIRED)
   target_link_libraries(${PROJECT_NAME} PRIVATE ssl crypto)
 endif()
 
-- 
GitLab


From 5a95be3f230195747dc97d5d6addc2fd3bd5621e Mon Sep 17 00:00:00 2001
From: Thi <thilozirnstein@gmail.com>
Date: Wed, 23 Mar 2022 23:29:14 +0100
Subject: [PATCH 3/3] Revert "Revert "[cpp-qt-client] Fix CMakeLists.txt""

This reverts commit c4f055f3cdf666b3ce265fa14e297c3b11d803d9.
---
 .../main/resources/cpp-qt-client/CMakeLists.txt.mustache   | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/CMakeLists.txt.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/CMakeLists.txt.mustache
index 86b1d5affeb..71d4bfdc05c 100644
--- a/modules/openapi-generator/src/main/resources/cpp-qt-client/CMakeLists.txt.mustache
+++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/CMakeLists.txt.mustache
@@ -12,8 +12,8 @@ else ()
 endif ()
 
 find_package(Qt5Core REQUIRED)
-find_package(Qt5Network REQUIRED){{#authMethods}}{{#isOAuth}}
-find_package(Qt5Gui REQUIRED){{/isOAuth}}{{/authMethods}}{{#contentCompression}}
+find_package(Qt5Network REQUIRED)
+find_package(Qt5Gui REQUIRED){{#contentCompression}}
 find_package(ZLIB REQUIRED){{/contentCompression}}
 
 add_library(${PROJECT_NAME}
@@ -34,8 +34,9 @@ add_library(${PROJECT_NAME}
     {{prefix}}HttpFileElement.cpp
     {{prefix}}Oauth.cpp
 )
-target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Network{{#authMethods}}{{#isOAuth}} Qt5::Gui{{/isOAuth}}{{/authMethods}}{{#contentCompression}} ${ZLIB_LIBRARIES}{{/contentCompression}})
+target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Network Qt5::Gui{{#contentCompression}} ${ZLIB_LIBRARIES}{{/contentCompression}})
 if(NOT APPLE)
+  find_package(OpenSSL REQUIRED)
   target_link_libraries(${PROJECT_NAME} PRIVATE ssl crypto)
 endif()
 
-- 
GitLab