CMakeLists.txt 1.96 KB
Newer Older
Camilo higuita's avatar
Camilo higuita committed
1 2 3 4 5
project(index)
cmake_minimum_required(VERSION 3.0)

find_package(ECM 1.7.0 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${ECM_MODULE_PATH})
6
option(IS_APPIMAGE_PACKAGE "If set to true then the icons and styled is packaged as well")
Camilo higuita's avatar
Camilo higuita committed
7 8 9 10 11 12 13 14 15

find_package(Qt5 REQUIRED NO_MODULE COMPONENTS Qml Quick Sql Svg QuickControls2 Widgets)
include(KDEInstallDirs)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(KDECMakeSettings)
include(ECMInstallIcons)
include(FeatureSummary)
include(ECMAddAppIcon)

16
find_package(MauiKit REQUIRED)
17

Camilo higuita's avatar
Camilo higuita committed
18
set(CMAKE_INCLUDE_CURRENT_DIR ON)
19
set(CMAKE_AUTOMOC ON)
Camilo higuita's avatar
Camilo higuita committed
20
set(CMAKE_AUTORCC ON)
21 22
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Camilo higuita's avatar
Camilo higuita committed
23 24

add_executable(index
camilo higuita's avatar
camilo higuita committed
25
    src/index_assets.qrc
Camilo higuita's avatar
Camilo higuita committed
26 27 28 29
    src/main.cpp
    src/index.cpp
    src/qml.qrc
    )
30

31 32 33
if(IS_APPIMAGE_PACKAGE)
    target_compile_definitions(index PUBLIC APPIMAGE_PACKAGE)
endif()
34
    find_package(KF5 ${KF5_VERSION} REQUIRED COMPONENTS I18n Notifications Config KIO Service Attica SyntaxHighlighting)
35

Camilo higuita's avatar
Camilo higuita committed
36
if (ANDROID)
37
    find_package(Qt5 REQUIRED COMPONENTS AndroidExtras WebView)
Camilo higuita's avatar
Camilo higuita committed
38

39
    target_link_libraries(index Qt5::AndroidExtras)
Camilo higuita's avatar
Camilo higuita committed
40
    kde_source_files_enable_exceptions(index src/index.cpp)
41
else()
42

Camilo higuita's avatar
Camilo higuita committed
43 44
    find_package(Qt5 REQUIRED COMPONENTS WebEngine)

45
    if(IS_APPIMAGE_PACKAGE)
46
        target_link_libraries(index KF5::KIOWidgets KF5::KIOFileWidgets KF5::ConfigCore KF5::Notifications KF5::KIOCore KF5::KIOWidgets KF5::I18n KF5::Service KF5::Attica KF5::SyntaxHighlighting)
47 48
    endif()

Camilo higuita's avatar
Camilo higuita committed
49 50
endif()

51
target_link_libraries(index MauiKit Qt5::Sql Qt5::Quick Qt5::Qml Qt5::Widgets Qt5::Svg)
Camilo higuita's avatar
Camilo higuita committed
52 53 54 55 56 57 58 59 60

install(TARGETS index ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES org.kde.index.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})

#TODO: port to ecm_install_icons()
install(FILES src/assets/index.svg DESTINATION ${KDE_INSTALL_ICONDIR}/hicolor/scalable/apps)
# install(FILES org.kde.index.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})

feature_summary(WHAT ALL   FATAL_ON_MISSING_REQUIRED_PACKAGES)