aboutsummaryrefslogtreecommitdiff
path: root/development/arcan/gnu-install-dirs-3.diff
blob: 136a6eaae674d24b353095f611d4a9762475acb9 (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
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
From 2aba9cf07aaed31f4411a5cbee096a569fd07edc Mon Sep 17 00:00:00 2001
From: AndersonTorres <torres.anderson.85@protonmail.com>
Date: Mon, 23 May 2022 22:54:28 -0300
Subject: [PATCH] Cmake build system: implement GNU directory conventions

With this patch, many hardcoded paths are now substituted by GNU conventions, as
documented in the references below:

https://cmake.org/cmake/help/v3.23/module/GNUInstallDirs.html
https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
---
 src/CMakeLists.txt                      |  6 +++---
 src/a12/CMakeLists.txt                  |  6 +++---
 src/a12/net/CMakeLists.txt              |  2 +-
 src/frameserver/CMakeLists.txt          |  2 +-
 src/frameserver/avfeed/CMakeLists.txt   |  2 +-
 src/frameserver/decode/CMakeLists.txt   |  2 +-
 src/frameserver/encode/CMakeLists.txt   |  2 +-
 src/frameserver/game/CMakeLists.txt     |  2 +-
 src/frameserver/net/CMakeLists.txt      |  2 +-
 src/frameserver/remoting/CMakeLists.txt |  2 +-
 src/frameserver/terminal/CMakeLists.txt |  2 +-
 src/platform/cmake/CMakeLists.LWA       |  2 +-
 src/platform/cmake/CMakeLists.Linux     |  4 ++--
 src/shmif/CMakeLists.txt                | 10 ++++------
 src/tools/acfgfs/CMakeLists.txt         |  4 ++--
 src/tools/aclip/CMakeLists.txt          |  4 ++--
 src/tools/aloadimage/CMakeLists.txt     |  4 ++--
 src/tools/shmmon/CMakeLists.txt         |  2 +-
 src/tools/vrbridge/CMakeLists.txt       |  2 +-
 src/wayland/CMakeLists.txt              |  6 +++---
 20 files changed, 33 insertions(+), 35 deletions(-)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 8f1ff2a9..caf2faee 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -747,7 +747,7 @@ else()
 	#
 	if (VIDEO_PLATFORM STREQUAL "egl-dri")
 		amsg("${CL_YEL}egl-dri+privsep${CL_RST}\t${CL_GRN}installing SUID${CL_RST}")
-		install(TARGETS arcan DESTINATION bin
+		install(TARGETS arcan DESTINATION ${CMAKE_INSTALL_BINDIR}
 			PERMISSIONS
 				SETUID
 				OWNER_WRITE OWNER_READ OWNER_EXECUTE
@@ -755,10 +755,10 @@ else()
 				WORLD_READ WORLD_EXECUTE
 		)
 	else()
-	install(TARGETS arcan DESTINATION bin)
+	install(TARGETS arcan DESTINATION ${CMAKE_INSTALL_BINDIR})
 	endif()
 
-	install(TARGETS ${BIN_INSTALL} DESTINATION bin)
+	install(TARGETS ${BIN_INSTALL} DESTINATION ${CMAKE_INSTALL_BINDIR})
 
 	install(DIRECTORY ${CMAKE_SOURCE_DIR}/../data/appl
 		DESTINATION ${APPL_DEST}
diff --git a/src/a12/CMakeLists.txt b/src/a12/CMakeLists.txt
index 892565c6..2ede2266 100644
--- a/src/a12/CMakeLists.txt
+++ b/src/a12/CMakeLists.txt
@@ -97,8 +97,8 @@ target_link_libraries(arcan_a12 ${LIBRARIES})
 
 set(A12_LIBRARIES arcan_a12 PARENT_SCOPE)
 install(TARGETS arcan_a12
-	LIBRARY DESTINATION lib
-	ARCHIVE DESTINATION lib
+	LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+	ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
 )
-install(FILES a12.h DESTINATION include/arcan)
+install(FILES a12.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/arcan)
 add_subdirectory("net")
diff --git a/src/a12/net/CMakeLists.txt b/src/a12/net/CMakeLists.txt
index 2ba4ae9c..6f629d94 100644
--- a/src/a12/net/CMakeLists.txt
+++ b/src/a12/net/CMakeLists.txt
@@ -23,4 +23,4 @@ add_executable(arcan-net ${SOURCES})
 add_sanitizers(arcan-net)
 target_link_libraries(arcan-net PRIVATE arcan_a12 )
 target_include_directories(arcan-net PRIVATE ${INCLUDE_DIRS})
-install(TARGETS arcan-net DESTINATION bin)
+install(TARGETS arcan-net DESTINATION ${CMAKE_INSTALL_BINDIR})
diff --git a/src/frameserver/CMakeLists.txt b/src/frameserver/CMakeLists.txt
index f8d2adee..a46ba3d0 100644
--- a/src/frameserver/CMakeLists.txt
+++ b/src/frameserver/CMakeLists.txt
@@ -69,6 +69,6 @@ endforeach()
 add_executable(arcan_frameserver frameserver.c)
 add_sanitizers(arcan_frameserver)
 target_compile_definitions(arcan_frameserver PRIVATE AFSRV_CHAINLOADER)
-install(TARGETS arcan_frameserver DESTINATION bin)
+install(TARGETS arcan_frameserver DESTINATION ${CMAKE_INSTALL_BINDIR})
 amsg("${CL_YEL}frameservers\t${CL_GRN}${FRAMESERVER_MODESTRING}${CL_RST}")
 set(FRAMESERVER_MODESTRING ${FRAMESERVER_MODESTRING} PARENT_SCOPE)
diff --git a/src/frameserver/avfeed/CMakeLists.txt b/src/frameserver/avfeed/CMakeLists.txt
index 7290336d..3daf0de3 100644
--- a/src/frameserver/avfeed/CMakeLists.txt
+++ b/src/frameserver/avfeed/CMakeLists.txt
@@ -18,5 +18,5 @@ if (AVFEED_SOURCES)
 	)
 	target_include_directories(afsrv_avfeed PRIVATE ${FSRV_ROOT} ${AVFEED_INCLUDE_DIRS})
 	target_link_libraries(afsrv_avfeed ${STDLIB} arcan_shmif_int ${AVFEED_LIBS})
-	install(TARGETS afsrv_avfeed DESTINATION bin)
+	install(TARGETS afsrv_avfeed DESTINATION ${CMAKE_INSTALL_BINDIR})
 endif()
diff --git a/src/frameserver/decode/CMakeLists.txt b/src/frameserver/decode/CMakeLists.txt
index 85f0d27a..6b515ab6 100644
--- a/src/frameserver/decode/CMakeLists.txt
+++ b/src/frameserver/decode/CMakeLists.txt
@@ -22,5 +22,5 @@ if (DECODE_SOURCES)
 		add_dependencies(afsrv_decode ${DECODE_DEPS})
 	endif()
 
-	install(TARGETS afsrv_decode DESTINATION bin)
+	install(TARGETS afsrv_decode DESTINATION ${CMAKE_INSTALL_BINDIR})
 endif()
diff --git a/src/frameserver/encode/CMakeLists.txt b/src/frameserver/encode/CMakeLists.txt
index 87ca659e..c2cb9c46 100644
--- a/src/frameserver/encode/CMakeLists.txt
+++ b/src/frameserver/encode/CMakeLists.txt
@@ -18,5 +18,5 @@ if (ENCODE_SOURCES)
 	)
 	target_include_directories(afsrv_encode PRIVATE ${FSRV_ROOT} ${ENCODE_INCLUDE_DIRS})
 	target_link_libraries(afsrv_encode ${STDLIB} arcan_shmif_int ${ENCODE_LIBS})
-	install(TARGETS afsrv_encode DESTINATION bin)
+	install(TARGETS afsrv_encode DESTINATION ${CMAKE_INSTALL_BINDIR})
 endif()
diff --git a/src/frameserver/game/CMakeLists.txt b/src/frameserver/game/CMakeLists.txt
index 88d4e5d4..a10890fc 100644
--- a/src/frameserver/game/CMakeLists.txt
+++ b/src/frameserver/game/CMakeLists.txt
@@ -28,5 +28,5 @@ if (GAME_SOURCES)
 		arcan_shmif_int
 		${GAME_LIBS}
 	)
