Fixes misalignment of buttons in inputwidget
[quassel.git] / cmake / QuasselInstallDirs.cmake
1 # This file sets up install locations for Quassel
2 #
3 # (C) 2015 by the Quassel Project <devel@quassel-irc.org>
4 #
5 # Redistribution and use is allowed according to the terms of the BSD license.
6 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
7
8
9 # Setup install locations
10 #####################################################################
11
12 # We support the CMake standard variables (CMAKE_INSTALL_<TYPE>_DIR),
13 # which can be overridden on the command line. If KDE integration is enabled,
14 # we make use of its settings.
15
16 if (NOT WITH_KDE)
17     if (WIN32)
18         # On Windows, we have to guess good paths
19         # We must check if the variables are already defined on the command line
20         if (NOT DEFINED CMAKE_INSTALL_BINDIR)
21             set(CMAKE_INSTALL_BINDIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Install path for executables and DLLs")
22         endif()
23         if (NOT DEFINED CMAKE_INSTALL_LIBDIR)
24             set(CMAKE_INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Install path for static libraries")
25         endif()
26         if (NOT DEFINED CMAKE_INSTALL_DATADIR)
27             set(CMAKE_INSTALL_DATADIR "$ENV{APPDATA}/quassel-irc.org/share/apps" CACHE PATH "Install path for data files")
28         endif()
29         if (NOT DEFINED CMAKE_INSTALL_ICONDIR)
30             set(CMAKE_INSTALL_ICONDIR "$ENV{APPDATA}/quassel-irc.org/share/icons" CACHE PATH "Install path for icons")
31         endif()
32         if (NOT DEFINED CMAKE_INSTALL_APPDIR)
33             set(CMAKE_INSTALL_APPDIR "$ENV{APPDATA}/quassel-irc.org/share/applications" CACHE PATH "Install path for .desktop files")
34         endif()
35     else()
36         # This sets the standard variables; however it doesn't know about icons and apps
37         include(GNUInstallDirs)
38
39         # Special treatment for paths relative to DATAROOTDIR, as found in GNUInstallDirs
40         if (NOT CMAKE_INSTALL_ICONDIR)
41             set(CMAKE_INSTALL_ICONDIR "" CACHE PATH "Install path for icons")
42             set(CMAKE_INSTALL_ICONDIR "${CMAKE_INSTALL_DATAROOTDIR}/icons")
43         endif()
44         if (NOT CMAKE_INSTALL_APPDIR)
45             set(CMAKE_INSTALL_APPDIR "" CACHE PATH "Install path for .desktop files")
46             set(CMAKE_INSTALL_APPDIR "${CMAKE_INSTALL_DATAROOTDIR}/applications")
47         endif()
48     endif()
49 else()
50     if (WITH_KDE4)
51         # FindKDE4Internal.cmake sets its own set of variables, however with deprecated names
52         if (NOT DEFINED CMAKE_INSTALL_BINDIR)
53             set(CMAKE_INSTALL_BINDIR "${BIN_INSTALL_DIR}" CACHE PATH "Install path for binaries")
54         endif()
55         if (NOT DEFINED CMAKE_INSTALL_DATADIR)
56             set(CMAKE_INSTALL_DATADIR "${DATA_INSTALL_DIR}" CACHE PATH "Install path for data files")
57         endif()
58         if (NOT DEFINED CMAKE_INSTALL_ICONDIR)
59             set(CMAKE_INSTALL_ICONDIR "${ICON_INSTALL_DIR}" CACHE PATH "Install path for icons")
60         endif()
61         if (NOT DEFINED CMAKE_INSTALL_APPDIR)
62             set(CMAKE_INSTALL_APPDIR "${XDG_APPS_INSTALL_DIR}" CACHE PATH "Install path for .desktop files")
63         endif()
64     endif()
65
66     # KF5 does the correct thing, so we don't need to do anything
67     # We have already included KDEInstallDirs at this point.
68 endif()