X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=cmake%2FQuasselInstallDirs.cmake;fp=cmake%2FQuasselInstallDirs.cmake;h=b67864342694976ed7763b65684f9298e97cecba;hp=0000000000000000000000000000000000000000;hb=d68e9d67200abc51123b357bcdbbc816d4a70791;hpb=921e54680da16fcf2adb7a90506875aceb6633a4 diff --git a/cmake/QuasselInstallDirs.cmake b/cmake/QuasselInstallDirs.cmake new file mode 100644 index 00000000..b6786434 --- /dev/null +++ b/cmake/QuasselInstallDirs.cmake @@ -0,0 +1,65 @@ +# This file sets up install locations for Quassel +# +# (C) 2015 by the Quassel Project +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +# Setup install locations +##################################################################### + +# We support the CMake standard variables (CMAKE_INSTALL__DIR), +# which can be overridden on the command line. If KDE integration is enabled, +# we make use of its settings. + +if (NOT WITH_KDE) + if (WIN32) + # On Windows, we have to guess good paths + # We must check if the variables are already defined on the command line + if (NOT DEFINED CMAKE_INSTALL_BINDIR) + set(CMAKE_INSTALL_BINDIR "${CMAKE_INSTALL_PREFIX}" CACHE PATH "Install path for binaries") + endif() + if (NOT DEFINED CMAKE_INSTALL_DATADIR) + set(CMAKE_INSTALL_DATADIR "$ENV{APPDATA}/quassel-irc.org/share/apps" CACHE PATH "Install path for data files") + endif() + if (NOT DEFINED CMAKE_INSTALL_ICONDIR) + set(CMAKE_INSTALL_ICONDIR "$ENV{APPDATA}/quassel-irc.org/share/icons" CACHE PATH "Install path for icons") + endif() + if (NOT DEFINED CMAKE_INSTALL_APPDIR) + set(CMAKE_INSTALL_APPDIR "$ENV{APPDATA}/quassel-irc.org/share/applications" CACHE PATH "Install path for .desktop files") + endif() + else() + # This sets the standard variables; however it doesn't know about icons and apps + include(GNUInstallDirs) + + # Special treatment for paths relative to DATAROOTDIR, as found in GNUInstallDirs + if (NOT CMAKE_INSTALL_ICONDIR) + set(CMAKE_INSTALL_ICONDIR "" CACHE PATH "Install path for icons") + set(CMAKE_INSTALL_ICONDIR "${CMAKE_INSTALL_DATAROOTDIR}/icons") + endif() + if (NOT CMAKE_INSTALL_APPDIR) + set(CMAKE_INSTALL_APPDIR "" CACHE PATH "Install path for .desktop files") + set(CMAKE_INSTALL_APPDIR "${CMAKE_INSTALL_DATAROOTDIR}/applications") + endif() + endif() +else() + if (HAVE_KDE4) + # FindKDE4Internal.cmake sets its own set of variables, however with deprecated names + if (NOT DEFINED CMAKE_INSTALL_BINDIR) + set(CMAKE_INSTALL_BINDIR "${BIN_INSTALL_DIR}" CACHE PATH "Install path for binaries") + endif() + if (NOT DEFINED CMAKE_INSTALL_DATADIR) + set(CMAKE_INSTALL_DATADIR "${DATA_INSTALL_DIR}" CACHE PATH "Install path for data files") + endif() + if (NOT DEFINED CMAKE_INSTALL_ICONDIR) + set(CMAKE_INSTALL_ICONDIR "${ICON_INSTALL_DIR}" CACHE PATH "Install path for icons") + endif() + if (NOT DEFINED CMAKE_INSTALL_APPDIR) + set(CMAKE_INSTALL_APPDIR "${XDG_APPS_INSTALL_DIR}" CACHE PATH "Install path for .desktop files") + endif() + endif() + + # KF5 does the correct thing, so we don't need to do anything + # We have already included KDEInstallDirs at this point. +endif()