CMakeLists.txt 1.94 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
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)

19
set(pix_SRCS
20
    main.cpp
21
    src/pix.cpp
22
    src/db/db.cpp
23 24 25 26 27 28 29
    src/db/dbactions.cpp
    src/models/basemodel.cpp
    src/models/baselist.cpp
    )

set(pix_HDRS
    src/pix.h
30
    src/db/fileloader.h
31 32 33 34 35 36 37 38
    src/db/db.h
    src/db/dbactions.h
    src/utils/pic.h
    src/models/basemodel.h
    src/models/baselist.h
    )

set(pix_ASSETS
39
    src/qml.qrc
40
    assets.qrc
41
    )
42 43 44 45 46 47 48

add_executable(pix
    ${pix_SRCS}
    ${pix_HDRS}
    ${pix_ASSETS}
    )

49 50 51 52 53
if (ANDROID)
    find_package(Qt5 REQUIRED COMPONENTS AndroidExtras)

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

58
    target_link_libraries(pix KF5::ConfigCore KF5::Notifications KF5::KIOCore KF5::I18n)
59 60 61 62 63 64
endif()

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

65
target_link_libraries(pix MauiKit Qt5::Sql Qt5::Qml Qt5::Widgets Qt5::Svg)
66 67 68 69 70 71 72 73 74

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)