1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-24 05:17:46 +00:00

Attempt to use system libraries (properly this time)

This commit is contained in:
Joshua Goins 2022-03-01 16:58:47 -05:00
parent 2092a351d1
commit 0a34dd676e
5 changed files with 22 additions and 16 deletions

View file

@ -15,7 +15,6 @@ if(ENABLE_WATCHDOG)
pkg_search_module(LEPTONICA REQUIRED lept)
endif()
add_subdirectory(external)
set(SRC
src/main.cpp
@ -34,8 +33,24 @@ set(SRC
src/gamescopesettingswindow.cpp
include/gamescopesettingswindow.h)
find_package(Qt5Keychain)
if(TARGET Qt5Keychain::Qt5Keychain)
message("Using system library for Qt5 Keychain")
set(LIBRARIES Qt5Keychain::Qt5Keychain ${LIBRARIES})
endif()
find_package(QuaZip-Qt5)
if(TARGET QuaZip::QuaZip)
message("Using system library for Quazip")
set(LIBRARIES QuaZip::QuaZip ${LIBRARIES})
endif()
add_subdirectory(external)
set(LIBRARIES
Qt5::Core Qt5::Widgets Qt5::Network ${KEYCHAIN_LIBRARIES} ${QUAZIP_LIBRARIES})
Qt5::Core Qt5::Widgets Qt5::Network Qt5Keychain::Qt5Keychain ${LIBRARIES})
if(ENABLE_WATCHDOG)
set(LIBRARIES ${LIBRARIES} ${TESSERACT_LIBRARIES} ${LEPTONICA_LIBRARIES})
@ -58,7 +73,6 @@ add_executable(astra ${SRC})
target_link_libraries(astra PUBLIC ${LIBRARIES})
# disgusting, thanks qtkeychain and quazip
target_include_directories(astra
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include

View file

@ -1,7 +1,5 @@
include(FetchContent)
find_package(QtKeychain-Qt5)
if(NOT TARGET Qt5Keychain::Qt5Keychain)
FetchContent_Declare(
qtkeychain
@ -14,17 +12,13 @@ if(NOT TARGET Qt5Keychain::Qt5Keychain)
FetchContent_MakeAvailable(qtkeychain)
set(KEYCHAIN_LIBRARIES qt5keychain PARENT_SCOPE)
set(LIBRARIES qt5keychain ${LIBRARIES} PARENT_SCOPE)
set(KEYCHAIN_INCLUDE_DIRS
${CMAKE_BINARY_DIR}/_deps/qtkeychain-src
${CMAKE_BINARY_DIR}/_deps/qtkeychain-build PARENT_SCOPE)
else()
set(KEYCHAIN_LIBRARIES Qt5Keychain::Qt5Keychain PARENT_SCOPE)
endif()
#quazip
find_package(QuaZip-Qt5)
if(NOT TARGET QuaZip::QuaZip)
FetchContent_Declare(
quazip
@ -33,8 +27,6 @@ if(NOT TARGET QuaZip::QuaZip)
)
FetchContent_MakeAvailable(quazip)
set(QUAZIP_LIBRARIES QuaZip PARENT_SCOPE)
set(LIBRARIES QuaZip ${LIBRARIES} PARENT_SCOPE)
set(QUAZIP_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/_deps/quazip-src/quazip PARENT_SCOPE)
else()
set(QUAZIP_LIBRARIES QuaZip::QuaZip PARENT_SCOPE)
endif()

View file

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

View file

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

View file

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