CMakeLists.txt 2.31 KB
Newer Older
1 2 3 4 5
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})
6
set(CMAKE_CXX_STANDARD 17)
7 8

find_package(MauiKit REQUIRED)
9
find_package(Qt5 REQUIRED NO_MODULE COMPONENTS Qml Quick Sql Svg QuickControls2 Widgets)
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)

20
set(pix_SRCS
21
    main.cpp
22
    src/pix.cpp
23
    src/db/db.cpp
24 25 26
    src/db/dbactions.cpp
    src/models/basemodel.cpp
    src/models/baselist.cpp
27 28 29 30
    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
31
    src/models/cloud/cloud.cpp
32 33 34 35
    )

set(pix_HDRS
    src/pix.h
36
    src/db/fileloader.h
37 38 39 40 41
    src/db/db.h
    src/db/dbactions.h
    src/utils/pic.h
    src/models/basemodel.h
    src/models/baselist.h
42 43 44 45
    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
46
    src/models/cloud/cloud.h
47 48 49
    )

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

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

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

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

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

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

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

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)