1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-21 20:27:45 +00:00

Use system libraries when possible

This commit is contained in:
Joshua Goins 2022-03-01 16:43:49 -05:00
parent 7ebf8a88c4
commit cfbefac6ac
3 changed files with 43 additions and 24 deletions

View file

@ -35,15 +35,15 @@ set(SRC
include/gamescopesettingswindow.h) include/gamescopesettingswindow.h)
set(LIBRARIES set(LIBRARIES
Qt5::Core Qt5::Widgets Qt5::Network qt5keychain QuaZip) Qt5::Core Qt5::Widgets Qt5::Network ${KEYCHAIN_LIBRARIES} ${QUAZIP_LIBRARIES})
if(ENABLE_WATCHDOG) if(ENABLE_WATCHDOG)
set(LIBRARIES ${LIBRARIES} ${TESSERACT_LIBRARIES} ${LEPTONICA_LIBRARIES}) set(LIBRARIES ${LIBRARIES} ${TESSERACT_LIBRARIES} ${LEPTONICA_LIBRARIES})
set(SRC ${SRC} set(SRC ${SRC}
include/watchdog.h include/watchdog.h
src/watchdog.cpp src/watchdog.cpp
include/gameparser.h include/gameparser.h
src/gameparser.cpp) src/gameparser.cpp)
endif() endif()
@ -63,9 +63,8 @@ target_include_directories(astra
PUBLIC PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/include
PRIVATE PRIVATE
${CMAKE_BINARY_DIR}/_deps/qtkeychain-src ${KEYCHAIN_INCLUDE_DIRS}
${CMAKE_BINARY_DIR}/_deps/qtkeychain-build ${QUAZIP_INCLUDE_DIRS})
${CMAKE_BINARY_DIR}/_deps/quazip-src)
if(ENABLE_WATCHDOG) if(ENABLE_WATCHDOG)
target_include_directories(astra PRIVATE ${TESSERACT_INCLUDE_DIRS} ${LEPTONICA_INCLUDE_DIRS}) target_include_directories(astra PRIVATE ${TESSERACT_INCLUDE_DIRS} ${LEPTONICA_INCLUDE_DIRS})
@ -74,11 +73,10 @@ if(ENABLE_WATCHDOG)
endif() endif()
install(TARGETS astra install(TARGETS astra
DESTINATION "${INSTALL_BIN_PATH}" DESTINATION "${INSTALL_BIN_PATH}")
)
if(WIN32) if(WIN32)
get_target_property(QMAKE_EXE Qt6::qmake IMPORTED_LOCATION) get_target_property(QMAKE_EXE Qt5::qmake IMPORTED_LOCATION)
get_filename_component(QT_BIN_DIR "${QMAKE_EXE}" DIRECTORY) get_filename_component(QT_BIN_DIR "${QMAKE_EXE}" DIRECTORY)
find_program(WINDEPLOYQT_ENV_SETUP qtenv2.bat HINTS "${QT_BIN_DIR}") find_program(WINDEPLOYQT_ENV_SETUP qtenv2.bat HINTS "${QT_BIN_DIR}")

View file

@ -1,19 +1,40 @@
include(FetchContent) include(FetchContent)
FetchContent_Declare( find_package(QtKeychain-Qt5)
qtkeychain
GIT_REPOSITORY https://github.com/frankosterfeld/qtkeychain.git
GIT_TAG v0.12.0
)
set(BUILD_WITH_QT6 OFF CACHE BOOL "" FORCE) if(NOT TARGET Qt5Keychain::Qt5Keychain)
set(QTKEYCHAIN_STATIC ON CACHE BOOL "" FORCE) FetchContent_Declare(
qtkeychain
GIT_REPOSITORY https://github.com/frankosterfeld/qtkeychain.git
GIT_TAG v0.12.0
)
FetchContent_MakeAvailable(qtkeychain) set(BUILD_WITH_QT6 OFF CACHE BOOL "" FORCE)
set(QTKEYCHAIN_STATIC ON CACHE BOOL "" FORCE)
FetchContent_Declare( FetchContent_MakeAvailable(qtkeychain)
quazip
GIT_REPOSITORY https://github.com/stachenov/quazip.git set(KEYCHAIN_LIBRARIES qt5keychain PARENT_SCOPE)
GIT_TAG v1.2 set(KEYCHAIN_INCLUDE_DIRS
) ${CMAKE_BINARY_DIR}/_deps/qtkeychain-src
FetchContent_MakeAvailable(quazip) ${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
GIT_REPOSITORY https://github.com/stachenov/quazip.git
GIT_TAG v1.2
)
FetchContent_MakeAvailable(quazip)
set(QUAZIP_LIBRARIES QuaZip 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

@ -7,7 +7,7 @@
#include <QStandardPaths> #include <QStandardPaths>
#include <QJsonArray> #include <QJsonArray>
#include <quazip/JlCompress.h> #include <JlCompress.h>
#include "launchercore.h" #include "launchercore.h"