-	install(TARGETS afsrv_game DESTINATION bin)
+	install(TARGETS afsrv_game DESTINATION ${CMAKE_INSTALL_BINDIR})
 endif()
diff --git a/src/frameserver/net/CMakeLists.txt b/src/frameserver/net/CMakeLists.txt
index 93762287..ebeb0eb2 100644
--- a/src/frameserver/net/CMakeLists.txt
+++ b/src/frameserver/net/CMakeLists.txt
@@ -18,5 +18,5 @@ if (NET_SOURCES)
 	)
 	target_include_directories(afsrv_net PRIVATE ${FSRV_ROOT} ${NET_INCLUDE_DIRS})
 	target_link_libraries(afsrv_net ${STDLIB} arcan_shmif_int ${NET_LIBS})
-	install(TARGETS afsrv_net DESTINATION bin)
+	install(TARGETS afsrv_net DESTINATION ${CMAKE_INSTALL_BINDIR})
 endif()
diff --git a/src/frameserver/remoting/CMakeLists.txt b/src/frameserver/remoting/CMakeLists.txt
index ad5c0c8c..3e599d66 100644
--- a/src/frameserver/remoting/CMakeLists.txt
+++ b/src/frameserver/remoting/CMakeLists.txt
@@ -22,5 +22,5 @@ if (REMOTING_SOURCES)
 		${REMOTING_INCLUDE_DIRS}
 	)
 	target_link_libraries(afsrv_remoting ${STDLIB} arcan_shmif_int ${REMOTING_LIBS})
