summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2017-04-12 13:10:17 +0000
committerdimitri staessens <dimitri.staessens@ugent.be>2017-04-12 13:10:17 +0000
commitbbe2b2be8814c1c2bcc318e47715f7224b47cc5a (patch)
tree47078ceb35af29665fea130fdee589a114dad934
parentcc0816154b756b870264272315fe5a6f1ed06efe (diff)
parent74fe5f5ebbcd9a174ad8c597e4c8d1d211c7f0a5 (diff)
downloadouroboros-bbe2b2be8814c1c2bcc318e47715f7224b47cc5a.tar.gz
ouroboros-bbe2b2be8814c1c2bcc318e47715f7224b47cc5a.zip
Merged in sandervrijders/ouroboros/be-man-install (pull request #477)
build: Install manpages
-rw-r--r--CMakeLists.txt1
-rw-r--r--doc/CMakeLists.txt1
-rw-r--r--doc/man/CMakeLists.txt40
3 files changed, 42 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e6c33c16..3c7266eb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -83,6 +83,7 @@ include_directories(${PROTOBUF_C_INCLUDE_DIRS})
add_subdirectory(src)
add_subdirectory(include)
+add_subdirectory(doc)
# Uninstall target
configure_file(
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
new file mode 100644
index 00000000..5cf30050
--- /dev/null
+++ b/doc/CMakeLists.txt
@@ -0,0 +1 @@
+add_subdirectory(man)
diff --git a/doc/man/CMakeLists.txt b/doc/man/CMakeLists.txt
new file mode 100644
index 00000000..c864d756
--- /dev/null
+++ b/doc/man/CMakeLists.txt
@@ -0,0 +1,40 @@
+set(MAN_NAMES
+ # Add man page sources here
+ ap_init.3
+ ap_fini.3
+ flow_accept.3
+ flow_alloc.3
+ flow_dealloc.3
+ flow_read.3
+ flow_write.3
+ )
+
+macro(INSTALL_MAN __mans)
+ foreach (_man ${ARGV})
+ string(REGEX REPLACE "^.+[.]([1-9]).gz" "\\1" _mansect ${_man})
+ install(FILES ${_man} DESTINATION "usr/share/man/man${_mansect}")
+ endforeach (_man)
+endmacro(INSTALL_MAN __mans)
+
+find_program(GZIP_EXECUTABLE
+ NAMES gzip
+ DOC "Will gzip the man pages")
+
+if (GZIP_EXECUTABLE)
+ foreach (m ${MAN_NAMES})
+ set(md ${CMAKE_CURRENT_BINARY_DIR}/${m}.gz)
+
+ add_custom_command(
+ OUTPUT ${md}
+ COMMAND ${GZIP_EXECUTABLE}
+ ARGS -c ${CMAKE_CURRENT_SOURCE_DIR}/${m} > ${md}
+ COMMENT "Compressing manpage ${m}"
+ VERBATIM)
+
+ set(MAN_FILES ${MAN_FILES} ${md})
+ endforeach ()
+
+ add_custom_target(man ALL DEPENDS ${MAN_FILES})
+
+ INSTALL_MAN(${MAN_FILES})
+endif ()