* Fixed man page generation

This commit is contained in:
Félix C. Morency 2008-06-18 19:41:46 -07:00 committed by Julien Danjou
parent c44ed37067
commit a66c82b25e
2 changed files with 41 additions and 37 deletions

View File

@ -84,43 +84,6 @@ SET( AWE_MAN5_NAME ${CMAKE_CURRENT_BINARY_DIR}/awesomerc.5.gz )
SET( AWE_LUADOC_FILE ${CMAKE_CURRENT_SOURCE_DIR}/apidocgen.txt ) 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} )
STRING( REPLACE ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR} gzipman ${gzipman} )
STRING( REGEX REPLACE ".gz\$" "" manfile ${gzipman} )
ADD_CUSTOM_COMMAND( OUTPUT ${xmlfile}
COMMAND ${ASCIIDOC_EXECUTABLE} -d manpage -b docbook -o ${xmlfile} ${txtfile}
DEPENDS ${txtfile}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
ADD_CUSTOM_COMMAND( OUTPUT ${manfile}
COMMAND ${XMLTO_EXECUTABLE} man ${xmlfile}
DEPENDS ${xmlfile}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
ADD_CUSTOM_COMMAND( OUTPUT ${gzipman}
COMMAND ${GZIP_EXECUTABLE} -f ${manfile}
DEPENDS ${manfile}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
SET( AWE_MAN_FILES ${AWE_MAN_FILES} ${gzipman} )
ENDFOREACH( txtfile)
ADD_CUSTOM_TARGET( man ALL DEPENDS ${AWE_MAN_FILES}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} )
ENDIF( AWESOME_GENERATE_MAN )
ADD_EXECUTABLE( ${PROJECT_AWE_NAME} ${AWE_SRCS} ) ADD_EXECUTABLE( ${PROJECT_AWE_NAME} ${AWE_SRCS} )
ADD_EXECUTABLE( ${PROJECT_AWECLIENT_NAME} ${AWE_CLIENT_SRCS} ) ADD_EXECUTABLE( ${PROJECT_AWECLIENT_NAME} ${AWE_CLIENT_SRCS} )
@ -136,6 +99,31 @@ TARGET_LINK_LIBRARIES( ${PROJECT_AWECLIENT_NAME} ${AWE_MOD_LIBRARIES}
${LIB_NCURSES} ${LIB_NCURSES}
) )
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} )
STRING( REPLACE ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR} gzipman ${gzipman} )
STRING( REGEX REPLACE ".gz\$" "" manfile ${gzipman} )
ADD_CUSTOM_COMMAND( TARGET ${PROJECT_AWECLIENT_NAME} POST_BUILD
COMMAND ${ASCIIDOC_EXECUTABLE} -d manpage -b docbook -o ${xmlfile} ${txtfile}
COMMAND ${XMLTO_EXECUTABLE} man ${xmlfile}
COMMAND ${GZIP_EXECUTABLE} -f ${manfile}
COMMENT "Generating man pages for ${manfile}"
VERBATIM
)
ENDFOREACH( txtfile )
ENDIF( AWESOME_GENERATE_MAN )
INSTALL( TARGETS ${PROJECT_AWE_NAME} ${PROJECT_AWECLIENT_NAME} INSTALL( TARGETS ${PROJECT_AWE_NAME} ${PROJECT_AWECLIENT_NAME}
RUNTIME DESTINATION bin RUNTIME DESTINATION bin
LIBRARY DESTINATION lib LIBRARY DESTINATION lib

View File

@ -2,6 +2,10 @@ SET( PROJECT_AWE_NAME awesome )
SET( PROJECT_AWECLIENT_NAME awesome-client ) SET( PROJECT_AWECLIENT_NAME awesome-client )
SET( VERSION 3 ) SET( VERSION 3 )
SET( VERSION_MAJOR ${VERSION} )
SET( VERSION_MINOR 0 )
SET( VERSION_PATCH 0 )
PROJECT( ${PROJECT_AWE_NAME} ) PROJECT( ${PROJECT_AWE_NAME} )
SET( CMAKE_BUILD_TYPE RELEASE ) SET( CMAKE_BUILD_TYPE RELEASE )
@ -169,4 +173,16 @@ SET( AWE_INC_DIR ${CMAKE_CURRENT_SOURCE_DIR}
${LUA_INC_DIR} ${LUA_INC_DIR}
) )
SET( CPACK_PACKAGE_NAME "${PROJECT_AWE_NAME}" )
SET( CPACK_GENERATOR "TBZ2" )
SET( CPACK_PACKAGE_DESCRIPTION_SUMMARY "A fast tiling WM" )
SET( CPACK_PACKAGE_VENDOR "Awesome's team" )
SET( CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README" )
SET( CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE" )
SET( CPACK_PACKAGE_VERSION_MAJOR "${VERSION_MAJOR}" )
SET( CPACK_PACKAGE_VERSION_MINOR "${VERSION_MINOR}" )
SET( CPACK_PACKAGE_VERSION_PATCH "${VERSION_PATCH}" )
INCLUDE( CPack )
# vim: filetype=cmake:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 # vim: filetype=cmake:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80