common: Port remote nicks to NickHighlightMatcher
[quassel.git] / icons / CMakeLists.txt
1 # Install icons
2
3 if (WANT_MONO OR WANT_QTCLIENT)
4     if (NOT WITH_BUNDLED_ICONS AND NOT WITH_OXYGEN_ICONS)
5         message(WARNING "Not including bundled icon themes. Ensure that the Breeze or Oxygen icon theme is installed!")
6     endif()
7
8     set(BUNDLED_ICON_THEME_DIR ${CMAKE_SOURCE_DIR}/3rdparty/icons)
9
10     # Always embed a hicolor fallback containing the most important (e.g. tray) icons
11     list(APPEND ICON_RCS ${CMAKE_CURRENT_SOURCE_DIR}/hicolor_icons.qrc)
12
13     if (EMBED_DATA)
14         # Always embed quassel-specific icons
15         message(STATUS "Embedding Quassel-specific icons")
16         list(APPEND ICON_RCS ${CMAKE_CURRENT_SOURCE_DIR}/breeze_icons.qrc)
17         list(APPEND ICON_RCS ${CMAKE_CURRENT_SOURCE_DIR}/breeze_dark_icons.qrc)
18         if (WITH_OXYGEN_ICONS)
19             list(APPEND ICON_RCS ${CMAKE_CURRENT_SOURCE_DIR}/oxygen_icons.qrc)
20         endif()
21
22         if (WITH_BUNDLED_ICONS)
23             message(STATUS "Embedding bundled Breeze icon theme")
24             list(APPEND ICON_RCS ${BUNDLED_ICON_THEME_DIR}/breeze_icon_theme.qrc)
25             list(APPEND ICON_RCS ${BUNDLED_ICON_THEME_DIR}/breeze_dark_icon_theme.qrc)
26             if (WITH_OXYGEN_ICONS)
27                 message(STATUS "Embedding bundled Oxygen icon theme")
28                 list(APPEND ICON_RCS ${BUNDLED_ICON_THEME_DIR}/oxygen_icon_theme.qrc)
29             endif()
30         endif()
31
32     else()
33         # Always install quassel-specific icons
34         install(DIRECTORY breeze breeze-dark DESTINATION ${CMAKE_INSTALL_DATADIR}/quassel/icons)
35         if (WITH_OXYGEN_ICONS)
36             install(DIRECTORY oxygen DESTINATION ${CMAKE_INSTALL_DATADIR}/quassel/icons)
37         endif()
38
39         # Install bundled icon themes into our data dir (instead of CMAKE_INSTALL_ICONDIR) to avoid conflicts
40         # with themes provided by the system
41         if (WITH_BUNDLED_ICONS)
42             message(STATUS "Installing bundled Breeze icon theme")
43             install(DIRECTORY   ${BUNDLED_ICON_THEME_DIR}/breeze
44                                 ${BUNDLED_ICON_THEME_DIR}/breeze-dark
45                     DESTINATION ${CMAKE_INSTALL_DATADIR}/quassel/icons
46             )
47             if (WITH_OXYGEN_ICONS)
48                 message(STATUS "Installing bundled Oxygen icon theme")
49                 install(DIRECTORY ${BUNDLED_ICON_THEME_DIR}/oxygen DESTINATION ${CMAKE_INSTALL_DATADIR}/quassel/icons)
50             endif()
51         endif()
52     endif()
53
54     set(CLIENT_RCS ${CLIENT_RCS} ${ICON_RCS} PARENT_SCOPE)
55
56     # Application icon
57     if (HAVE_KDE OR (UNIX AND NOT APPLE))
58         # hicolor contains the application icon in all relevant sizes
59         install(DIRECTORY hicolor DESTINATION ${CMAKE_INSTALL_ICONDIR})
60
61         if (USE_QT4 OR (USE_QT5 AND Qt5Core_VERSION VERSION_LESS 5.5.0))
62             # Qt 4 doesn't seem to correctly load icons from injected themes
63             # Install Quassel-specific ones from Oxygen into hicolor as fallback
64             install(DIRECTORY oxygen/ DESTINATION ${CMAKE_INSTALL_ICONDIR}/hicolor)
65         endif()
66
67         # For a system install, also copy to pixmaps
68         if (CMAKE_INSTALL_PREFIX STREQUAL "/usr")
69             install(FILES hicolor/48x48/apps/quassel.png DESTINATION /usr/share/pixmaps)
70         endif()
71     endif()
72 endif()