Fix man page building to not absolutely require xsltproc when using CMake.

This now handles the case where we are building from the released tar, or
building from git if xsltproc is available, or building from git if xsltproc
is not available.
pull/2092/head
Roger A. Light 5 years ago
parent 05292cdbef
commit 217b416a2d

@ -1,6 +1,12 @@
Broker: Broker:
- Fix exporting of executable symbols on BSD when building via makefile. - Fix exporting of executable symbols on BSD when building via makefile.
Build:
- Fix man page building to not absolutely require xsltproc when using CMake.
This now handles the case where we are building from the released tar, or
building from git if xsltproc is available, or building from git if xsltproc
is not available.
2.0.6 - 2021-01-28 2.0.6 - 2021-01-28
================== ==================

@ -1,9 +1,12 @@
if(NOT WIN32) # If we are building from a release tarball, the man pages should already be built, so them.
find_program(XSLTPROC xsltproc REQUIRED) # If we are building from git, then the man pages will not be built. In this
if(NOT XSLTPROC) # case, attempt to find xsltproc, and if found build the man pages. If xsltproc
message(FATAL_ERROR "xsltproc not found: manpages cannot be built") # could not be found, then the man pages will not be built or installed -
endif() # because the install is optional.
if(NOT WIN32)
find_program(XSLTPROC xsltproc OPTIONAL)
if(XSLTPROC)
function(compile_manpage page) function(compile_manpage page)
add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/man/${page} add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/man/${page}
COMMAND xsltproc ${CMAKE_SOURCE_DIR}/man/${page}.xml -o ${CMAKE_SOURCE_DIR}/man/ COMMAND xsltproc ${CMAKE_SOURCE_DIR}/man/${page}.xml -o ${CMAKE_SOURCE_DIR}/man/
@ -22,10 +25,23 @@ if(NOT WIN32)
compile_manpage("mosquitto-tls.7") compile_manpage("mosquitto-tls.7")
compile_manpage("mqtt.7") compile_manpage("mqtt.7")
compile_manpage("mosquitto.8") compile_manpage("mosquitto.8")
else()
message(FATAL_ERROR "xsltproc not found: manpages cannot be built")
endif()
endif() endif()
install(FILES mosquitto_ctrl.1 mosquitto_ctrl_dynsec.1 mosquitto_passwd.1 mosquitto_pub.1 mosquitto_sub.1 mosquitto_rr.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) install(FILES
install(FILES libmosquitto.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3) mosquitto_ctrl.1
install(FILES mosquitto.conf.5 DESTINATION ${CMAKE_INSTALL_MANDIR}/man5) mosquitto_ctrl_dynsec.1
install(FILES mosquitto-tls.7 mqtt.7 DESTINATION ${CMAKE_INSTALL_MANDIR}/man7) mosquitto_passwd.1
install(FILES mosquitto.8 DESTINATION ${CMAKE_INSTALL_MANDIR}/man8) mosquitto_pub.1
mosquitto_sub.1
mosquitto_rr.1
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
OPTIONAL)
install(FILES libmosquitto.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3 OPTIONAL)
install(FILES mosquitto.conf.5 DESTINATION ${CMAKE_INSTALL_MANDIR}/man5 OPTIONAL)
install(FILES mosquitto-tls.7 mqtt.7 DESTINATION ${CMAKE_INSTALL_MANDIR}/man7 OPTIONAL)
install(FILES mosquitto.8 DESTINATION ${CMAKE_INSTALL_MANDIR}/man8 OPTIONAL)

Loading…
Cancel
Save