diff --git a/CMakeLists.txt b/CMakeLists.txt index 335e999..4d6df2a 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,15 +35,15 @@ set(SRC include/gamescopesettingswindow.h) set(LIBRARIES - Qt5::Core Qt5::Widgets Qt5::Network qt5keychain QuaZip) + Qt5::Core Qt5::Widgets Qt5::Network ${KEYCHAIN_LIBRARIES} ${QUAZIP_LIBRARIES}) if(ENABLE_WATCHDOG) set(LIBRARIES ${LIBRARIES} ${TESSERACT_LIBRARIES} ${LEPTONICA_LIBRARIES}) set(SRC ${SRC} - include/watchdog.h + include/watchdog.h src/watchdog.cpp - include/gameparser.h + include/gameparser.h src/gameparser.cpp) endif() @@ -63,9 +63,8 @@ target_include_directories(astra PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include PRIVATE - ${CMAKE_BINARY_DIR}/_deps/qtkeychain-src - ${CMAKE_BINARY_DIR}/_deps/qtkeychain-build - ${CMAKE_BINARY_DIR}/_deps/quazip-src) + ${KEYCHAIN_INCLUDE_DIRS} + ${QUAZIP_INCLUDE_DIRS}) if(ENABLE_WATCHDOG) target_include_directories(astra PRIVATE ${TESSERACT_INCLUDE_DIRS} ${LEPTONICA_INCLUDE_DIRS}) @@ -74,11 +73,10 @@ if(ENABLE_WATCHDOG) endif() install(TARGETS astra - DESTINATION "${INSTALL_BIN_PATH}" - ) + DESTINATION "${INSTALL_BIN_PATH}") 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) find_program(WINDEPLOYQT_ENV_SETUP qtenv2.bat HINTS "${QT_BIN_DIR}") diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 7fc77f3..ebcbe3e 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -1,19 +1,40 @@ include(FetchContent) -FetchContent_Declare( - qtkeychain - GIT_REPOSITORY https://github.com/frankosterfeld/qtkeychain.git - GIT_TAG v0.12.0 -) +find_package(QtKeychain-Qt5) -set(BUILD_WITH_QT6 OFF CACHE BOOL "" FORCE) -set(QTKEYCHAIN_STATIC ON CACHE BOOL "" FORCE) +if(NOT TARGET Qt5Keychain::Qt5Keychain) + 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( - quazip - GIT_REPOSITORY https://github.com/stachenov/quazip.git - GIT_TAG v1.2 -) -FetchContent_MakeAvailable(quazip) \ No newline at end of file + FetchContent_MakeAvailable(qtkeychain) + + set(KEYCHAIN_LIBRARIES qt5keychain 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 + 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() diff --git a/src/assetupdater.cpp b/src/assetupdater.cpp index 7277456..533b0d6 100644 --- a/src/assetupdater.cpp +++ b/src/assetupdater.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include #include "launchercore.h"