-
Notifications
You must be signed in to change notification settings - Fork 14
/
CMakeLists.txt
53 lines (40 loc) · 1.67 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
cmake_minimum_required(VERSION 3.6.0)
project(qml-asteroid
VERSION 2.0.0
DESCRIPTION "QML components, styles and demos for AsteroidOS")
find_package(ECM REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
option(WITH_ASTEROIDAPP "Build the AsteroidApp class" ON)
option(WITH_CMAKE_MODULES "Install AsteroidOS CMake modules" ON)
include(FeatureSummary)
include(GNUInstallDirs)
include(ECMFindQmlModule)
include(ECMGeneratePkgConfigFile)
include(AsteroidCMakeSettings)
set(ASTEROID_MODULES_INSTALL_DIR ${CMAKE_INSTALL_DATADIR}/asteroidapp/cmake)
find_package(Qt5 ${QT_MIN_VERSION} COMPONENTS DBus Qml Quick Svg REQUIRED)
if (WITH_ASTEROIDAPP)
find_package(Mlite5 MODULE REQUIRED)
find_package(Mapplauncherd_qt5 MODULE REQUIRED)
endif()
ecm_find_qmlmodule(QtQuick.VirtualKeyboard 2.1)
if (WITH_CMAKE_MODULES)
# Install CMake modules
file(GLOB installAsteroidModuleFiles LIST_DIRECTORIES FALSE ${CMAKE_SOURCE_DIR}/cmake/*[^~])
install(FILES ${installAsteroidModuleFiles} DESTINATION ${ASTEROID_MODULES_INSTALL_DIR})
else()
get_target_property(REAL_QMAKE_EXECUTABLE Qt::qmake IMPORTED_LOCATION)
if (NOT QT_INSTALL_QML)
execute_process(COMMAND "${REAL_QMAKE_EXECUTABLE}" -query QT_INSTALL_QML
OUTPUT_VARIABLE QT_INSTALL_QML
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
set(INSTALL_QML_IMPORT_DIR ${QT_INSTALL_QML})
endif()
add_subdirectory(src)
if (WITH_ASTEROIDAPP)
install(PROGRAMS generate-desktop.sh
DESTINATION ${CMAKE_INSTALL_BINDIR}
RENAME asteroid-generate-desktop)
endif()
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)