1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-20 03:37:47 +00:00

Fix the last of the system libraries issue

This commit is contained in:
Joshua Goins 2022-03-01 17:21:29 -05:00
parent 0a34dd676e
commit 2c8e0f1552
5 changed files with 50 additions and 6 deletions

View file

@ -8,6 +8,7 @@ set(CMAKE_CXX_STANDARD 17)
find_package(Qt5 COMPONENTS Core Widgets Network CONFIG REQUIRED)
option(ENABLE_WATCHDOG "Build with Tesseract support (needed for Watchdog)" OFF)
option(USE_OWN_LIBRARIES "Build with own libraries" OFF)
if(ENABLE_WATCHDOG)
find_package(PkgConfig REQUIRED)
@ -33,24 +34,63 @@ set(SRC
src/gamescopesettingswindow.cpp
include/gamescopesettingswindow.h)
include(FetchContent)
if(NOT USE_OWN_LIBRARIES)
find_package(Qt5Keychain)
endif()
if(TARGET Qt5Keychain::Qt5Keychain)
message("Using system library for Qt5 Keychain")
set(LIBRARIES Qt5Keychain::Qt5Keychain ${LIBRARIES})
set(KEYCHAIN_INCLUDE_DIRS ${QTKEYCHAIN_INCLUDE_DIRS}/qt5keychain) # this is to be consistent with the built-in lib?
else()
message("Using built-in qt keychain")
FetchContent_Declare(
qtkeychain
GIT_REPOSITORY https://github.com/frankosterfeld/qtkeychain.git
GIT_TAG v0.12.0
)
set(BUILD_WITH_QT6 OFF CACHE BOOL "" FORCE)
set(QTKEYCHAIN_STATIC ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(qtkeychain)
set(LIBRARIES qt5keychain ${LIBRARIES})
set(KEYCHAIN_INCLUDE_DIRS
${CMAKE_BINARY_DIR}/_deps/qtkeychain-src
${CMAKE_BINARY_DIR}/_deps/qtkeychain-build)
endif()
if(NOT USE_OWN_LIBRARIES)
find_package(QuaZip-Qt5)
endif()
if(TARGET QuaZip::QuaZip)
message("Using system library for Quazip")
set(LIBRARIES QuaZip::QuaZip ${LIBRARIES})
else()
message("Using built-in quazip")
FetchContent_Declare(
quazip
GIT_REPOSITORY https://github.com/stachenov/quazip.git
GIT_TAG v1.2
)
FetchContent_MakeAvailable(quazip)
set(LIBRARIES QuaZip ${LIBRARIES})
set(QUAZIP_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/_deps/quazip-src/quazip)
endif()
add_subdirectory(external)
set(LIBRARIES
Qt5::Core Qt5::Widgets Qt5::Network Qt5Keychain::Qt5Keychain ${LIBRARIES})
Qt5::Core Qt5::Widgets Qt5::Network ${LIBRARIES})
if(ENABLE_WATCHDOG)
set(LIBRARIES ${LIBRARIES} ${TESSERACT_LIBRARIES} ${LEPTONICA_LIBRARIES})

View file

@ -1,6 +1,8 @@
include(FetchContent)
if(NOT TARGET Qt5Keychain::Qt5Keychain)
message("Using built-in qt keychain")
FetchContent_Declare(
qtkeychain
GIT_REPOSITORY https://github.com/frankosterfeld/qtkeychain.git
@ -20,6 +22,8 @@ endif()
if(NOT TARGET QuaZip::QuaZip)
message("Using built-in quazip")
FetchContent_Declare(
quazip
GIT_REPOSITORY https://github.com/stachenov/quazip.git

View file

@ -11,7 +11,7 @@
#include <QJsonObject>
#include <QJsonDocument>
#include <QCheckBox>
#include <qt5keychain/keychain.h>
#include <keychain.h>
#include <QMessageBox>
#include <QMenuBar>
#include <QCoreApplication>

View file

@ -1,7 +1,7 @@
#include "launcherwindow.h"
#include <QMenuBar>
#include <qt5keychain/keychain.h>
#include <keychain.h>
#include <QFormLayout>
#include <QApplication>
#include <QDesktopServices>

View file

@ -3,7 +3,7 @@
#include <QApplication>
#include <QCommandLineParser>
#include <qt5keychain/keychain.h>
#include <keychain.h>
#include "sapphirelauncher.h"
#include "squareboot.h"