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

183 lines
5 KiB
Text
Raw Normal View History

# SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
# SPDX-License-Identifier: CC0-1.0
add_library(astra_static STATIC)
ecm_qt_declare_logging_category(astra_static
HEADER astra_log.h
IDENTIFIER ASTRA_LOG
CATEGORY_NAME zone.xiv.astra
DESCRIPTION "Astra logs"
EXPORT ASTRA
)
ecm_qt_declare_logging_category(astra_static
HEADER astra_http_log.h
IDENTIFIER ASTRA_HTTP
CATEGORY_NAME zone.xiv.astra.http
DESCRIPTION "Astra HTTP requests"
EXPORT ASTRA
)
ecm_qt_declare_logging_category(astra_static
HEADER astra_patcher_log.h
IDENTIFIER ASTRA_PATCHER
CATEGORY_NAME zone.xiv.astra.patcher
DESCRIPTION "Astra patcher"
EXPORT ASTRA
)
target_sources(astra_static PRIVATE
include/patchlist.h
src/patchlist.cpp)
target_include_directories(astra_static PUBLIC include)
target_link_libraries(astra_static PUBLIC
Qt6::Core)
add_executable(astra)
2023-09-16 17:41:51 -04:00
qt_add_qml_module(astra
URI zone.xiv.astra
VERSION 1.0)
target_sources(astra PRIVATE
include/account.h
include/accountmanager.h
include/assetupdater.h
include/compatibilitytoolinstaller.h
include/encryptedarg.h
include/gamerunner.h
include/gameinstaller.h
include/headline.h
include/launchercore.h
include/launchersettings.h
include/logger.h
include/patcher.h
include/processlogger.h
include/profile.h
include/profilemanager.h
include/sapphirelogin.h
include/squareenixlogin.h
include/steamapi.h
include/utility.h
2022-06-08 12:45:12 -04:00
src/account.cpp
src/accountmanager.cpp
src/assetupdater.cpp
src/compatibilitytoolinstaller.cpp
src/encryptedarg.cpp
src/gamerunner.cpp
src/gameinstaller.cpp
src/launchercore.cpp
src/launchersettings.cpp
src/logger.cpp
src/main.cpp
src/patcher.cpp
src/processlogger.cpp
src/profile.cpp
src/profilemanager.cpp
src/sapphirelogin.cpp
src/squareenixlogin.cpp
src/steamapi.cpp
2023-09-17 09:31:25 -04:00
src/utility.cpp
)
2023-09-16 17:41:51 -04:00
qt_target_qml_sources(astra
QML_FILES
ui/Components/FormFileDelegate.qml
ui/Components/FormFolderDelegate.qml
2023-09-17 19:20:41 -04:00
ui/Pages/AutoLoginPage.qml
2023-09-16 17:41:51 -04:00
ui/Pages/BrowserPage.qml
ui/Pages/LoginPage.qml
ui/Pages/MainPage.qml
ui/Pages/NewsPage.qml
ui/Pages/StatusPage.qml
ui/Settings/AboutPage.qml
ui/Settings/AccountSettings.qml
ui/Settings/AccountsPage.qml
ui/Settings/CompatibilityToolSetup.qml
ui/Settings/DeveloperSettings.qml
ui/Settings/GeneralSettings.qml
ui/Settings/ProfileSettings.qml
ui/Settings/ProfilesPage.qml
ui/Settings/SettingsPage.qml
ui/Setup/AccountSetup.qml
ui/Setup/AddSapphire.qml
ui/Setup/AddSquareEnix.qml
ui/Setup/DownloadSetup.qml
ui/Setup/ExistingSetup.qml
ui/Setup/InstallProgress.qml
ui/Setup/SetupPage.qml
ui/Main.qml
)
2023-09-17 09:31:25 -04:00
set_source_files_properties(../zone.xiv.astra.svg PROPERTIES
QT_RESOURCE_ALIAS /zone.xiv.astra.svg
)
qt_target_qml_sources(astra
PREFIX /
RESOURCES
../zone.xiv.astra.svg
)
kconfig_add_kcfg_files(astra GENERATE_MOC config.kcfgc accountconfig.kcfgc profileconfig.kcfgc)
target_include_directories(astra PRIVATE include ${CMAKE_BINARY_DIR})
target_link_libraries(astra PRIVATE
astra_static
physis
2023-10-10 16:47:26 -04:00
physis-logger
cotp
QuaZip::QuaZip
2023-09-16 17:32:38 -04:00
Qt6Keychain::Qt6Keychain
Qt6::Core
Qt6::Network
Qt6::Widgets
Qt6::Quick
Qt6::QuickControls2
Qt6::WebView
2023-09-16 20:12:42 -04:00
Qt6::Concurrent
2023-09-16 17:32:38 -04:00
KF6::Kirigami2
KF6::I18n
KF6::ConfigCore
KF6::ConfigGui
2023-09-16 18:37:42 -04:00
KF6::CoreAddons
QCoro::Core
QCoro::Network
QCoro::Qml)
2023-10-11 15:42:24 -04:00
target_compile_options(astra PRIVATE -fexceptions)
2022-06-08 12:45:12 -04:00
2022-08-15 11:14:37 -04:00
if (BUILD_FLATPAK)
2022-06-08 12:45:12 -04:00
target_compile_definitions(astra PRIVATE FLATPAK)
2022-08-15 11:14:37 -04:00
endif ()
2022-06-08 12:45:12 -04:00
if (ENABLE_STEAM)
target_link_libraries(astra PRIVATE Steamworks)
target_compile_definitions(astra PRIVATE ENABLE_STEAM)
endif ()
if (ENABLE_GAMEMODE)
target_link_libraries(astra PRIVATE ${GAMEMODE_LIBRARIES})
target_compile_definitions(astra PRIVATE ENABLE_GAMEMODE)
endif ()
install(TARGETS astra ${KF${QT_MAJOR_VERSION}_INSTALL_TARGETS_DEFAULT_ARGS})
2022-06-08 12:45:12 -04:00
2022-08-15 11:14:37 -04:00
if (WIN32)
2023-09-17 09:31:25 -04:00
get_target_property(QMAKE_EXE Qt6::qmake IMPORTED_LOCATION)
2022-06-08 12:45:12 -04:00
get_filename_component(QT_BIN_DIR "${QMAKE_EXE}" DIRECTORY)
find_program(WINDEPLOYQT_ENV_SETUP qtenv2.bat HINTS "${QT_BIN_DIR}")
find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${QT_BIN_DIR}")
# Run windeployqt immediately after build
add_custom_command(TARGET astra
POST_BUILD
COMMAND "${WINDEPLOYQT_ENV_SETUP}" && "${WINDEPLOYQT_EXECUTABLE}" \"$<TARGET_FILE:astra>\"
)
2022-08-15 11:14:37 -04:00
endif ()
if (BUILD_TESTING)
add_subdirectory(autotests)
endif()