From 7bfcc5c480172019d5e3896e89aac70c58b46598 Mon Sep 17 00:00:00 2001 From: Ronald Tse Date: Sat, 10 Apr 2021 11:44:51 +0800 Subject: [PATCH] Use CMake to generate version numbers in man pages --- cmake/Modules/AdocMan.cmake | 4 ++-- src/lib/CMakeLists.txt | 2 +- src/lib/librnp.3.adoc | 2 +- src/rnp/CMakeLists.txt | 2 +- src/rnp/rnp.1.adoc | 2 +- src/rnpkeys/CMakeLists.txt | 2 +- src/rnpkeys/rnpkeys.1.adoc | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cmake/Modules/AdocMan.cmake b/cmake/Modules/AdocMan.cmake index 6c0f0245a..d63b7a743 100644 --- a/cmake/Modules/AdocMan.cmake +++ b/cmake/Modules/AdocMan.cmake @@ -49,7 +49,7 @@ else() set(ADOCCOMMAND_FOUND 1) endif() -function(add_adoc_man SRC) +function(add_adoc_man SRC COMPONENT_VERSION) if (NOT ${ADOCCOMMAND_FOUND}) return() endif() @@ -113,7 +113,7 @@ function(add_adoc_man SRC) add_custom_command( OUTPUT ${DST} - COMMAND ${ADOCCOMMAND_PATH} -b manpage ${SRC} -o ${DST} + COMMAND ${ADOCCOMMAND_PATH} -b manpage ${SRC} -o ${DST} -a component-version=${COMPONENT_VERSION} DEPENDS ${SRC} WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMENT "Generating man page ${SUBDIR_PATH_DIRECTORY}/${SUBDIR_PATH_NAME_WLE}" diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index 41968b19c..25e06545d 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -347,4 +347,4 @@ if (PKG_CONFIG_FOUND) endif() # Build and install man page -add_adoc_man("${CMAKE_CURRENT_SOURCE_DIR}/librnp.3.adoc") +add_adoc_man("${CMAKE_CURRENT_SOURCE_DIR}/librnp.3.adoc" ${RNP_VERSION}) diff --git a/src/lib/librnp.3.adoc b/src/lib/librnp.3.adoc index 77a199a32..9af84ab9f 100644 --- a/src/lib/librnp.3.adoc +++ b/src/lib/librnp.3.adoc @@ -1,7 +1,7 @@ = librnp(3) RNP :doctype: manpage -:release-version: 0.15.0 +:release-version: {component-version} :man manual: RNP Manual :man source: RNP {release-version} diff --git a/src/rnp/CMakeLists.txt b/src/rnp/CMakeLists.txt index 374c4ca07..d495b3e3a 100644 --- a/src/rnp/CMakeLists.txt +++ b/src/rnp/CMakeLists.txt @@ -99,4 +99,4 @@ install(TARGETS rnp ) # Build and install man page -add_adoc_man("${CMAKE_CURRENT_SOURCE_DIR}/rnp.1.adoc") +add_adoc_man("${CMAKE_CURRENT_SOURCE_DIR}/rnp.1.adoc" ${RNP_VERSION}) diff --git a/src/rnp/rnp.1.adoc b/src/rnp/rnp.1.adoc index 32a016fef..6032a559c 100644 --- a/src/rnp/rnp.1.adoc +++ b/src/rnp/rnp.1.adoc @@ -1,7 +1,7 @@ = rnp(1) RNP :doctype: manpage -:release-version: 0.15.0 +:release-version: {component-version} :man manual: RNP Manual :man source: RNP {release-version} diff --git a/src/rnpkeys/CMakeLists.txt b/src/rnpkeys/CMakeLists.txt index c7d0965c9..0ed13ea30 100644 --- a/src/rnpkeys/CMakeLists.txt +++ b/src/rnpkeys/CMakeLists.txt @@ -100,4 +100,4 @@ install(TARGETS rnpkeys ) # Build and install man page -add_adoc_man("${CMAKE_CURRENT_SOURCE_DIR}/rnpkeys.1.adoc") +add_adoc_man("${CMAKE_CURRENT_SOURCE_DIR}/rnpkeys.1.adoc" ${RNP_VERSION}) diff --git a/src/rnpkeys/rnpkeys.1.adoc b/src/rnpkeys/rnpkeys.1.adoc index ceee1e95d..d8ce760f8 100644 --- a/src/rnpkeys/rnpkeys.1.adoc +++ b/src/rnpkeys/rnpkeys.1.adoc @@ -1,7 +1,7 @@ = rnpkeys(1) RNP :doctype: manpage -:release-version: 0.15.0 +:release-version: {component-version} :man manual: RNP Manual :man source: RNP {release-version}