CMakeLists.txt 2.54 KB
Newer Older
1
cmake_minimum_required(VERSION 3.10)
Camilo Higuita's avatar
Camilo Higuita committed
2

3
set(REQUIRED_QT_VERSION 5.10.0)
4
set(REQUIRED_KF5_VERSION 5.60.0)
Camilo Higuita's avatar
Camilo Higuita committed
5

6
set(CMAKE_CXX_STANDARD 17)
Camilo Higuita's avatar
Camilo Higuita committed
7

8
set(MAUIKIT_VERSION 1.0.0)
Camilo Higuita's avatar
Camilo Higuita committed
9 10 11 12 13 14 15

set(AUTOMOC_MOC_OPTIONS -Muri=org.kde.maui)

project(mauikit VERSION ${MAUIKIT_VERSION})

find_package(ECM 5.45.0 NO_MODULE)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} 
16
    ${ECM_KDE_MODULE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
17

18
#DEFAULT COMPONENTS DEFINITIONS
19 20 21 22 23 24 25
option(COMPONENT_EDITOR "Build editor component" ON)
option(COMPONENT_FM "Build filemanager component" ON)
option(COMPONENT_ACCOUNTS "Build accounts component" ON)
option(COMPONENT_TERMINAL "Build terminal component" ON)
option(COMPONENT_STORE "Build store component" ON)
option(COMPONENT_TAGGING "Build tagging component" ON)
option(COMPONENT_SYNCING "Build syncing component" ON)
26 27
option(MAUIKIT_STYLE "Use Mauikit style and Luv icons" OFF)

28
include(GenerateExportHeader)
Camilo Higuita's avatar
Camilo Higuita committed
29 30 31 32 33 34 35 36 37 38 39 40
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(CMakePackageConfigHelpers)
include(ECMPoQmTools)
include(ECMQMLModules)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(ECMQtDeclareLoggingCategory)
include(ECMAddQch)
include(KDECompilerSettings NO_POLICY_SCOPE)

find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS Qml 
41
    Sql Core Quick Gui Svg QuickControls2 Network DBus Xml)
Camilo Higuita's avatar
Camilo Higuita committed
42 43
ecm_find_qmlmodule(QtGraphicalEffects 1.0)

44 45 46 47 48 49 50 51 52
if(ANDROID)
    find_package(Qt5 REQUIRED COMPONENTS AndroidExtras WebView)
    find_package(Gradle REQUIRED)
else()
    find_package(Qt5 REQUIRED COMPONENTS WebEngine)
endif()

find_package(KF5 ${REQUIRED_KF5_VERSION} REQUIRED COMPONENTS I18n Notifications Config Service KIO ConfigWidgets)

Nicolas Fella's avatar
Nicolas Fella committed
53
add_subdirectory(src)
Camilo higuita's avatar
Camilo higuita committed
54

55
##CMAKE PARTS
Camilo Higuita's avatar
Camilo Higuita committed
56 57 58 59 60 61 62
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/MauiKit")

ecm_setup_version(${MAUIKIT_VERSION}
    VARIABLE_PREFIX MAUIKIT
    VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/mauikit_version.h"
    PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/MauiKitConfigVersion.cmake"
    SOVERSION 5
Camilo higuita's avatar
Camilo higuita committed
63
    )
Camilo Higuita's avatar
Camilo Higuita committed
64 65 66 67 68 69

configure_package_config_file(
    "${CMAKE_CURRENT_SOURCE_DIR}/MauiKitConfig.cmake.in"
    "${CMAKE_CURRENT_BINARY_DIR}/MauiKitConfig.cmake"
    INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
    PATH_VARS  KF5_INCLUDE_INSTALL_DIR CMAKE_INSTALL_PREFIX
Camilo higuita's avatar
Camilo higuita committed
70
    )
Camilo Higuita's avatar
Camilo Higuita committed
71 72 73 74 75 76

install(FILES
    "${CMAKE_CURRENT_BINARY_DIR}/MauiKitConfig.cmake"
    "${CMAKE_CURRENT_BINARY_DIR}/MauiKitConfigVersion.cmake"
    DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
    COMPONENT Devel
Camilo higuita's avatar
Camilo higuita committed
77
    )
Camilo Higuita's avatar
Camilo Higuita committed
78 79 80 81

install(EXPORT MauiKitTargets
    DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
    FILE MauiKitTargets.cmake
Camilo higuita's avatar
Camilo higuita committed
82
    )