CMakeLists.txt 4.18 KB
Newer Older
1
2

add_definitions(-DTRANSLATION_DOMAIN=\"libgravatar\")
3
4
add_library(KF5Gravatar)
add_library(KF5::Gravatar ALIAS KF5Gravatar)
5

6
target_sources(KF5Gravatar PRIVATE
7
    misc/gravatarcache.cpp
8
    misc/hash.cpp
9
10
11
    widgets/gravatardownloadpixmapwidget.cpp
    widgets/gravatardownloadpixmapdialog.cpp
    widgets/gravatarconfigwidget.cpp
12
    widgets/gravatarconfiguresettingswidget.cpp
13
14
    widgets/gravatarconfiguresettingsdialog.cpp
    job/gravatarresolvurljob.cpp
Laurent Montel's avatar
Laurent Montel committed
15
16
17
18
19
20
21
22
23
24
    job/gravatarresolvurljob.h
    misc/hash.h
    misc/gravatarcache.h
    gravatar_private_export.h
    widgets/gravatarconfiguresettingswidget.h
    widgets/gravatarconfigwidget.h
    widgets/gravatardownloadpixmapdialog.h
    widgets/gravatardownloadpixmapwidget.h
    widgets/gravatarconfiguresettingsdialog.h

25
26
)

27
ecm_qt_declare_logging_category(KF5Gravatar HEADER gravatar_debug.h IDENTIFIER GRAVATAR_LOG CATEGORY_NAME org.kde.pim.gravatar
Laurent Montel's avatar
Laurent Montel committed
28
29
        OLD_CATEGORY_NAMES log_gravatar
        DESCRIPTION "libgravatar (libgravatar)" EXPORT GRAVATAR)
30

31
kconfig_add_kcfg_files(KF5Gravatar
32
33
34
    settings/gravatarsettings.kcfgc
)

Laurent Montel's avatar
Laurent Montel committed
35
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
36
37
    set_target_properties(KF5Gravatar PROPERTIES UNITY_BUILD ON)
endif()
38
generate_export_header(KF5Gravatar BASE_NAME gravatar)
39

40
41
42
43
44
45
46
target_link_libraries(KF5Gravatar
  PRIVATE
    KF5::ConfigCore
    KF5::I18n
    KF5::WidgetsAddons
    KF5::ConfigGui
    KF5::PimCommon
Laurent Montel's avatar
Laurent Montel committed
47
    KF5::TextWidgets
48
49
50
51
52
53
54
)
target_include_directories(KF5Gravatar INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/Gravatar/;${KDE_INSTALL_INCLUDEDIR_KF5}/gravatar>")

target_include_directories(KF5Gravatar PUBLIC "$<BUILD_INTERFACE:${gravatar_SOURCE_DIR}/src;${gravatar_BINARY_DIR}/src>")


set_target_properties(KF5Gravatar PROPERTIES
55
    VERSION ${GRAVATAR_VERSION}
56
57
58
59
60
61
    SOVERSION ${GRAVATAR_SOVERSION}
    EXPORT_NAME Gravatar
)

install(TARGETS
    KF5Gravatar
62
    EXPORT KF5GravatarTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS}
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
)

ecm_generate_headers(Gravatar_Camelcase_job_HEADERS
  HEADER_NAMES
  GravatarResolvUrlJob
  REQUIRED_HEADERS Gravatar_job_HEADERS
  PREFIX Gravatar
  RELATIVE job
)

ecm_generate_headers(Gravatar_Camelcase_misc_HEADERS
  HEADER_NAMES
  GravatarCache
  REQUIRED_HEADERS Gravatar_misc_HEADERS
  PREFIX Gravatar
  RELATIVE misc
)

ecm_generate_headers(Gravatar_Camelcase_widgets_HEADERS
  HEADER_NAMES
  GravatarConfigureSettingsDialog
  GravatarConfigWidget
  GravatarDownloadPixmapWidget
Laurent Montel's avatar
Laurent Montel committed
86
  GravatarConfigureSettingsWidget
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
  REQUIRED_HEADERS Gravatar_widgets_HEADERS
  PREFIX Gravatar
  RELATIVE widgets
)


ecm_generate_pri_file(BASE_NAME Gravatar
    LIB_NAME KF5Gravatar
    DEPS "" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/Gravatar
)

install(FILES
    ${Gravatar_Camelcase_widgets_HEADERS}
    ${Gravatar_Camelcase_job_HEADERS}
    ${Gravatar_Camelcase_misc_HEADERS}
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/Gravatar
    COMPONENT Devel
)

install(FILES
    ${Gravatar_widgets_HEADERS}
    ${Gravatar_job_HEADERS}
    ${Gravatar_misc_HEADERS}
    ${CMAKE_CURRENT_BINARY_DIR}/gravatar_export.h
    ${CMAKE_CURRENT_BINARY_DIR}/gravatarsettings.h
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/gravatar
    COMPONENT Devel
)
install(FILES
    ${PRI_FILENAME}
    DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
Laurent Montel's avatar
Laurent Montel committed
118

119
ecm_qt_install_logging_categories(EXPORT GRAVATAR FILE libgravatar.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
Laurent Montel's avatar
Laurent Montel committed
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148


if (BUILD_QCH)
    ecm_add_qch(
        KF5Gravatar_QCH
        NAME KF5Gravatar
        BASE_NAME KF5Gravatar
        VERSION ${PIM_VERSION}
        ORG_DOMAIN org.kde
        SOURCES # using only public headers, to cover only public API
            ${Gravatar_Camelcase_widgets_HEADERS}
            ${Gravatar_Camelcase_job_HEADERS}
            ${Gravatar_Camelcase_misc_HEADERS}
        MD_MAINPAGE "${CMAKE_SOURCE_DIR}/README.md"
        #IMAGE_DIRS "${CMAKE_SOURCE_DIR}/docs/pics"
        LINK_QCHS
            Qt5Core_QCH
            Qt5Gui_QCH
            Qt5Widgets_QCH
            Qt5Networks_QCH
        INCLUDE_DIRS
            ${CMAKE_CURRENT_BINARY_DIR}
        BLANK_MACROS
            GRAVATAR_EXPORT
        TAGFILE_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR}
        QCH_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR}
        COMPONENT Devel
    )
endif()