CMakeLists.txt 3.24 KB
Newer Older
1
2
3
4
5
6
# Copyright 2018-2020 Camilo Higuita <milo.h@aol.com>
# Copyright 2018-2020 Nitrux Latinoamericana S.C.
#
# SPDX-License-Identifier: GPL-3.0-or-later


Nicolas Fella's avatar
Nicolas Fella committed
7
8
9
10
11
set(pix_SRCS
    main.cpp
    pix.cpp
    models/gallery/gallery.cpp
    models/folders/folders.cpp
12
    models/tags/tagsmodel.cpp
13
    models/picinfomodel.cpp
14
15
16
#    utils/picinfo/exiv2extractor.cpp
#    utils/picinfo/reversegeocoder.cpp
#    utils/picinfo/kdtree.c
Nicolas Fella's avatar
Nicolas Fella committed
17
18
19
20
21
22
    )

set(pix_HDRS
    pix.h
    models/gallery/gallery.h
    models/folders/folders.h
23
    models/tags/tagsmodel.h
24
    models/picinfomodel.h
25
26
27
#    utils/picinfo/exiv2extractor.h
#    utils/picinfo/reversegeocoder.h
#    utils/picinfo/kdtree.h
Nicolas Fella's avatar
Nicolas Fella committed
28
29
30
31
    )

set(pix_ASSETS
    qml.qrc
camilo higuita's avatar
camilo higuita committed
32
    imgs.qrc
Nicolas Fella's avatar
Nicolas Fella committed
33
34
35
36
37
38
39
40
    )

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

camilo higuita's avatar
camilo higuita committed
41
42
#target_link_libraries(pix MauiKit Qt5::Sql Qt5::Qml Qt5::Svg Qt5::Positioning KF5::I18n LibExiv2::LibExiv2)
target_link_libraries(pix MauiKit Qt5::Sql Qt5::Qml Qt5::Svg Qt5::Positioning KF5::I18n)
Nicolas Fella's avatar
Nicolas Fella committed
43
44
45
46
47
48
49
50
51
52

if(ANDROID)
    target_link_libraries(pix Qt5::AndroidExtras)
    kde_source_files_enable_exceptions(pix pix.cpp)
endif()

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()
camilo higuita's avatar
camilo higuita committed
53
install(FILES assets/pix.svg DESTINATION ${KDE_INSTALL_ICONDIR}/hicolor/scalable/apps)
54
55
56
57
58

#
# Reverse GeoLookup Data
#
# Packagers can download the file and put it in the tarball
59
60
61
#if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/cities1000.zip)
#    file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/cities1000.zip DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
#endif()
62

63
64
65
66
67
68
#if (NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/cities1000.zip)
#    file (DOWNLOAD "http://download.geonames.org/export/dump/cities1000.zip"
#                ${CMAKE_CURRENT_BINARY_DIR}/cities1000.zip
#        SHOW_PROGRESS
#    )
#endif()
69

70
71
72
73
#execute_process(
#    COMMAND ${CMAKE_COMMAND} -E tar -xzf ${CMAKE_CURRENT_BINARY_DIR}/cities1000.zip
#    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
#)
74

75
76
77
#if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/admin1CodesASCII.txt)
#    file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/admin1CodesASCII.txt DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
#endif()
78

79
80
81
82
83
84
85
#if (NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/admin1CodesASCII.txt)
#    file (DOWNLOAD "http://download.geonames.org/export/dump/admin1CodesASCII.txt"
#                ${CMAKE_CURRENT_BINARY_DIR}/admin1CodesASCII.txt
#        SHOW_PROGRESS
#    )
#endif()
#file(RENAME ${CMAKE_CURRENT_BINARY_DIR}/admin1CodesASCII.txt ${CMAKE_CURRENT_BINARY_DIR}/admin1Codes.txt)
86

87
88
89
#if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/admin2Codes.txt)
#    file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/admin2Codes.txt DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
#endif()
90

91
92
#if (NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/admin2Codes.txt)
#    file (DOWNLOAD "http://download.geonames.org/export/dump/admin2Codes.txt"
camilo higuita's avatar
revert    
camilo higuita committed
93
#                ${CMAKE_CURRENT_BINARY_DIR}/admin2Codes.txt
94
95
96
#        SHOW_PROGRESS
#    )
#endif()
97

98
99
100
101
#install (FILES ${CMAKE_CURRENT_BINARY_DIR}/cities1000.txt DESTINATION ${DATA_INSTALL_DIR}/pix)
#install (FILES ${CMAKE_CURRENT_BINARY_DIR}/admin1Codes.txt DESTINATION ${DATA_INSTALL_DIR}/pix)
#install (FILES ${CMAKE_CURRENT_BINARY_DIR}/admin2Codes.txt DESTINATION ${DATA_INSTALL_DIR}/pix)
#install (FILES countries.csv DESTINATION ${DATA_INSTALL_DIR}/pix)