X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=icons%2FCMakeLists.txt;h=fab63f66adc98a0b46a5503866f5bee0c195e30e;hp=085ca92cd35b61b67b57ded83633712282b8e4d2;hb=f788ce32deb5df0351488c908fd5bacd25d7b6cf;hpb=1cb4bf57093cfc8fc25b27fd9060abe615e7bfda diff --git a/icons/CMakeLists.txt b/icons/CMakeLists.txt index 085ca92c..fab63f66 100644 --- a/icons/CMakeLists.txt +++ b/icons/CMakeLists.txt @@ -1,48 +1,72 @@ # Install icons -# We put them in DATA_INSTALL_DIR rather than ICON_INSTALL_DIR, to avoid -# polluting the global namespace and to allow overriding - -if(WANT_MONO OR WANT_QTCLIENT) - - # Figure out if we want to install KDE's icons - # Starting with KDE 4.3, they shouldn't be needed anymore - set(INSTALL_OXY true) - string(TOUPPER ${WITH_OXYGEN} OXY_UPPER) - if(NOT OXY_UPPER) - set(INSTALL_OXY false) - elseif(OXY_UPPER MATCHES "AUTO") - if(HAVE_KDE) - if(KDE_VERSION VERSION_GREATER 4.2.99) - set(INSTALL_OXY false) - endif(KDE_VERSION VERSION_GREATER 4.2.99) - endif(HAVE_KDE) - endif(NOT OXY_UPPER) - - if(INSTALL_OXY) - message(STATUS "Installing Oxygen icons") - else(INSTALL_OXY) - message(STATUS "Not installing Oxygen icons") - endif(INSTALL_OXY) - - if(EMBED_DATA) - set(ICON_RCS ../icons/hicolor.qrc ../icons/oxygen.qrc) - if(INSTALL_OXY) - set(ICON_RCS ${ICON_RCS} ../icons/oxygen_kde.qrc) - endif(INSTALL_OXY) + +if (WANT_MONO OR WANT_QTCLIENT) + if (NOT WITH_BUNDLED_ICONS AND NOT WITH_OXYGEN_ICONS) + message(WARNING "Not including bundled icon themes. Ensure that the Breeze or Oxygen icon theme is installed!") + endif() + + set(BUNDLED_ICON_THEME_DIR ${CMAKE_SOURCE_DIR}/3rdparty/icons) + + # Always embed a hicolor fallback containing the most important (e.g. tray) icons + list(APPEND ICON_RCS ${CMAKE_CURRENT_SOURCE_DIR}/hicolor_icons.qrc) + + if (EMBED_DATA) + # Always embed quassel-specific icons + message(STATUS "Embedding Quassel-specific icons") + list(APPEND ICON_RCS ${CMAKE_CURRENT_SOURCE_DIR}/breeze_icons.qrc) + list(APPEND ICON_RCS ${CMAKE_CURRENT_SOURCE_DIR}/breeze_dark_icons.qrc) + if (WITH_OXYGEN_ICONS) + list(APPEND ICON_RCS ${CMAKE_CURRENT_SOURCE_DIR}/oxygen_icons.qrc) + endif() + + if (WITH_BUNDLED_ICONS) + message(STATUS "Embedding bundled Breeze icon theme") + list(APPEND ICON_RCS ${BUNDLED_ICON_THEME_DIR}/breeze_icon_theme.qrc) + list(APPEND ICON_RCS ${BUNDLED_ICON_THEME_DIR}/breeze_dark_icon_theme.qrc) + if (WITH_OXYGEN_ICONS) + message(STATUS "Embedding bundled Oxygen icon theme") + list(APPEND ICON_RCS ${BUNDLED_ICON_THEME_DIR}/oxygen_icon_theme.qrc) + endif() + endif() + + else() + # Always install quassel-specific icons + install(DIRECTORY breeze breeze-dark DESTINATION ${CMAKE_INSTALL_DATADIR}/quassel/icons) + if (WITH_OXYGEN_ICONS) + install(DIRECTORY oxygen DESTINATION ${CMAKE_INSTALL_DATADIR}/quassel/icons) + endif() + + # Install bundled icon themes into our data dir (instead of CMAKE_INSTALL_ICONDIR) to avoid conflicts + # with themes provided by the system + if (WITH_BUNDLED_ICONS) + message(STATUS "Installing bundled Breeze icon theme") + install(DIRECTORY ${BUNDLED_ICON_THEME_DIR}/breeze + ${BUNDLED_ICON_THEME_DIR}/breeze-dark + DESTINATION ${CMAKE_INSTALL_DATADIR}/quassel/icons + ) + if (WITH_OXYGEN_ICONS) + message(STATUS "Installing bundled Oxygen icon theme") + install(DIRECTORY ${BUNDLED_ICON_THEME_DIR}/oxygen DESTINATION ${CMAKE_INSTALL_DATADIR}/quassel/icons) + endif() + endif() + endif() + set(CLIENT_RCS ${CLIENT_RCS} ${ICON_RCS} PARENT_SCOPE) - else(EMBED_DATA) - install(DIRECTORY hicolor DESTINATION ${ICON_INSTALL_DIR}) - install(DIRECTORY oxygen DESTINATION ${DATA_INSTALL_DIR}/quassel/icons) - if(INSTALL_OXY) - install(DIRECTORY oxygen_kde/ DESTINATION ${DATA_INSTALL_DIR}/quassel/icons/oxygen) - endif(INSTALL_OXY) - endif(EMBED_DATA) -endif(WANT_MONO OR WANT_QTCLIENT) - -# Application icon -if((UNIX AND NOT APPLE) OR HAVE_KDE) - install(FILES oxygen_kde/48x48/apps/quassel.png DESTINATION ${ICON_INSTALL_DIR}/hicolor/48x48/apps) - if(CMAKE_INSTALL_PREFIX STREQUAL "/usr") - install(FILES oxygen_kde/48x48/apps/quassel.png DESTINATION /usr/share/pixmaps) - endif(CMAKE_INSTALL_PREFIX STREQUAL "/usr") -endif((UNIX AND NOT APPLE) OR HAVE_KDE) + + # Application icon + if (HAVE_KDE OR (UNIX AND NOT APPLE)) + # hicolor contains the application icon in all relevant sizes + install(DIRECTORY hicolor DESTINATION ${CMAKE_INSTALL_ICONDIR}) + + if (USE_QT4 OR (USE_QT5 AND Qt5Core_VERSION VERSION_LESS 5.5.0)) + # Qt 4 doesn't seem to correctly load icons from injected themes + # Install Quassel-specific ones from Oxygen into hicolor as fallback + install(DIRECTORY oxygen/ DESTINATION ${CMAKE_INSTALL_ICONDIR}/hicolor) + endif() + + # For a system install, also copy to pixmaps + if (CMAKE_INSTALL_PREFIX STREQUAL "/usr") + install(FILES hicolor/48x48/apps/quassel.png DESTINATION /usr/share/pixmaps) + endif() + endif() +endif()