2021-11-01 09:54:58 -04:00
|
|
|
cmake_minimum_required(VERSION 3.0)
|
2022-02-23 19:00:17 -05:00
|
|
|
project(Astra)
|
2021-11-01 09:54:58 -04:00
|
|
|
|
2022-09-05 17:42:13 -04:00
|
|
|
# build options used for distributors
|
|
|
|
option(BUILD_FLATPAK "Build for Flatpak." OFF)
|
|
|
|
|
|
|
|
# options for features you may want or need
|
|
|
|
option(ENABLE_WATCHDOG "Build support for Watchdog, requires an X11 system." OFF)
|
|
|
|
option(ENABLE_STEAM "Build with Steam support, requires supplying the Steam SDK." OFF)
|
|
|
|
option(ENABLE_GAMEMODE "Build with Feral GameMode support, requires the daemon to be installed." ON)
|
|
|
|
option(ENABLE_TABLET "Build support for the tablet interface, meant for devices like the Steam Deck." ON)
|
|
|
|
option(ENABLE_DESKTOP "Build support for the desktop interface, meant to be used on desktops and laptops." ON)
|
|
|
|
option(ENABLE_CLI "Build support for the command-line interface, meant for scripting and automation." ON)
|
|
|
|
|
2021-11-01 09:54:58 -04:00
|
|
|
set(CMAKE_AUTOMOC ON)
|
2022-06-08 12:06:44 -04:00
|
|
|
set(CMAKE_AUTORCC ON)
|
2021-11-01 09:54:58 -04:00
|
|
|
|
2022-06-08 12:06:44 -04:00
|
|
|
find_package(Qt5 COMPONENTS Core Widgets Network Quick CONFIG REQUIRED)
|
2021-11-01 09:54:58 -04:00
|
|
|
|
2022-08-15 11:14:37 -04:00
|
|
|
if (ENABLE_WATCHDOG)
|
2022-01-27 09:25:23 -05:00
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
pkg_search_module(TESSERACT REQUIRED tesseract)
|
|
|
|
pkg_search_module(LEPTONICA REQUIRED lept)
|
2022-08-15 11:14:37 -04:00
|
|
|
endif ()
|
2022-01-27 09:25:23 -05:00
|
|
|
|
2022-09-05 17:42:13 -04:00
|
|
|
if (ENABLE_GAMEMODE)
|
2022-09-05 17:10:37 -04:00
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
pkg_search_module(GAMEMODE REQUIRED gamemode)
|
2022-09-05 17:42:13 -04:00
|
|
|
endif ()
|
2022-03-01 17:21:29 -05:00
|
|
|
|
2022-09-05 17:42:13 -04:00
|
|
|
if (ENABLE_STEAM)
|
2022-09-07 23:54:17 -04:00
|
|
|
add_library(Steamworks IMPORTED SHARED)
|
2022-09-05 15:43:15 -04:00
|
|
|
set_target_properties(Steamworks PROPERTIES
|
|
|
|
INTERFACE_INCLUDE_DIRECTORIES ${STEAMWORKS_INCLUDE_DIR}
|
|
|
|
IMPORTED_LOCATION ${STEAMWORKS_LIBRARIES})
|
2022-09-05 17:42:13 -04:00
|
|
|
endif ()
|
2022-03-27 21:08:27 -04:00
|
|
|
|
2022-09-05 17:42:13 -04:00
|
|
|
find_package(Qt5Keychain REQUIRED)
|
|
|
|
find_package(QuaZip-Qt5 REQUIRED)
|
2022-03-27 21:08:27 -04:00
|
|
|
|
2022-03-01 16:58:47 -05:00
|
|
|
add_subdirectory(external)
|
2022-06-08 12:45:12 -04:00
|
|
|
add_subdirectory(launcher)
|