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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
From 11c72da8b2bf96f650ca6e1e38af0819c4f49c45 Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner <andreas.sturmlechner@gmail.com>
Date: Mon, 1 Jan 2018 11:52:18 +0100
Subject: [PATCH] Use GNUInstallDirs
Fixes multiarch and deprecated man dir location.
---
CMakeLists.txt | 14 ++++++++------
src/cli/CMakeLists.txt | 2 +-
src/core/CMakeLists.txt | 6 +++---
src/gui/CMakeLists.txt | 2 +-
src/player/CMakeLists.txt | 2 +-
5 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 96dbf47a..2caab298 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -30,6 +30,8 @@ ELSE()
SET(DISPLAY_VERSION "${VERSION}-${GIT_REVISION}")
ENDIF(VERSION_SUFFIX)
+include(GNUInstallDirs)
+
SET(LIBSNDFILE_VERSION_PREV "1.0.17")
#
@@ -146,13 +148,13 @@ ELSE(MINGW)
#Without setting this, installation would go into /usr/local, which does not exist per default
SET(CMAKE_INSTALL_PREFIX "/usr" )
ELSE(APPLE)
- SET(OSS_LIB_PATHS "/usr/lib${LIB_SUFFIX}/oss/lib" "/usr/local/lib${LIB_SUFFIX}/oss/lib" )
+ SET(OSS_LIB_PATHS "${CMAKE_INSTALL_LIBDIR}/oss/lib" "/usr/local/lib${LIB_SUFFIX}/oss/lib" )
ENDIF(APPLE)
ENDIF(MINGW)
#Installation paths
# TODO remove data from path
-SET(SYS_DATA_PATH "${CMAKE_INSTALL_PREFIX}/share/hydrogen/data")
+SET(SYS_DATA_PATH "${CMAKE_INSTALL_DATAROOTDIR}/hydrogen/data")
# TODO remove data from path, could be .config/hydrogen
SET(USR_DATA_PATH ".hydrogen/data")
@@ -358,10 +360,10 @@ ELSE()
INSTALL(DIRECTORY data DESTINATION ${SYS_DATA_PATH}/.. PATTERN ".git" EXCLUDE)
ENDIF()
IF(NOT MINGW AND NOT APPLE)
- INSTALL(FILES ${CMAKE_SOURCE_DIR}/linux/hydrogen.appdata.xml DESTINATION "${CMAKE_INSTALL_PREFIX}/share/appdata")
- INSTALL(FILES ${CMAKE_SOURCE_DIR}/linux/hydrogen.desktop DESTINATION "${CMAKE_INSTALL_PREFIX}/share/applications")
- INSTALL(FILES ${CMAKE_SOURCE_DIR}/data/img/gray/h2-icon.svg DESTINATION "/usr/share/pixmaps")
- INSTALL(FILES ${CMAKE_SOURCE_DIR}/linux/hydrogen.1 DESTINATION "${CMAKE_INSTALL_PREFIX}/man/man1")
+ INSTALL(FILES ${CMAKE_SOURCE_DIR}/linux/hydrogen.appdata.xml DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/appdata")
+ INSTALL(FILES ${CMAKE_SOURCE_DIR}/linux/hydrogen.desktop DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
+ INSTALL(FILES ${CMAKE_SOURCE_DIR}/data/img/gray/h2-icon.svg DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/pixmaps")
+ INSTALL(FILES ${CMAKE_SOURCE_DIR}/linux/hydrogen.1 DESTINATION "${CMAKE_INSTALL_MANDIR}/man1")
ENDIF()
#
diff --git a/src/cli/CMakeLists.txt b/src/cli/CMakeLists.txt
index f6cd04eb..7725dc83 100644
--- a/src/cli/CMakeLists.txt
+++ b/src/cli/CMakeLists.txt
@@ -20,4 +20,4 @@ TARGET_LINK_LIBRARIES(h2cli
ADD_DEPENDENCIES(h2cli hydrogen-core-${VERSION})
-INSTALL(TARGETS h2cli RUNTIME DESTINATION bin BUNDLE DESTINATION bin )
+INSTALL(TARGETS h2cli RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR})
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index db1333da..0ab61d96 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -57,13 +57,13 @@ TARGET_LINK_LIBRARIES(hydrogen-core-${VERSION}
#SET_TARGET_PROPERTIES(hydrogen-core-${VERSION} PROPERTIES PUBLIC_HEADER "${hydrogen_INCLUDES}" )
INSTALL(TARGETS hydrogen-core-${VERSION}
- LIBRARY DESTINATION "lib${LIB_SUFFIX}"
- ARCHIVE DESTINATION "lib${LIB_SUFFIX}"
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
# do not copy directory hierarchy
#PUBLIC_HEADER DESTINATION include/hydrogen
)
IF(NOT APPLE AND NOT WIN32)
INSTALL(DIRECTORY include DESTINATION "${CMAKE_INSTALL_PREFIX}" FILES_MATCHING PATTERN "*.h" PATTERN ".svn" EXCLUDE)
- INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/include/hydrogen/config.h" DESTINATION "${CMAKE_INSTALL_PREFIX}/include/hydrogen" )
+ INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/include/hydrogen/config.h" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/hydrogen" )
ENDIF()
diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt
index fb375e48..9cd18e6a 100644
--- a/src/gui/CMakeLists.txt
+++ b/src/gui/CMakeLists.txt
@@ -57,4 +57,4 @@ TARGET_LINK_LIBRARIES(hydrogen
qt5_use_modules(hydrogen Widgets)
ADD_DEPENDENCIES(hydrogen hydrogen-core-${VERSION})
-INSTALL(TARGETS hydrogen RUNTIME DESTINATION bin BUNDLE DESTINATION bin )
+INSTALL(TARGETS hydrogen RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR})
diff --git a/src/player/CMakeLists.txt b/src/player/CMakeLists.txt
index 72c270f3..836fc5b4 100644
--- a/src/player/CMakeLists.txt
+++ b/src/player/CMakeLists.txt
@@ -16,4 +16,4 @@ TARGET_LINK_LIBRARIES(h2player
ADD_DEPENDENCIES(h2player hydrogen-core-${VERSION})
-INSTALL(TARGETS h2player RUNTIME DESTINATION bin BUNDLE DESTINATION bin )
+INSTALL(TARGETS h2player RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR})
--
2.15.1
|