aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt16
-rwxr-xr-xbuild.sh2
2 files changed, 16 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ed6782c..e90bbd9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -47,6 +47,13 @@ if (NOT XMLTO_EXEC)
return()
endif()
+find_program(COMPRESS_EXEC NAMES gzip)
+if (NOT COMPRESS_EXEC)
+ message(WARNING "Can't find gzip, skip manpage generation")
+ return()
+endif()
+
+
set(MANPAGE dir_monitor.1)
set(ASCIIDOC_GENMAN ${ASCIIDOC_EXEC} -b docbook -d manpage)
@@ -64,6 +71,13 @@ add_custom_command(
COMMENT "Create man page from DocBook XML ${MANPAGE}.xml ..."
)
-add_custom_target(man ALL
+add_custom_command(
+ OUTPUT ${MANPAGE}.gz
+ COMMAND ${COMPRESS_EXEC} -9 ${MANPAGE}
DEPENDS ${MANPAGE}
+ COMMENT "Compressing the manpage via gzip..."
+)
+
+add_custom_target(man ALL
+ DEPENDS ${MANPAGE}.gz
)
diff --git a/build.sh b/build.sh
index 1007ea2..e1c1208 100755
--- a/build.sh
+++ b/build.sh
@@ -4,5 +4,5 @@ BDIR="/dev/shm/${PWD##*/}_cmakebuild/"
mkdir -p bin
cmake -S . -B "${BDIR}" && ( cd "${BDIR}" ; make) && \
find "${BDIR}" -maxdepth 1 -perm /u=x,g=x,o=x -type f -exec cp "{}" bin/ \; && \
- cp -v "${BDIR}${PWD##*/}.1" man/
+ cp -v "${BDIR}${PWD##*/}.1.gz" man/