-	install(TARGETS afsrv_remoting DESTINATION bin)
+	install(TARGETS afsrv_remoting DESTINATION ${CMAKE_INSTALL_BINDIR})
 endif()
diff --git a/src/frameserver/terminal/CMakeLists.txt b/src/frameserver/terminal/CMakeLists.txt
index 3b5ef4a1..e979bb9c 100644
--- a/src/frameserver/terminal/CMakeLists.txt
+++ b/src/frameserver/terminal/CMakeLists.txt
@@ -24,5 +24,5 @@ if (TERMINAL_SOURCES)
 		add_dependencies(afsrv_terminal ${TERMINAL_DEPENDENCIES})
 	endif()
 
-	install(TARGETS afsrv_terminal DESTINATION bin)
+	install(TARGETS afsrv_terminal DESTINATION ${CMAKE_INSTALL_BINDIR})
 endif()
diff --git a/src/platform/cmake/CMakeLists.LWA b/src/platform/cmake/CMakeLists.LWA
index 76711fc5..e3057ddc 100644
--- a/src/platform/cmake/CMakeLists.LWA
+++ b/src/platform/cmake/CMakeLists.LWA
@@ -111,4 +111,4 @@ target_compile_definitions(arcan_lwa PRIVATE
 	ARCAN_BUILDVERSION=\"${SOURCE_TAG}-${PLATFORM_BUILDTAG}-${CMAKE_SYSTEM_NAME}\"
 )
 
-install(TARGETS arcan_lwa DESTINATION bin)
+install(TARGETS arcan_lwa DESTINATION ${CMAKE_INSTALL_BINDIR})
diff --git a/src/platform/cmake/CMakeLists.Linux b/src/platform/cmake/CMakeLists.Linux
index 9c8e6529..9be1e239 100644
--- a/src/platform/cmake/CMakeLists.Linux
+++ b/src/platform/cmake/CMakeLists.Linux
@@ -41,11 +41,11 @@ if (NOT RES_DEST)
 endif()
 
 if (NOT APIMAN_DEST)
-	set(APIMAN_DEST ${CMAKE_INSTALL_PREFIX}/share/man/man3)
+	set(APIMAN_DEST ${CMAKE_INSTALL_MANDIR}/man3)
 endif()
 
 if (NOT MAN_DEST)
