From a25ce00935276a8b2d84d1be1c33fe996d96ea39 Mon Sep 17 00:00:00 2001 From: Michael Gehring Date: Fri, 20 Jun 2008 18:49:58 +0200 Subject: [PATCH] cmake: make building manpages an option --- CMakeLists.txt | 8 +++++--- awesomeConfig.cmake | 25 +++++++++++++++++++++---- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 506539247..2facaf2ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,7 +96,7 @@ TARGET_LINK_LIBRARIES(${PROJECT_AWECLIENT_NAME} ${LIB_READLINE} ${LIB_NCURSES}) -IF(AWESOME_GENERATE_MAN) +IF(GENERATE_MANPAGES) # Create luadoc file EXECUTE_PROCESS(COMMAND ${CAT_EXECUTABLE} ${AWE_SRCS} COMMAND ${LUA_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/build-utils/gendoc.lua @@ -125,8 +125,10 @@ ENDIF() INSTALL(TARGETS ${PROJECT_AWE_NAME} ${PROJECT_AWECLIENT_NAME} RUNTIME DESTINATION bin) INSTALL(FILES ${AWE_LUA_FILES} DESTINATION ${AWESOME_REL_LUA_LIB_PATH}) INSTALL(FILES ${AWE_CONF_FILES} DESTINATION ${AWESOME_REL_CONF_PATH}) -INSTALL(FILES ${AWE_MAN1_NAME} DESTINATION ${AWESOME_MAN1_PATH}) -INSTALL(FILES ${AWE_MAN5_NAME} DESTINATION ${AWESOME_MAN5_PATH}) +IF(GENERATE_MANPAGES) + INSTALL(FILES ${AWE_MAN1_NAME} DESTINATION ${AWESOME_MAN1_PATH}) + INSTALL(FILES ${AWE_MAN5_NAME} DESTINATION ${AWESOME_MAN5_PATH}) +ENDIF() INSTALL(DIRECTORY ${AWE_ICON_DIR} DESTINATION ${AWESOME_REL_ICON_PATH}) # vim: filetype=cmake:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/awesomeConfig.cmake b/awesomeConfig.cmake index fc519c16d..c35bf3b2b 100644 --- a/awesomeConfig.cmake +++ b/awesomeConfig.cmake @@ -12,6 +12,7 @@ SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE) OPTION(WITH_DBUS "build with D-BUS" ON) OPTION(WITH_IMLIB2 "build with Imlib2" ON) +OPTION(GENERATE_MANPAGES "generate manpages" ON) ADD_DEFINITIONS(-std=gnu99 -ggdb3 -fno-strict-aliasing -Wall -Wextra -Wchar-subscripts -Wundef -Wshadow -Wcast-align -Wwrite-strings @@ -19,7 +20,7 @@ ADD_DEFINITIONS(-std=gnu99 -ggdb3 -fno-strict-aliasing -Wall -Wextra -Wpointer-arith -Wredundant-decls -Wformat-nonliteral -Wno-format-zero-length -Wmissing-format-attribute) -# {{{ external utilities +# {{{ Find external utilities FIND_PROGRAM(CAT_EXECUTABLE cat) FIND_PROGRAM(GIT_EXECUTABLE git) FIND_PROGRAM(LUA_EXECUTABLE lua) @@ -33,6 +34,25 @@ INCLUDE(FindDoxygen) INCLUDE(FindPkgConfig) # }}} +# {{{ Check if manpages can be build +IF(GENERATE_MANPAGES) + IF(NOT ASCIIDOC_EXECUTABLE OR NOT XMLTO_EXECUTABLE OR NOT GZIP_EXECUTABLE) + IF(NOT ASCIIDOC_EXECUTABLE) + SET(missing "asciidoc") + ENDIF() + IF(NOT XMLTO_EXECUTABLE) + SET(missing ${missing} " xmlto") + ENDIF() + IF(NOT GZIP_EXECUTABLE) + SET(missing ${missing} " gzip") + ENDIF() + + MESSAGE(STATUS "Not generating manpages. Missing: " ${missing}) + SET(GENERATE_MANPAGES OFF) + ENDIF() +ENDIF() +# }}} + # If this is a git repository... IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git/HEAD) # ...update version @@ -124,9 +144,6 @@ IF(NOT LUA_LIB) MESSAGE(FATAL_ERROR "lua library not found") ENDIF() -IF(ASCIIDOC_EXECUTABLE AND XMLTO_EXECUTABLE AND GZIP_EXECUTABLE) - SET(AWESOME_GENERATE_MAN TRUE) -ENDIF() # Set awesome informations and path IF(DEFINED PREFIX)