mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-22 04:37:46 +00:00
Remove the dumb fetchcontent solution for libraries
This commit is contained in:
parent
474de3fedc
commit
3146fd80b4
5 changed files with 16 additions and 98 deletions
|
@ -25,10 +25,6 @@ endif()
|
||||||
|
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
|
|
||||||
if (NOT USE_OWN_LIBRARIES)
|
|
||||||
find_package(Qt5Keychain QUIET)
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
if(USE_STEAM)
|
if(USE_STEAM)
|
||||||
add_library(Steamworks IMPORTED STATIC)
|
add_library(Steamworks IMPORTED STATIC)
|
||||||
set_target_properties(Steamworks PROPERTIES
|
set_target_properties(Steamworks PROPERTIES
|
||||||
|
@ -36,98 +32,15 @@ if(USE_STEAM)
|
||||||
IMPORTED_LOCATION ${STEAMWORKS_LIBRARIES})
|
IMPORTED_LOCATION ${STEAMWORKS_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (TARGET Qt5Keychain::Qt5Keychain)
|
find_package(Qt5Keychain)
|
||||||
message("Using system library for Qt5 Keychain")
|
set(LIBRARIES Qt5Keychain::Qt5Keychain ${LIBRARIES})
|
||||||
|
|
||||||
set(LIBRARIES Qt5Keychain::Qt5Keychain ${LIBRARIES})
|
find_package(QuaZip-Qt5)
|
||||||
set(KEYCHAIN_INCLUDE_DIRS ${QTKEYCHAIN_INCLUDE_DIRS}/qt5keychain) # this is to be consistent with the built-in lib?
|
set(LIBRARIES QuaZip::QuaZip ${LIBRARIES})
|
||||||
else ()
|
|
||||||
message("Using downloaded qtkeychain")
|
|
||||||
|
|
||||||
FetchContent_Declare(
|
find_package(fmt)
|
||||||
qtkeychain
|
set(LIBRARIES fmt::fmt ${LIBRARIES})
|
||||||
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 QUIET)
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
if (TARGET QuaZip::QuaZip)
|
|
||||||
message("Using system library for Quazip")
|
|
||||||
|
|
||||||
set(LIBRARIES QuaZip::QuaZip ${LIBRARIES})
|
|
||||||
else ()
|
|
||||||
message("Using downloaded quazip")
|
|
||||||
|
|
||||||
FetchContent_Declare(
|
|
||||||
quazip
|
|
||||||
GIT_REPOSITORY https://github.com/stachenov/quazip.git
|
|
||||||
GIT_TAG v1.2
|
|
||||||
)
|
|
||||||
|
|
||||||
set(QUAZIP_USE_QT_ZLIB ON CACHE BOOL "" FORCE)
|
|
||||||
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
|
|
||||||
|
|
||||||
FetchContent_MakeAvailable(quazip)
|
|
||||||
|
|
||||||
set(LIBRARIES QuaZip ${LIBRARIES})
|
|
||||||
set(QUAZIP_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/_deps/quazip-src/quazip)
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
if (NOT USE_OWN_LIBRARIES)
|
|
||||||
find_package(fmt QUIET)
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
if (TARGET fmt::fmt)
|
|
||||||
message("Using system library for fmt")
|
|
||||||
|
|
||||||
set(LIBRARIES fmt::fmt ${LIBRARIES})
|
|
||||||
else ()
|
|
||||||
message("Using downloaded fmt")
|
|
||||||
|
|
||||||
FetchContent_Declare(
|
|
||||||
fmt
|
|
||||||
GIT_REPOSITORY https://github.com/fmtlib/fmt
|
|
||||||
GIT_TAG master
|
|
||||||
)
|
|
||||||
|
|
||||||
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
|
|
||||||
|
|
||||||
FetchContent_MakeAvailable(fmt)
|
|
||||||
|
|
||||||
set(LIBRARIES fmt::fmt ${LIBRARIES})
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
add_subdirectory(external)
|
add_subdirectory(external)
|
||||||
|
|
||||||
if (ENABLE_WATCHDOG)
|
|
||||||
set(LIBRARIES ${LIBRARIES} ${TESSERACT_LIBRARIES} ${LEPTONICA_LIBRARIES})
|
|
||||||
|
|
||||||
set(SRC ${SRC}
|
|
||||||
include/watchdog.h
|
|
||||||
src/watchdog.cpp
|
|
||||||
include/gameparser.h
|
|
||||||
src/gameparser.cpp)
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
if (ENABLE_WATCHDOG)
|
|
||||||
set(LIBRARIES ${LIBRARIES}
|
|
||||||
X11
|
|
||||||
Xcomposite
|
|
||||||
Xrender)
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
add_subdirectory(launcher)
|
add_subdirectory(launcher)
|
|
@ -1,6 +1,4 @@
|
||||||
#include "cmdinterface.h"
|
#include "cmdinterface.h"
|
||||||
#include "sapphirelauncher.h"
|
|
||||||
#include <keychain.h>
|
|
||||||
|
|
||||||
CMDInterface::CMDInterface(QCommandLineParser& parser) {
|
CMDInterface::CMDInterface(QCommandLineParser& parser) {
|
||||||
parser.addOption(autologinOption);
|
parser.addOption(autologinOption);
|
||||||
|
|
|
@ -30,7 +30,14 @@ if (ENABLE_WATCHDOG)
|
||||||
|
|
||||||
set(SRC ${SRC}
|
set(SRC ${SRC}
|
||||||
src/gameparser.cpp
|
src/gameparser.cpp
|
||||||
src/watchdog.cpp include/steamapi.h src/steamapi.cpp)
|
src/watchdog.cpp)
|
||||||
|
|
||||||
|
set(LIBRARIES ${LIBRARIES}
|
||||||
|
${TESSERACT_LIBRARIES}
|
||||||
|
${LEPTONICA_LIBRARIES}
|
||||||
|
X11
|
||||||
|
Xcomposite
|
||||||
|
Xrender)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if(USE_STEAM)
|
if(USE_STEAM)
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <keychain.h>
|
#include <qt5keychain/keychain.h>
|
||||||
#include <cotp.h>
|
#include <cotp.h>
|
||||||
|
|
||||||
#ifdef USE_GAMEMODE
|
#ifdef USE_GAMEMODE
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QToolTip>
|
#include <QToolTip>
|
||||||
#include <keychain.h>
|
#include <qt5keychain/keychain.h>
|
||||||
|
|
||||||
#include "gamescopesettingswindow.h"
|
#include "gamescopesettingswindow.h"
|
||||||
#include "launchercore.h"
|
#include "launchercore.h"
|
||||||
|
|
Loading…
Add table
Reference in a new issue