From c5012826d5aff544ace9aed7bf3242b19698db06 Mon Sep 17 00:00:00 2001 From: Michael Gehring Date: Tue, 17 Jun 2008 19:46:17 +0200 Subject: [PATCH] cmake: generate apigendoc.txt --- CMakeLists.txt | 10 ++++++++++ awesomeConfig.cmake | 2 ++ 2 files changed, 12 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index bc693c314..84e89a392 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,7 +82,17 @@ SET( AWE_MAN1_NAME ${CMAKE_CURRENT_BINARY_DIR}/awesome.1.gz ${CMAKE_CURRENT_BINARY_DIR}/awesome-client.1.gz ) SET( AWE_MAN5_NAME ${CMAKE_CURRENT_BINARY_DIR}/awesomerc.5.gz ) +SET( AWE_LUADOC_FILE ${CMAKE_CURRENT_SOURCE_DIR}/apidocgen.txt ) + IF( AWESOME_GENERATE_MAN ) + + # Create luadoc file + FIND_PROGRAM( CAT_EXECUTABLE cat ) + EXECUTE_PROCESS( COMMAND ${CAT_EXECUTABLE} ${AWE_SRCS} + COMMAND ${LUA_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/build-utils/gendoc.lua + OUTPUT_FILE ${AWE_LUADOC_FILE} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) + FOREACH( txtfile ${AWE_MAN_SRCS}) STRING( REGEX REPLACE ".txt\$" ".xml" xmlfile ${txtfile} ) STRING( REGEX REPLACE ".xml\$" ".gz" gzipman ${xmlfile} ) diff --git a/awesomeConfig.cmake b/awesomeConfig.cmake index dee0456b0..bd2594172 100644 --- a/awesomeConfig.cmake +++ b/awesomeConfig.cmake @@ -70,6 +70,8 @@ FIND_LIBRARY(LUA_LIB NAMES lua5.1 lua /usr/local/lib ../libs/lua-5.1.3/lib) +FIND_PROGRAM( LUA_EXECUTABLE lua ) + # Error check IF( NOT LIB_READLINE ) MESSAGE( FATAL_ERROR "readline library not found" )