X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=icons%2FCMakeLists.txt;h=6ffb7ecd429a0215cb43e9e612c29a1c2cb7913e;hp=0fda03ea04eb58269c6c376b372ca511ccd6591a;hb=041c9df658289105e566fe0b31cf7ffab51bc275;hpb=bb472af43db9b3a3bb02af1d853ae808890a49bb diff --git a/icons/CMakeLists.txt b/icons/CMakeLists.txt index 0fda03ea..6ffb7ecd 100644 --- a/icons/CMakeLists.txt +++ b/icons/CMakeLists.txt @@ -1,48 +1,84 @@ # 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) +# +# We put the bundled oxygen icon theme in DATADIR rather than ICONDIR, +# in order to avoid conflicts. As we add this directory to XDG_DATA_DIRS at runtime, +# the bundled theme will be found by Qt only if there is no oxygen theme installed +# in system directories. +# +# The hicolor folder contains icons vital for the Quassel UI (such as in the channel and nick +# lists). It is installed into the system icon directory (in order to allow overriding) and +# additionally always embedded as a fallback resource. + +if (WANT_MONO OR WANT_QTCLIENT) + set(ICON_RCS ${CMAKE_CURRENT_SOURCE_DIR}/hicolor.qrc) # always embed those + + if (NOT WITH_OXYGEN) + message(STATUS "Not installing bundled Oxygen icons") + endif() + + if (NOT WITH_BREEZE) + message(STATUS "Not installing bundled Breeze icons") + endif() + + if (NOT WITH_BREEZE_DARK) + message(STATUS "Not installing bundled Breeze Dark icons") + endif() + + if (EMBED_DATA) + if (WITH_OXYGEN) + message(STATUS "Embedding bundled Oxygen icons") + set(ICON_RCS ${ICON_RCS} ${CMAKE_CURRENT_SOURCE_DIR}/oxygen.qrc) + endif() + if (WITH_BREEZE) + message(STATUS "Embedding bundled Breeze icons") + set(ICON_RCS ${ICON_RCS} ${CMAKE_CURRENT_SOURCE_DIR}/breeze.qrc) + endif() + if (WITH_BREEZE_DARK) + message(STATUS "Embedding bundled Breeze Dark icons") + set(ICON_RCS ${ICON_RCS} ${CMAKE_CURRENT_SOURCE_DIR}/breezedark.qrc) + endif() + + message(STATUS "Embedding some extra Oxygen styled icons") + set(ICON_RCS ${ICON_RCS} ${CMAKE_CURRENT_SOURCE_DIR}/oxygen-extra.qrc) + + message(STATUS "Embedding some extra Breeze styled icons") + set(ICON_RCS ${ICON_RCS} ${CMAKE_CURRENT_SOURCE_DIR}/breeze-extra.qrc) + + message(STATUS "Embedding some extra Breeze Dark styled icons") + set(ICON_RCS ${ICON_RCS} ${CMAKE_CURRENT_SOURCE_DIR}/breezedark-extra.qrc) + + else() + install(DIRECTORY hicolor DESTINATION ${CMAKE_INSTALL_ICONDIR}) + if (WITH_OXYGEN) + message(STATUS "Installing bundled Oxygen icons") + install(DIRECTORY oxygen DESTINATION ${CMAKE_INSTALL_DATADIR}/quassel/icons) + endif() + if (WITH_BREEZE) + message(STATUS "Installing bundled Breeze icons") + install(DIRECTORY breeze DESTINATION ${CMAKE_INSTALL_DATADIR}/quassel/icons) + endif() + if (WITH_BREEZE_DARK) + message(STATUS "Installing bundled Breeze Dark icons") + install(DIRECTORY breezedark DESTINATION ${CMAKE_INSTALL_DATADIR}/quassel/icons) + endif() + + message(STATUS "Installing some extra bundled Oxygen styled icons") + install(DIRECTORY extra-icons/oxygen DESTINATION ${CMAKE_INSTALL_DATADIR}/quassel/icons/extra) + + message(STATUS "Installing some extra bundled Breeze styled icons") + install(DIRECTORY extra-icons/breeze DESTINATION ${CMAKE_INSTALL_DATADIR}/quassel/icons/extra) + + message(STATUS "Installing some extra bundled Breeze Dark styled icons") + install(DIRECTORY extra-icons/breezedark DESTINATION ${CMAKE_INSTALL_DATADIR}/quassel/icons/extra) + 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(NOT APPLE AND NOT WIN32) - 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(NOT APPLE AND NOT WIN32) + + # Application icon + if (HAVE_KDE OR (UNIX AND NOT APPLE)) + install(FILES hicolor/48x48/apps/quassel.png DESTINATION ${CMAKE_INSTALL_ICONDIR}/hicolor/48x48/apps) + if (CMAKE_INSTALL_PREFIX STREQUAL "/usr") + install(FILES hicolor/48x48/apps/quassel.png DESTINATION /usr/share/pixmaps) + endif() + endif() +endif()