-
Notifications
You must be signed in to change notification settings - Fork 57
/
CMakeLists.txt
100 lines (78 loc) · 3.44 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Set minimum CMake version (required for CMake 3.0 or later)
cmake_minimum_required(VERSION 3.16.0)
option(BUILD_REMOTE_TTS "Build remote TTS support" OFF)
option(BUILD_PLASMA_MOBILE "Build remote TTS support" OFF)
set(QT_MIN_VERSION "6.4.0")
set(KF_MIN_VERSION "5.240.0")
IF(POLICY CMP0048)
CMAKE_POLICY(SET CMP0048 NEW)
ENDIF(POLICY CMP0048)
PROJECT(mycroft-gui)
PROJECT(mycroft-gui VERSION "1.0.1")
# Use Extra CMake Modules (ECM) for common functionality.
# See http://api.kde.org/ecm/manual/ecm.7.html
# and http://api.kde.org/ecm/manual/ecm-kde-modules.7.html
IF(POLICY CMP0063)
CMAKE_POLICY(SET CMP0063 NEW)
ENDIF(POLICY CMP0063)
find_package(ECM 1.6.0 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
include(KDEInstallDirs)
include(KDECMakeSettings)
include(ECMInstallIcons)
set(CMAKE_AUTOMOC ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -Wall -Werror")
#this is used for mycroft spawning. It's horrible and should not be needed, but mycroft packaging is questionable at best
#in any sane world mycroft would install something in $PATH
#the Android case is a temporary hack, adjust it to where and android app can find
if(CMAKE_SYSTEM_NAME STREQUAL "Android")
set(MYCROFT_CORE_DIR ":")
else(MYCROFT_CORE_DIR "$HOME/mycroft-core")
set(MYCROFT_CORE_DIR "$HOME/mycroft-core")
endif()
#configure_file(config-mycroft.h.in ${CMAKE_CURRENT_BINARY_DIR}/config-mycroft.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
Quick
Core
Qml
Network
WebSockets
WebView
Multimedia
)
if (QT_MAJOR_VERSION STREQUAL "6")
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS WebEngineQuick)
else ()
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS WebEngine)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Android")
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS
AndroidExtras
QuickControls2
TextToSpeech
Svg
)
find_package(OpenSSL REQUIRED)
endif()
find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS I18n)
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Android")
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS Widgets)
find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS Kirigami2 DBusAddons)
# find_package(KF5Plasma ${KF5_MIN_VERSION} REQUIRED)
# find_package(KF5KIO ${KF5_MIN_VERSION} REQUIRED)
endif()
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060F00)
add_definitions(-DQT_NO_URL_CAST_FROM_STRING -DQT_USE_QSTRINGBUILDER -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII)
add_subdirectory(application)
add_subdirectory(icons)
add_subdirectory(import)
configure_file(data/mycroft-gui-core-loader.in ${CMAKE_CURRENT_BINARY_DIR}/mycroft-gui-core-loader)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/mycroft-gui-core-loader DESTINATION ${KDE_INSTALL_BINDIR})
configure_file(data/mycroft-gui-core-stop.in ${CMAKE_CURRENT_BINARY_DIR}/mycroft-gui-core-stop)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/mycroft-gui-core-stop DESTINATION ${KDE_INSTALL_BINDIR})
configure_file(data/mycroft-gui-ptt-loader.in ${CMAKE_CURRENT_BINARY_DIR}/mycroft-gui-ptt-loader)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/mycroft-gui-ptt-loader DESTINATION ${KDE_INSTALL_BINDIR})
if (BUILD_TESTING AND NOT CMAKE_SYSTEM_NAME STREQUAL "Android")
#add_subdirectory(autotests)
endif()