Consider providing man pages
hosiet opened this issue · 1 comments
hosiet commented
Man page is not a "must-have" for this project but it doesn't do any harm too. Please consider installing it into UNIX-like systems when doing "make install".
(Also consider installing icons into /usr/share/icons/
please.)
Proposed example man page (danmaQ.1
):
.\" Hey, EMACS: -*- nroff -*-
.\" (C) Copyright 2017 Boyuan Yang <073plan@gmail.com>,
.\"
.TH DANMAQ 1 "2017-10-17" "Tsinghua TUNA Association"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh disable hyphenation
.\" .hy enable hyphenation
.\" .ad l left justify
.\" .ad b justify to both left and right margins
.\" .nf disable filling
.\" .fi enable filling
.\" .br insert line break
.\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.SH NAME
danmaQ \- desktop danmaku client implemented in Qt5
.SH SYNOPSIS
.B danmaQ
.SH DESCRIPTION
This manual page documents briefly the
.B danmaQ
commands.
.PP
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
.\" respectively.
\fBdanmaQ\fP is a program that act as the danmaku client. When connected
with a server, it receives danmaku from the server and displays them
on the screen running \fBdanmaQ\fP.
.SH OPTIONS
This program does not accept any command line option now.
.SH BUGS
It is known that current program does not function well when network status
changes. In such case, please restart the program or select
"Toggle subscription" menu twice from its tray icon.
.SH SEE ALSO
.BR gdanmaku-server (1).
I'm not familiar with CMake thus not providing patch for CMakeLists.txt here.
jiegec commented
Place danmaQ.1 under ./man .
Patch for CMakeLists.txt:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0588378..3db293c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,6 +18,15 @@ if (UNIX)
set(CMAKE_CXX_FLAGS "-Wall --std=c++11 ${CMAKE_CXX_FLAGS}")
endif ()
+set(MAN_FILES ${CMAKE_CURRENT_BINARY_DIR}/danmaQ.1)
+add_custom_command(
+ COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/man/danmaQ.1 ${CMAKE_CURRENT_BINARY_DIR}/danmaQ.1
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/man/danmaQ.1
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/danmaQ.1
+)
+
+add_custom_target(man ALL DEPENDS ${MAN_FILES})
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/danmaQ.1 DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1)
add_subdirectory(src)