summaryrefslogtreecommitdiff
blob: 6900e7a6843b5ba0ccc788df65d4a2b4e27b0495 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Creator: hasufell <julian.ospald@googlemail.com>
Date: Tue Mar 27 18:07:46 CEST 2012

add Path options to build system
see https://bugs.gentoo.org/show_bug.cgi?id=408811

--- CMakeLists.txt
+++ CMakeLists.txt
@@ -85,12 +85,20 @@
     ${CRYPTO_LIBRARY}
 )
 
-install(DIRECTORY ${PROJECT_SOURCE_DIR}/data DESTINATION share/meandmyshadow/)
-install(TARGETS meandmyshadow RUNTIME DESTINATION bin)
+# Path options
+set(BINDIR "bin" CACHE STRING "Where to install binaries")
+set(DATAROOTDIR "${CMAKE_INSTALL_PREFIX}/share" CACHE STRING "Sets the root of data directories to a non-default location")
+set(ICONDIR "${DATAROOTDIR}/icons" CACHE STRING "Sets the icon directory for desktop entry to a non-default location.")
+set(DESKTOPDIR "${DATAROOTDIR}/applications" CACHE STRING "Sets the desktop file directory for desktop entry to a non-default location.")
+
+# install locations
+install(DIRECTORY ${PROJECT_SOURCE_DIR}/data DESTINATION ${DATAROOTDIR}/meandmyshadow/)
+install(TARGETS meandmyshadow RUNTIME DESTINATION ${BINDIR})
+
 if("${CMAKE_SYSTEM_NAME}" MATCHES "Linux") 
-	install(FILES meandmyshadow.desktop DESTINATION share/applications/)
-	install(FILES icons/16x16/meandmyshadow.png DESTINATION share/icons/hicolor/16x16/apps/)
-	install(FILES icons/32x32/meandmyshadow.png DESTINATION share/icons/hicolor/32x32/apps/)
-	install(FILES icons/48x48/meandmyshadow.png DESTINATION share/icons/hicolor/48x48/apps/)
-	install(FILES icons/64x64/meandmyshadow.png DESTINATION share/icons/hicolor/64x64/apps/)
+	install(FILES meandmyshadow.desktop DESTINATION ${DESKTOPDIR})
+	install(FILES icons/16x16/meandmyshadow.png DESTINATION ${ICONDIR}/hicolor/16x16/apps/)
+	install(FILES icons/32x32/meandmyshadow.png DESTINATION ${ICONDIR}/hicolor/32x32/apps/)
+	install(FILES icons/48x48/meandmyshadow.png DESTINATION ${ICONDIR}/hicolor/48x48/apps/)
+	install(FILES icons/64x64/meandmyshadow.png DESTINATION ${ICONDIR}/hicolor/64x64/apps/)
 endif("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
--- src/config.h.in
+++ src/config.h.in
@@ -4,7 +4,7 @@
 #if defined(WIN32)
 //#define DATA_PATH
 #else
-#define DATA_PATH "@CMAKE_INSTALL_PREFIX@/share/meandmyshadow/data/"
+#define DATA_PATH "@DATAROOTDIR@/meandmyshadow/data/"
 #endif
 
 #endif