Warning, /system/mycroft-gui/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 # Set minimum CMake version (required for CMake 3.0 or later)
0002 cmake_minimum_required(VERSION 3.16.0)
0003
0004 option(BUILD_REMOTE_TTS "Build remote TTS support" OFF)
0005 option(BUILD_PLASMA_MOBILE "Build remote TTS support" OFF)
0006
0007 set(QT_MIN_VERSION "6.4.0")
0008 set(KF_MIN_VERSION "5.240.0")
0009
0010 IF(POLICY CMP0048)
0011 CMAKE_POLICY(SET CMP0048 NEW)
0012 ENDIF(POLICY CMP0048)
0013
0014 PROJECT(mycroft-gui)
0015 PROJECT(mycroft-gui VERSION "1.0.1")
0016
0017 # Use Extra CMake Modules (ECM) for common functionality.
0018 # See http://api.kde.org/ecm/manual/ecm.7.html
0019 # and http://api.kde.org/ecm/manual/ecm-kde-modules.7.html
0020 IF(POLICY CMP0063)
0021 CMAKE_POLICY(SET CMP0063 NEW)
0022 ENDIF(POLICY CMP0063)
0023
0024 find_package(ECM 1.6.0 REQUIRED NO_MODULE)
0025 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
0026
0027 include(KDEInstallDirs)
0028 include(KDECMakeSettings)
0029 include(ECMInstallIcons)
0030 set(CMAKE_AUTOMOC ON)
0031
0032 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -Wall -Werror")
0033
0034 #this is used for mycroft spawning. It's horrible and should not be needed, but mycroft packaging is questionable at best
0035 #in any sane world mycroft would install something in $PATH
0036 #the Android case is a temporary hack, adjust it to where and android app can find
0037 if(CMAKE_SYSTEM_NAME STREQUAL "Android")
0038 set(MYCROFT_CORE_DIR ":")
0039 else(MYCROFT_CORE_DIR "$HOME/mycroft-core")
0040 set(MYCROFT_CORE_DIR "$HOME/mycroft-core")
0041 endif()
0042
0043 #configure_file(config-mycroft.h.in ${CMAKE_CURRENT_BINARY_DIR}/config-mycroft.h)
0044 include_directories(${CMAKE_CURRENT_BINARY_DIR})
0045
0046 find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
0047 Quick
0048 Core
0049 Qml
0050 Network
0051 WebSockets
0052 WebView
0053 Multimedia
0054 )
0055
0056 if (QT_MAJOR_VERSION STREQUAL "6")
0057 find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS WebEngineQuick)
0058 else ()
0059 find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS WebEngine)
0060 endif()
0061
0062 if(CMAKE_SYSTEM_NAME STREQUAL "Android")
0063 find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS
0064 AndroidExtras
0065 QuickControls2
0066 TextToSpeech
0067 Svg
0068 )
0069 find_package(OpenSSL REQUIRED)
0070 endif()
0071
0072 find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS I18n)
0073
0074 if(NOT CMAKE_SYSTEM_NAME STREQUAL "Android")
0075 find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS Widgets)
0076 find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS Kirigami2 DBusAddons)
0077 # find_package(KF5Plasma ${KF5_MIN_VERSION} REQUIRED)
0078 # find_package(KF5KIO ${KF5_MIN_VERSION} REQUIRED)
0079 endif()
0080
0081 add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060F00)
0082
0083 add_definitions(-DQT_NO_URL_CAST_FROM_STRING -DQT_USE_QSTRINGBUILDER -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII)
0084
0085 add_subdirectory(application)
0086 add_subdirectory(icons)
0087 add_subdirectory(import)
0088
0089 configure_file(data/mycroft-gui-core-loader.in ${CMAKE_CURRENT_BINARY_DIR}/mycroft-gui-core-loader)
0090 install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/mycroft-gui-core-loader DESTINATION ${KDE_INSTALL_BINDIR})
0091
0092 configure_file(data/mycroft-gui-core-stop.in ${CMAKE_CURRENT_BINARY_DIR}/mycroft-gui-core-stop)
0093 install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/mycroft-gui-core-stop DESTINATION ${KDE_INSTALL_BINDIR})
0094
0095 configure_file(data/mycroft-gui-ptt-loader.in ${CMAKE_CURRENT_BINARY_DIR}/mycroft-gui-ptt-loader)
0096 install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/mycroft-gui-ptt-loader DESTINATION ${KDE_INSTALL_BINDIR})
0097
0098 if (BUILD_TESTING AND NOT CMAKE_SYSTEM_NAME STREQUAL "Android")
0099 #add_subdirectory(autotests)
0100 endif()