CMakeLists.txt 1.71 KB
Newer Older
1 2 3 4 5 6 7
project(pix)
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})

find_package(MauiKit REQUIRED)
8
find_package(Qt5 REQUIRED NO_MODULE COMPONENTS Qml Quick Sql Svg QuickControls2 Widgets)
9 10 11 12 13 14 15 16 17 18 19
include(KDEInstallDirs)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(KDECMakeSettings)
include(ECMInstallIcons)
include(FeatureSummary)
include(ECMAddAppIcon)

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTORCC ON)

add_executable(pix
20
    assets.qrc
21
    main.cpp
22 23 24 25 26 27
   
    src/db/db.cpp
    src/db/db.h
    src/db/dbactions.cpp   
    src/db/dbactions.h   
    src/db/fileloader.h
28 29 30 31 32 33 34 35 36
    src/pix.cpp
    src/qml.qrc
    )
    
if (ANDROID)
    find_package(Qt5 REQUIRED COMPONENTS AndroidExtras)

    target_link_libraries(vvave Qt5::AndroidExtras)
    kde_source_files_enable_exceptions(pix src/pix.cpp)
37
else() 
Camilo higuita's avatar
Camilo higuita committed
38 39 40
    find_package(KF5 ${KF5_VERSION} REQUIRED COMPONENTS I18n Notifications Config KIO)
    find_package(Qt5 REQUIRED COMPONENTS WebEngine)

41
    target_link_libraries(pix KF5::ConfigCore KF5::Notifications KF5::KIOCore KF5::I18n)
42 43 44 45 46 47
endif()

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

48
target_link_libraries(pix MauiKit Qt5::Sql Qt5::Qml Qt5::Widgets Qt5::Svg)
49 50 51 52 53 54 55 56 57

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

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

feature_summary(WHAT ALL   FATAL_ON_MISSING_REQUIRED_PACKAGES)