From c3272d19a30d90c217e09f30b44d4b611ad8d4a5 Mon Sep 17 00:00:00 2001 From: Michael Gehring Date: Mon, 23 Jun 2008 16:29:51 +0200 Subject: [PATCH] cmake: build/install luadoc for awful and tabulous --- CMakeLists.txt | 21 +++++++++++++++++++-- awesomeConfig.cmake | 4 +++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 14742399..c6eca49e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -213,8 +213,6 @@ if(GENERATE_MANPAGES) DEPENDS ${LUA_APIDOC_SRCS} COMMENT "Generating Lua API documentation." VERBATIM) - - add_custom_target(luadoc DEPENDS ${LUADOC_FILE}) # }}} foreach(txtfile ${AWE_MAN_SRCS}) @@ -264,6 +262,22 @@ if(DOXYGEN_EXECUTABLE) endif() # }}} +# {{{ Lua API Documentation +if(LUADOC_EXECUTABLE) + # dont include full path names in documentation + set(luadoc_srcs "") + foreach(file ${AWE_LUA_FILES}) + string(REPLACE ${SOURCE_DIR}/ "" file ${file}) + set(luadoc_srcs ${luadoc_srcs} ${file}) + endforeach() + + add_custom_target(luadoc ALL + COMMAND ${LUADOC_EXECUTABLE} ${luadoc_srcs} -d ${BUILD_DIR}/luadoc + WORKING_DIRECTORY ${SOURCE_DIR} + DEPENDS ${AWE_LUA_FILES}) +endif() +# }}} + # {{{ Installation. install(TARGETS ${PROJECT_AWE_NAME} ${PROJECT_AWECLIENT_NAME} RUNTIME DESTINATION bin) install(FILES ${AWE_LUA_FILES} DESTINATION ${AWESOME_REL_LUA_LIB_PATH}) @@ -274,6 +288,9 @@ if(GENERATE_MANPAGES) endif() install(DIRECTORY ${AWE_ICON_DIR} DESTINATION ${AWESOME_REL_ICON_PATH}) install(FILES ${AWE_DOC_FILES} DESTINATION ${AWESOME_REL_DOC_PATH}) +if(LUADOC_EXECUTABLE) + install(DIRECTORY ${BUILD_DIR}/luadoc DESTINATION ${AWESOME_REL_DOC_PATH}) +endif() # }}} # vim: filetype=cmake:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/awesomeConfig.cmake b/awesomeConfig.cmake index 0215a5da..ef93b2e0 100644 --- a/awesomeConfig.cmake +++ b/awesomeConfig.cmake @@ -28,12 +28,14 @@ add_definitions(-std=gnu99 -ggdb3 -fno-strict-aliasing -Wall -Wextra find_program(CAT_EXECUTABLE cat) find_program(GREP_EXECUTABLE grep) find_program(GIT_EXECUTABLE git) -find_program(LUA_EXECUTABLE lua) find_program(GPERF_EXECUTABLE gperf) # programs needed for man pages find_program(ASCIIDOC_EXECUTABLE asciidoc) find_program(XMLTO_EXECUTABLE xmlto) find_program(GZIP_EXECUTABLE gzip) +# lua documentation +find_program(LUA_EXECUTABLE lua) +find_program(LUADOC_EXECUTABLE luadoc) # doxygen include(FindDoxygen) # pkg-config