build: make manpage compression optional
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
531381fa6d
commit
a4fb1e00f7
|
@ -189,18 +189,27 @@ if(GENERATE_MANPAGES)
|
||||||
OUTPUT ${manfile}
|
OUTPUT ${manfile}
|
||||||
WORKING_DIRECTORY ${BUILD_DIR}/manpages
|
WORKING_DIRECTORY ${BUILD_DIR}/manpages
|
||||||
DEPENDS ${xmlfile})
|
DEPENDS ${xmlfile})
|
||||||
add_custom_command(
|
|
||||||
COMMAND ${GZIP_EXECUTABLE} < ${manfile} > ${gzfile}
|
|
||||||
OUTPUT ${gzfile}
|
|
||||||
WORKING_DIRECTORY ${BUILD_DIR}/manpages
|
|
||||||
DEPENDS ${manfile}
|
|
||||||
VERBATIM)
|
|
||||||
|
|
||||||
set(MAN_FILES ${MAN_FILES} ${gzfile})
|
if(COMPRESS_MANPAGES)
|
||||||
|
add_custom_command(
|
||||||
|
COMMAND ${GZIP_EXECUTABLE} < ${manfile} > ${gzfile}
|
||||||
|
OUTPUT ${gzfile}
|
||||||
|
WORKING_DIRECTORY ${BUILD_DIR}/manpages
|
||||||
|
DEPENDS ${manfile}
|
||||||
|
VERBATIM)
|
||||||
|
|
||||||
|
set(MAN_FILES ${MAN_FILES} ${gzfile})
|
||||||
|
else()
|
||||||
|
set(MAN_FILES ${MAN_FILES} ${manfile})
|
||||||
|
endif()
|
||||||
|
|
||||||
# figure out in what section to install to from filename
|
# figure out in what section to install to from filename
|
||||||
string(REGEX REPLACE "^.*\\.([0-9])\\.gz\$" "\\1" section ${gzfile})
|
string(REGEX REPLACE "^.*\\.([0-9])\\.gz\$" "\\1" section ${gzfile})
|
||||||
set(AWE_MAN${section}_FILES ${AWE_MAN${section}_FILES} ${gzfile})
|
if(COMPRESS_MANPAGES)
|
||||||
|
set(AWE_MAN${section}_FILES ${AWE_MAN${section}_FILES} ${gzfile})
|
||||||
|
else()
|
||||||
|
set(AWE_MAN${section}_FILES ${AWE_MAN${section}_FILES} ${manfile})
|
||||||
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
add_custom_target(man ALL DEPENDS ${MAN_FILES})
|
add_custom_target(man ALL DEPENDS ${MAN_FILES})
|
||||||
|
|
|
@ -12,6 +12,7 @@ set(CMAKE_BUILD_TYPE RELEASE)
|
||||||
|
|
||||||
option(WITH_DBUS "build with D-BUS" ON)
|
option(WITH_DBUS "build with D-BUS" ON)
|
||||||
option(GENERATE_MANPAGES "generate manpages" ON)
|
option(GENERATE_MANPAGES "generate manpages" ON)
|
||||||
|
option(COMPRESS_MANPAGES "generate manpages" ON)
|
||||||
option(GENERATE_LUADOC "generate luadoc" ON)
|
option(GENERATE_LUADOC "generate luadoc" ON)
|
||||||
|
|
||||||
link_directories(/usr/local/lib)
|
link_directories(/usr/local/lib)
|
||||||
|
@ -69,14 +70,14 @@ include(FindLua51) #Due to a cmake bug, you will see Lua50 on screen
|
||||||
|
|
||||||
# {{{ Check if documentation can be build
|
# {{{ Check if documentation can be build
|
||||||
if(GENERATE_MANPAGES)
|
if(GENERATE_MANPAGES)
|
||||||
if(NOT ASCIIDOC_EXECUTABLE OR NOT XMLTO_EXECUTABLE OR NOT GZIP_EXECUTABLE)
|
if(NOT ASCIIDOC_EXECUTABLE OR NOT XMLTO_EXECUTABLE OR (COMPRESS_MANPAGES AND NOT GZIP_EXECUTABLE))
|
||||||
if(NOT ASCIIDOC_EXECUTABLE)
|
if(NOT ASCIIDOC_EXECUTABLE)
|
||||||
SET(missing "asciidoc")
|
SET(missing "asciidoc")
|
||||||
endif()
|
endif()
|
||||||
if(NOT XMLTO_EXECUTABLE)
|
if(NOT XMLTO_EXECUTABLE)
|
||||||
SET(missing ${missing} " xmlto")
|
SET(missing ${missing} " xmlto")
|
||||||
endif()
|
endif()
|
||||||
if(NOT GZIP_EXECUTABLE)
|
if(COMPRESS_MANPAGES AND NOT GZIP_EXECUTABLE)
|
||||||
SET(missing ${missing} " gzip")
|
SET(missing ${missing} " gzip")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue