Changeset View
Changeset View
Standalone View
Standalone View
files/manpages-instead-of-html-pages.patch
- This file was added.
| --- a/CMakeLists.txt | |||||
| +++ b/CMakeLists.txt | |||||
| @@ -35,6 +35,7 @@ find_package(PkgConfig) | |||||
| set(sources) | |||||
| set(cxx-sources) | |||||
| set(html-docs) | |||||
| +set(man-pages) | |||||
| set(target_outputs) | |||||
| option(ENABLE_ASAN "Build with address sanitizer" OFF) | |||||
| @@ -1266,6 +1267,33 @@ if(WITH_DOCS) | |||||
| endforeach() | |||||
| endif() | |||||
| +option(WITH_MAN "Build man pages" ON) | |||||
| +if(WITH_MAN) | |||||
| + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/man/man3 ${CMAKE_CURRENT_BINARY_DIR}/man/man7) | |||||
| + file( | |||||
| + GLOB docs | |||||
| + RELATIVE ${CMAKE_CURRENT_BINARY_DIR}/ | |||||
| + "${CMAKE_CURRENT_SOURCE_DIR}/doc/*.txt") | |||||
| + set(man-docs) | |||||
| + foreach(txt ${docs}) | |||||
| + file(READ "${CMAKE_CURRENT_BINARY_DIR}/${txt}" head LIMIT 40) | |||||
| + string(REGEX MATCH "\\(.*\\)" section ${head}) | |||||
| + string(REGEX REPLACE "\\((.*)\\)" "\\1" section ${section}) | |||||
| + string(REGEX REPLACE ".*/(.*)\\.txt" "\\1" man ${txt}) | |||||
| + set(src ${txt}) | |||||
| + set(dst man) | |||||
| + if(WITH_MAN) | |||||
| + add_custom_command( | |||||
| + OUTPUT ${dst}/man${section}/${man}.${section} | |||||
| + COMMAND ${A2X_EXECUTABLE} -f manpage -azmq_version=${ZMQ_VERSION} -D ${CMAKE_CURRENT_BINARY_DIR}/${dst}/man${section} ${src} | |||||
| + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${src} | |||||
| + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | |||||
| + COMMENT "Generating ${man}.${section}") | |||||
| + list(APPEND man-pages ${CMAKE_CURRENT_BINARY_DIR}/${dst}/man${section}/${man}.${section}) | |||||
| + endif() | |||||
| + endforeach() | |||||
| +endif() | |||||
| + | |||||
| if(ZMQ_BUILD_FRAMEWORK) | |||||
| add_custom_command( | |||||
| TARGET libzmq | |||||
| @@ -1662,6 +1690,16 @@ if(WITH_DOC) | |||||
| COMPONENT RefGuide) | |||||
| endif() | |||||
| endif() | |||||
| + | |||||
| +if(WITH_MAN) | |||||
| + if(NOT ZMQ_BUILD_FRAMEWORK) | |||||
| + add_custom_target(manpages ALL DEPENDS ${man-pages}) | |||||
| + install( | |||||
| + DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/man/man3 ${CMAKE_CURRENT_BINARY_DIR}/man/man7 | |||||
| + TYPE MAN | |||||
| + COMPONENT RefGuide) | |||||
| + endif() | |||||
| +endif() | |||||
| if(WIN32) | |||||
| set(ZEROMQ_CMAKECONFIG_INSTALL_DIR | |||||
Copyright © 2015-2021 Solus Project. The Solus logo is Copyright © 2016-2021 Solus Project. All Rights Reserved.