CMakeLists.txt 2.29 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
    src/db/dbactions.cpp
    src/models/basemodel.cpp
    src/models/baselist.cpp
26 27 28 29
    src/models/gallery/gallery.cpp
    src/models/albums/albums.cpp
    src/models/folders/folders.cpp
    src/models/folders/foldermodel.cpp
Camilo higuita's avatar
Camilo higuita committed
30
    src/models/cloud/cloud.cpp
31 32 33 34
    )

set(pix_HDRS
    src/pix.h
35
    src/db/fileloader.h
36 37 38 39 40
    src/db/db.h
    src/db/dbactions.h
    src/utils/pic.h
    src/models/basemodel.h
    src/models/baselist.h
41 42 43 44
    src/models/gallery/gallery.h
    src/models/albums/albums.h
    src/models/folders/folders.h
    src/models/folders/foldermodel.h
Camilo higuita's avatar
Camilo higuita committed
45
    src/models/cloud/cloud.h
46 47 48
    )

set(pix_ASSETS
49
    src/qml.qrc
50
    assets.qrc
51
    )
52 53 54 55 56 57 58

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

59 60 61 62 63
if (ANDROID)
    find_package(Qt5 REQUIRED COMPONENTS AndroidExtras)

    target_link_libraries(vvave Qt5::AndroidExtras)
    kde_source_files_enable_exceptions(pix src/pix.cpp)
64
else() 
65
    find_package(KF5 ${KF5_VERSION} REQUIRED COMPONENTS I18n Notifications Config KIO Attica)
Camilo higuita's avatar
Camilo higuita committed
66 67
    find_package(Qt5 REQUIRED COMPONENTS WebEngine)

68
    target_link_libraries(pix KF5::ConfigCore KF5::Notifications KF5::KIOCore KF5::I18n KF5::Attica)
69 70 71 72 73 74
endif()

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

75
target_link_libraries(pix MauiKit Qt5::Sql Qt5::Qml Qt5::Widgets Qt5::Svg)
76 77 78 79 80 81 82 83 84

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)