-	set(MAN_DEST ${CMAKE_INSTALL_PREFIX}/share/man/man1)
+	set(MAN_DEST ${CMAKE_INSTALL_MANDIR}/man1)
 endif()
 
 set(ARCAN_PLATFORM
diff --git a/src/shmif/CMakeLists.txt b/src/shmif/CMakeLists.txt
index 06d34a21..e2cd95bb 100644
--- a/src/shmif/CMakeLists.txt
+++ b/src/shmif/CMakeLists.txt
@@ -31,8 +31,6 @@ else()
 	set(ASD ${CMAKE_CURRENT_SOURCE_DIR}/../)
 endif()
 
-set(ASHMIF_INSTPATH lib)
-
 set (TUI_HEADERS
 	${ASD}/shmif/arcan_tui.h
 	${ASD}/shmif/arcan_tuidefs.h
@@ -273,9 +271,9 @@ target_include_directories(arcan_shmif_server PRIVATE ${ASD}/shmif)
 
 if (NOT ARCAN_SOURCE_DIR)
 	install(TARGETS ${TARGET_LIST}
-		LIBRARY DESTINATION ${ASHMIF_INSTPATH}
-		ARCHIVE DESTINATION ${ASHMIF_INSTPATH}
+		LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+		ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
 	)
-	install(FILES ${SHMIF_HEADERS} DESTINATION include/arcan/shmif)
-	install(FILES ${TUI_HEADERS} DESTINATION include/arcan)
+	install(FILES ${SHMIF_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/arcan/shmif)
+	install(FILES ${TUI_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/arcan)
 endif()
diff --git a/src/tools/acfgfs/CMakeLists.txt b/src/tools/acfgfs/CMakeLists.txt
index 8a42f53c..8ca13dfd 100644
--- a/src/tools/acfgfs/CMakeLists.txt
+++ b/src/tools/acfgfs/CMakeLists.txt
@@ -38,11 +38,11 @@ set(SOURCES
 
 add_executable(${PROJECT_NAME} ${SOURCES})
 target_link_libraries(${PROJECT_NAME} ${LIBRARIES})
-install(TARGETS ${PROJECT_NAME} DESTINATION bin)
+install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
 target_include_directories(${PROJECT_NAME} PUBLIC ${ARCAN_SHMIF_INCLUDE_DIR} ${FUSE3_INCLUDE_DIRS})
 
 if (CMAKE_SYSTEM_NAME MATCHES "(DragonFly|FreeBSD|NetBSD|OpenBSD)")
 install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/arcan_cfgfs.1 DESTINATION man/man1)
 else()
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/arcan_cfgfs.1 DESTINATION share/man/man1)
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/arcan_cfgfs.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
 endif()
diff --git a/src/tools/aclip/CMakeLists.txt b/src/tools/aclip/CMakeLists.txt
index 7ef47c58..436548bb 100644
--- a/src/tools/aclip/CMakeLists.txt
+++ b/src/tools/aclip/CMakeLists.txt
@@ -42,10 +42,10 @@ set(SOURCES
 
 add_executable(${PROJECT_NAME} ${SOURCES})
 target_link_libraries(${PROJECT_NAME} ${LIBRARIES})
-install(TARGETS ${PROJECT_NAME} DESTINATION bin)
+install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
 
 if (CMAKE_SYSTEM_NAME MATCHES "(DragonFly|FreeBSD|NetBSD|OpenBSD)")
 install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/aclip.1 DESTINATION man/man1)
 else()
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/aclip.1 DESTINATION share/man/man1)
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/aclip.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
 endif()
diff --git a/src/tools/aloadimage/CMakeLists.txt b/src/tools/aloadimage/CMakeLists.txt
index 0d948b6c..326c3fc8 100644
--- a/src/tools/aloadimage/CMakeLists.txt
+++ b/src/tools/aloadimage/CMakeLists.txt
@@ -64,11 +64,11 @@ SET(SOURCES
 
 add_executable(${PROJECT_NAME} ${SOURCES})
 target_link_libraries(${PROJECT_NAME} ${LIBRARIES})
-install(TARGETS ${PROJECT_NAME} DESTINATION bin)
+install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
 add_sanitizers(${PROJECT_NAME})
 
 if (CMAKE_SYSTEM_NAME MATCHES "(DragonFly|FreeBSD|NetBSD|OpenBSD)")
 install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/aloadimage.1 DESTINATION man/man1)
 else()
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/aloadimage.1 DESTINATION share/man/man1)
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/aloadimage.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
 endif()
diff --git a/src/tools/shmmon/CMakeLists.txt b/src/tools/shmmon/CMakeLists.txt
index 736a0fa4..46758db9 100644
--- a/src/tools/shmmon/CMakeLists.txt
+++ b/src/tools/shmmon/CMakeLists.txt
@@ -44,4 +44,4 @@ set(SOURCES
 
 add_executable(${PROJECT_NAME} ${SOURCES})
 target_link_libraries(${PROJECT_NAME} ${LIBRARIES})
-install(TARGETS ${PROJECT_NAME} DESTINATION bin)
+install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
diff --git a/src/tools/vrbridge/CMakeLists.txt b/src/tools/vrbridge/CMakeLists.txt
index 28488290..fc8eb0f8 100644
--- a/src/tools/vrbridge/CMakeLists.txt
+++ b/src/tools/vrbridge/CMakeLists.txt
@@ -111,4 +111,4 @@ endif()
 
 target_link_libraries(${PROJECT_NAME} ${LIBRARIES})
 
-install(TARGETS ${PROJECT_NAME} DESTINATION bin)
+install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
diff --git a/src/wayland/CMakeLists.txt b/src/wayland/CMakeLists.txt
index 1d6b8cc3..4cd44922 100644
--- a/src/wayland/CMakeLists.txt
+++ b/src/wayland/CMakeLists.txt
@@ -96,11 +96,11 @@ target_include_directories(arcan-wayland PRIVATE ${WAYBRIDGE_INCLUDES})
 target_include_directories(arcan_xwm PRIVATE ${WAYBRIDGE_INCLUDES})
 
 add_sanitizers(arcan-wayland)
-install(TARGETS arcan-wayland DESTINATION bin)
-install(TARGETS arcan_xwm DESTINATION bin)
+install(TARGETS arcan-wayland DESTINATION ${CMAKE_INSTALL_BINDIR})
+install(TARGETS arcan_xwm DESTINATION ${CMAKE_INSTALL_BINDIR})
 
 if (CMAKE_SYSTEM_NAME MATCHES "(DragonFly|FreeBSD|NetBSD|OpenBSD)")
 install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/arcan-wayland.1 DESTINATION man/man1)
 else()
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/arcan-wayland.1 DESTINATION share/man/man1)
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/arcan-wayland.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
 endif()#install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/arcan-wayland.1 DESTINATION man)
-- 
2.35.3