#166: added a man page

This commit is contained in:
Louis Rubet 2017-07-01 14:53:08 +02:00
parent e5c3d71424
commit baee651b00
3 changed files with 20 additions and 2 deletions

View file

@ -33,7 +33,6 @@ endif()
include_directories(${PROJECT_SOURCE_DIR}/src)
# build
add_executable(
rpn
src/main.cpp
@ -44,8 +43,17 @@ add_executable(
target_link_libraries(rpn liblinenoise.a)
target_link_libraries(rpn mpfr)
# man
add_custom_target(man ALL)
add_custom_command(
TARGET man
COMMAND gzip -f -k ${CMAKE_CURRENT_SOURCE_DIR}/rpn.1
OUTPUTS ${CMAKE_CURRENT_SOURCE_DIR}/rpn.1.gz
)
# install
install(TARGETS rpn DESTINATION bin)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/rpn.1.gz DESTINATION ${CMAKE_INSTALL_PREFIX}/man/man1)
# packages (common variables for all packages)
SET(CPACK_PACKAGE_NAME ${RPN_DISPLAY_NAME})

View file

@ -76,7 +76,7 @@ It is necessary to get MPFR and linenoise-ng to generate rpn.
```
# cd rpn/build
# make package
# sudo make package
[100%] Built target rpn
Run CPack packaging tool...
CPack: Create package using DEB

10
rpn.1 Normal file
View file

@ -0,0 +1,10 @@
.TH RPN 1
.SH NAME
rpn \- Reverse Polish Notation calculator
.SH SYNOPSIS
.B rpn
.IR commands ...
.SH DESCRIPTION
.B rpn is a full-featured math-oriented structured language inspired by Hewlett-Packard Reverse Polish Lisp
Please visit https://github.com/louisrubet/rpn for source code, a manual and generation instructions