[client,x11] fail build on manpage generation

if manpages should be build but dependencies are missing fail the build
This commit is contained in:
Armin Novak 2023-02-22 07:23:38 +01:00 committed by akallabeth
parent 078162616d
commit 64efb7ecfd
1 changed files with 43 additions and 45 deletions

View File

@ -84,52 +84,50 @@ set(${MODULE_PREFIX}_LIBS
${X11_LIBRARIES})
if(WITH_MANPAGES)
find_program(XSLTPROC_EXECUTABLE NAMES xsltproc)
if(DOCBOOKXSL_FOUND AND XSLTPROC_EXECUTABLE)
# We need the variable ${MAN_TODAY} to contain the current date in ISO
# format to replace it in the configure_file step.
include(today)
TODAY(MAN_TODAY)
configure_file(xfreerdp.1.xml.in xfreerdp.1.xml @ONLY IMMEDIATE)
# Compile the helper tool with default compiler settings.
# We need the include paths though.
get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
set(GENERATE_INCLUDES "")
foreach(dir ${dirs})
set(GENERATE_INCLUDES ${GENERATE_INCLUDES} -I${dir})
endforeach(dir)
add_custom_command(OUTPUT xfreerdp.1
COMMAND ${CMAKE_C_COMPILER} ${GENERATE_INCLUDES}
${CMAKE_CURRENT_SOURCE_DIR}/generate_argument_docbook.c
-o ${CMAKE_CURRENT_BINARY_DIR}/generate_argument_docbook
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/generate_argument_docbook
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/xfreerdp-channels.1.xml ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/xfreerdp-examples.1.xml ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/xfreerdp-envvar.1.xml ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${XSLTPROC_EXECUTABLE} ${DOCBOOKXSL_DIR}/manpages/docbook.xsl xfreerdp.1.xml
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/xfreerdp.1.xml
${CMAKE_CURRENT_SOURCE_DIR}/xfreerdp-examples.1.xml
${CMAKE_CURRENT_SOURCE_DIR}/xfreerdp-channels.1.xml
${CMAKE_CURRENT_SOURCE_DIR}/xfreerdp-envvar.1.xml)
add_custom_target(xfreerdp.manpage ALL
DEPENDS xfreerdp.1)
install_freerdp_man(${CMAKE_CURRENT_BINARY_DIR}/xfreerdp.1 1)
else()
message(WARNING "WITH_MANPAGES was set, but xsltproc was not found. man-pages will not be installed")
find_program(XSLTPROC_EXECUTABLE NAMES xsltproc REQUIRED)
if (NOT DOCBOOKXSL_FOUND)
message(FATAL_ERROR "docbook xsl not found but required for manpage generation")
endif()
# We need the variable ${MAN_TODAY} to contain the current date in ISO
# format to replace it in the configure_file step.
include(today)
TODAY(MAN_TODAY)
configure_file(xfreerdp.1.xml.in xfreerdp.1.xml @ONLY IMMEDIATE)
# Compile the helper tool with default compiler settings.
# We need the include paths though.
get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
set(GENERATE_INCLUDES "")
foreach(dir ${dirs})
set(GENERATE_INCLUDES ${GENERATE_INCLUDES} -I${dir})
endforeach(dir)
add_custom_command(OUTPUT xfreerdp.1
COMMAND ${CMAKE_C_COMPILER} ${GENERATE_INCLUDES}
${CMAKE_CURRENT_SOURCE_DIR}/generate_argument_docbook.c
-o ${CMAKE_CURRENT_BINARY_DIR}/generate_argument_docbook
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/generate_argument_docbook
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/xfreerdp-channels.1.xml ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/xfreerdp-examples.1.xml ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/xfreerdp-envvar.1.xml ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${XSLTPROC_EXECUTABLE} ${DOCBOOKXSL_DIR}/manpages/docbook.xsl xfreerdp.1.xml
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/xfreerdp.1.xml
${CMAKE_CURRENT_SOURCE_DIR}/xfreerdp-examples.1.xml
${CMAKE_CURRENT_SOURCE_DIR}/xfreerdp-channels.1.xml
${CMAKE_CURRENT_SOURCE_DIR}/xfreerdp-envvar.1.xml)
add_custom_target(xfreerdp.manpage ALL
DEPENDS xfreerdp.1)
install_freerdp_man(${CMAKE_CURRENT_BINARY_DIR}/xfreerdp.1 1)
endif(WITH_MANPAGES)
set(XSHM_FEATURE_TYPE "REQUIRED")