commit 88f963b52c65d9b9d92360bddc75e4932bc6b375
parent 61d886ba1c1431b99a84aadf2ec4d29684371f72
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Wed, 3 May 2017 15:54:38 +0200
Use the build system to generate the solstice CLI man page
Diffstat:
1 file changed, 19 insertions(+), 0 deletions(-)
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
@@ -54,6 +54,13 @@ include_directories(
${Star3DUT_INCLUDE_DIR}
${CMAKE_CURRENT_BINARY_DIR})
+find_program(RONN ronn)
+if(NOT RONN)
+ message(WARNING
+ "The `ronn' program is missing. "
+ "The solstice documentation cannot be generated.")
+endif()
+
################################################################################
# Build subprojects
################################################################################
@@ -75,6 +82,18 @@ set(SOLSTICE_ARGS_DEFAULT_IMG_SPP "1")
configure_file(${SOLSTICE_SOURCE_DIR}/solstice_args.h.in
${CMAKE_CURRENT_BINARY_DIR}/solstice_args.h @ONLY)
+if(RONN)
+ configure_file(${SOLSTICE_SOURCE_DIR}/../doc/solstice.1.ronn.in
+ ${CMAKE_CURRENT_BINARY_DIR}/solstice.md @ONLY)
+ if(${CMAKE_HOST_UNIX})
+ execute_process(COMMAND ${RONN}
+ --style=man,toc ${CMAKE_CURRENT_BINARY_DIR}/solstice.md)
+ else()
+ execute_process(COMMAND ${RONN}
+ -5 --style=man,toc ${CMAKE_CURRENT_BINARY_DIR}/solstice.md)
+ endif()
+endif()
+
################################################################################
# Configure and define targets
################################################################################