b989db482f7d96669c3b9a38f4f423be158d3afd
[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     if (EMBED_DATA)
11         # Always embed quassel-specific icons
12         message(STATUS "Embedding Quassel-specific icons")
13         list(APPEND ICON_RCS ${CMAKE_CURRENT_SOURCE_DIR}/breeze_icons.qrc)
14         list(APPEND ICON_RCS ${CMAKE_CURRENT_SOURCE_DIR}/breeze_dark_icons.qrc)
15         if (WITH_OXYGEN_ICONS)
16             list(APPEND ICON_RCS ${CMAKE_CURRENT_SOURCE_DIR}/oxygen_icons.qrc)
17         endif()
18
19         if (WITH_BUNDLED_ICONS)
20             message(STATUS "Embedding bundled Breeze icon theme")
21             list(APPEND ICON_RCS ${BUNDLED_ICON_THEME_DIR}/breeze_icon_theme.qrc)
22             list(APPEND ICON_RCS ${BUNDLED_ICON_THEME_DIR}/breeze_dark_icon_theme.qrc)
23             if (WITH_OXYGEN_ICONS)
24                 message(STATUS "Embedding bundled Oxygen icon theme")
25                 list(APPEND ICON_RCS ${BUNDLED_ICON_THEME_DIR}/oxygen_icon_theme.qrc)
26             endif()
27         endif()
28
29     else()
30         # Always install quassel-specific icons
31         install(DIRECTORY breeze breeze-dark DESTINATION ${CMAKE_INSTALL_DATADIR}/quassel/icons)
32         if (WITH_OXYGEN_ICONS)
33             install(DIRECTORY oxygen DESTINATION ${CMAKE_INSTALL_DATADIR}/quassel/icons)
34         endif()
35
36         # Install bundled icon themes into our data dir (instead of CMAKE_INSTALL_ICONDIR) to avoid conflicts
37         # with themes provided by the system
38         if (WITH_BUNDLED_ICONS)
39             message(STATUS "Installing bundled Breeze icon theme")
40             install(DIRECTORY   ${BUNDLED_ICON_THEME_DIR}/breeze
41                                 ${BUNDLED_ICON_THEME_DIR}/breeze-dark
42                     DESTINATION ${CMAKE_INSTALL_DATADIR}/quassel/icons
43             )
44             if (WITH_OXYGEN_ICONS)
45                 message(STATUS "Installing bundled Oxygen icon theme")
46                 install(DIRECTORY ${BUNDLED_ICON_THEME_DIR}/oxygen DESTINATION ${CMAKE_INSTALL_DATADIR}/quassel/icons)
47             endif()
48         endif()
49     endif()
50
51     set(CLIENT_RCS ${CLIENT_RCS} ${ICON_RCS} PARENT_SCOPE)
52
53     # Application icon
54     if (HAVE_KDE OR (UNIX AND NOT APPLE))
55         # hicolor contains the application icon in all relevant sizes
56         install(DIRECTORY hicolor DESTINATION ${CMAKE_INSTALL_ICONDIR})
57
58         if (USE_QT4)
59             # Qt 4 doesn't seem to correctly load icons from injected themes
60             # Install Quassel-specific ones from Oxygen into hicolor as fallback
61             install(DIRECTORY oxygen/ DESTINATION ${CMAKE_INSTALL_ICONDIR}/hicolor)
62         endif()
63
64         # For a system install, also copy to pixmaps
65         if (CMAKE_INSTALL_PREFIX STREQUAL "/usr")
66             install(FILES hicolor/48x48/apps/quassel.png DESTINATION /usr/share/pixmaps)
67         endif()
68     endif()
69 endif()