CMakeLists.txt 1.77 KB
Newer Older
Camilo higuita's avatar
Camilo higuita committed
1 2 3 4 5 6
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})

7
#find_package(MauiKit REQUIRED)
Camilo higuita's avatar
Camilo higuita committed
8 9 10 11 12 13 14 15 16
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)

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

add_executable(index
    src/assets.qrc
    src/main.cpp
    src/index.cpp
    src/qml.qrc
27
#    src/kde/notify.cpp
Camilo higuita's avatar
Camilo higuita committed
28
    )
29

Camilo higuita's avatar
Camilo higuita committed
30 31 32
if (ANDROID)
    find_package(Qt5 REQUIRED COMPONENTS AndroidExtras)

33
    target_link_libraries(index Qt5::AndroidExtras)
Camilo higuita's avatar
Camilo higuita committed
34
    kde_source_files_enable_exceptions(index src/index.cpp)
35 36
else()
#    find_package(KF5 ${KF5_VERSION} REQUIRED COMPONENTS I18n Notifications Config KIO Service Attica)
Camilo higuita's avatar
Camilo higuita committed
37 38
    find_package(Qt5 REQUIRED COMPONENTS WebEngine)

39
#    target_link_libraries(index KF5::ConfigCore KF5::Notifications KF5::KIOCore KF5::I18n KF5::Service KF5::Attica)
Camilo higuita's avatar
Camilo higuita committed
40 41 42 43 44 45
endif()

if (TARGET create-apk-index)
    set_target_properties(create-apk-index PROPERTIES ANDROID_APK_DIR "${MAUIKIT_ANDROID_DIR}")
endif()

46
target_link_libraries(index Qt5::Sql Qt5::Qml Qt5::Widgets Qt5::Svg)
Camilo higuita's avatar
Camilo higuita committed
47 48 49 50 51 52 53 54 55

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)