Fix Icon fallback issue
[quassel.git] / icons / CMakeLists.txt
1 # Install icons
2 #
3 # We put the bundled oxygen icon theme in DATADIR rather than ICONDIR,
4 # in order to avoid conflicts. As we add this directory to XDG_DATA_DIRS at runtime,
5 # the bundled theme will be found by Qt only if there is no oxygen theme installed
6 # in system directories.
7 #
8 # The hicolor folder contains icons vital for the Quassel UI (such as in the channel and nick
9 # lists). It is installed into the system icon directory (in order to allow overriding) and
10 # additionally always embedded as a fallback resource.
11
12 if (WANT_MONO OR WANT_QTCLIENT)
13     set(ICON_RCS ${CMAKE_CURRENT_SOURCE_DIR}/hicolor.qrc) # always embed those
14
15     if (EMBED_DATA)
16         if (WITH_OXYGEN)
17             message(STATUS "Embedding bundled Oxygen icons")
18             set(ICON_RCS ${ICON_RCS} ${CMAKE_CURRENT_SOURCE_DIR}/oxygen.qrc)
19         endif()
20         if (WITH_BREEZE)
21             message(STATUS "Embedding bundled Breeze icons")
22             set(ICON_RCS ${ICON_RCS} ${CMAKE_CURRENT_SOURCE_DIR}/breeze.qrc)
23         endif()
24         if (WITH_BREEZE_DARK)
25             message(STATUS "Embedding bundled Breeze Dark icons")
26             set(ICON_RCS ${ICON_RCS} ${CMAKE_CURRENT_SOURCE_DIR}/breezedark.qrc)
27         endif()
28     else()
29         install(DIRECTORY hicolor DESTINATION ${CMAKE_INSTALL_ICONDIR})
30         if (WITH_OXYGEN)
31             message(STATUS "Installing bundled Oxygen icons")
32             install(DIRECTORY oxygen DESTINATION ${CMAKE_INSTALL_DATADIR}/quassel/icons)
33         endif()
34         if (WITH_BREEZE)
35             message(STATUS "Installing bundled Breeze icons")
36             install(DIRECTORY breeze DESTINATION ${CMAKE_INSTALL_DATADIR}/quassel/icons)
37         endif()
38         if (WITH_BREEZE_DARK)
39             message(STATUS "Installing bundled Breeze Dark icons")
40             install(DIRECTORY breezedark DESTINATION ${CMAKE_INSTALL_DATADIR}/quassel/icons)
41         endif()
42     endif()
43
44     if (NOT WITH_OXYGEN)
45         message(STATUS "Not installing bundled Oxygen icons")
46     endif()
47
48     if (NOT WITH_BREEZE)
49         message(STATUS "Not installing bundled Breeze icons")
50     endif()
51
52     if (NOT WITH_BREEZE_DARK)
53         message(STATUS "Not installing bundled Breeze Dark icons")
54     endif()
55
56     set(CLIENT_RCS ${CLIENT_RCS} ${ICON_RCS} PARENT_SCOPE)
57 endif()
58
59 # Application icon
60
61 if (HAVE_KDE OR (UNIX AND NOT APPLE))
62     install(FILES hicolor/48x48/apps/quassel.png DESTINATION ${CMAKE_INSTALL_ICONDIR}/hicolor/48x48/apps)
63     if (CMAKE_INSTALL_PREFIX STREQUAL "/usr")
64         install(FILES hicolor/48x48/apps/quassel.png DESTINATION /usr/share/pixmaps)
65     endif()
66 endif()