From c87e775e4680b7f75233e97862cfe2717cab36a2 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Mon, 19 Nov 2012 14:57:47 +0100 Subject: [PATCH] Use LDoc instead of Luadoc (FS#1006) Since we are no longer using module(), luadoc no longer understands our modules. With this commit we use LDoc instead which seems more modern. Signed-off-by: Uli Schlachter --- CMakeLists.txt | 23 ++++++----------------- awesomeConfig.cmake | 15 ++++++++------- config.ld.in | 7 +++++++ 3 files changed, 21 insertions(+), 24 deletions(-) create mode 100644 config.ld.in diff --git a/CMakeLists.txt b/CMakeLists.txt index fc3e6730..6d0d3911 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,8 +21,6 @@ include_directories( ${AWESOME_REQUIRED_INCLUDE_DIRS} ${AWESOME_OPTIONAL_INCLUDE_DIRS}) -file(GLOB_RECURSE AWE_LUA_FILES ${BUILD_DIR}/lib/*.lua ${BUILD_DIR}/luadoc/*.lua) - set(AWE_CONF_FILE_DEFAULT ${BUILD_DIR}/awesomerc.lua) set(AWE_CONF_FILE rc.lua) @@ -230,24 +228,15 @@ endif() # }}} # {{{ Lua API Documentation -if(GENERATE_LUADOC) - +if(GENERATE_DOC) if(NOT BUILD_DIR STREQUAL SOURCE_DIR) file(MAKE_DIRECTORY ${BUILD_DIR}/lib) endif() - set(luadoc_c_srcs "") + file(GLOB_RECURSE AWE_LUA_FILES ${BUILD_DIR}/lib/*.lua ${BUILD_DIR}/luadoc/*.lua) - # Generate documentation of lib//0lua - file(GLOB_RECURSE lua_lib_files ${BUILD_DIR}/lib/*.lua - ${SOURCE_DIR}/luadoc/*.lua) - foreach(filename ${lua_lib_files}) - file(RELATIVE_PATH filename ${BUILD_DIR} ${filename}) - set(luadoc_srcs ${luadoc_srcs} ${filename}) - endforeach() - - add_custom_target(luadoc ALL - COMMAND ${LUADOC_EXECUTABLE} ${luadoc_srcs} -d ${BUILD_DIR}/luadoc --nofiles + add_custom_target(ldoc ALL + COMMAND ${LDOC_EXECUTABLE} . WORKING_DIRECTORY ${BUILD_DIR} DEPENDS ${AWE_LUA_FILES}) endif() @@ -326,8 +315,8 @@ install(DIRECTORY ${SOURCE_DIR}/themes DESTINATION ${AWESOME_DATA_PATH} PATTERN "*.in" EXCLUDE) install(FILES ${AWE_DOC_FILES} DESTINATION ${AWESOME_DOC_PATH}) install(FILES "awesome.desktop" DESTINATION ${AWESOME_XSESSION_PATH}) -if(GENERATE_LUADOC) - install(DIRECTORY ${BUILD_DIR}/luadoc DESTINATION ${AWESOME_DOC_PATH}) +if(GENERATE_DOC) + install(DIRECTORY ${BUILD_DIR}/doc DESTINATION ${AWESOME_DOC_PATH}) endif() # }}} diff --git a/awesomeConfig.cmake b/awesomeConfig.cmake index d96cb080..a5923373 100644 --- a/awesomeConfig.cmake +++ b/awesomeConfig.cmake @@ -13,7 +13,7 @@ set(CMAKE_BUILD_TYPE RELEASE) option(WITH_DBUS "build with D-BUS" ON) option(GENERATE_MANPAGES "generate manpages" ON) option(COMPRESS_MANPAGES "compress manpages" ON) -option(GENERATE_LUADOC "generate luadoc" ON) +option(GENERATE_DOC "generate API documentation" ON) # {{{ CFLAGS add_definitions(-std=gnu99 -ggdb3 -rdynamic -fno-strict-aliasing -Wall -Wextra @@ -54,7 +54,7 @@ a_find_program(XMLTO_EXECUTABLE xmlto FALSE) a_find_program(GZIP_EXECUTABLE gzip FALSE) # lua documentation a_find_program(LUA_EXECUTABLE lua FALSE) -a_find_program(LUADOC_EXECUTABLE luadoc FALSE) +a_find_program(LDOC_EXECUTABLE ldoc.lua FALSE) # theme graphics a_find_program(CONVERT_EXECUTABLE convert TRUE) # doxygen @@ -83,10 +83,10 @@ if(GENERATE_MANPAGES) endif() endif() -if(GENERATE_LUADOC) - if(NOT LUADOC_EXECUTABLE) - message(STATUS "Not generating luadoc. Missing: luadoc") - set(GENERATE_LUADOC OFF) +if(GENERATE_DOC) + if(NOT LDOC_EXECUTABLE) + message(STATUS "Not generating API documentation. Missing: ldoc") + set(GENERATE_DOC OFF) endif() endif() # }}} @@ -280,9 +280,10 @@ set(AWESOME_THEMES_PATH ${AWESOME_DATA_PATH}/themes) # {{{ Configure files file(GLOB_RECURSE awesome_lua_configure_files RELATIVE ${SOURCE_DIR} ${SOURCE_DIR}/lib/*.lua.in ${SOURCE_DIR}/themes/*/*.lua.in) -set(AWESOME_CONFIGURE_FILES +set(AWESOME_CONFIGURE_FILES ${awesome_lua_configure_files} config.h.in + config.ld.in awesomerc.lua.in awesome-version-internal.h.in awesome.doxygen.in) diff --git a/config.ld.in b/config.ld.in new file mode 100644 index 00000000..a29b834b --- /dev/null +++ b/config.ld.in @@ -0,0 +1,7 @@ +-- Configuration file for ldoc +project='awesome' +title='awesome API documentation' +description='highly configurable X window manager' +--format='markdown' or should it be discount? what is that anyway? how about plain? +dir='doc' +file={ 'lib/', '@SOURCE_DIR@/luadoc' }