cmake: indent

This commit is contained in:
Michael Gehring 2008-06-23 13:57:30 +02:00 committed by Julien Danjou
parent d08f746733
commit 8f5363bcc1
2 changed files with 58 additions and 49 deletions

View File

@ -10,10 +10,11 @@ endif()
include(awesomeConfig.cmake) include(awesomeConfig.cmake)
include_directories(${SOURCE_DIR} include_directories(
${BUILD_DIR} ${SOURCE_DIR}
${AWESOME_REQUIRED_INCLUDE_DIRS} ${BUILD_DIR}
${AWESOME_OPTIONAL_INCLUDE_DIRS}) ${AWESOME_REQUIRED_INCLUDE_DIRS}
${AWESOME_OPTIONAL_INCLUDE_DIRS})
set(AWE_LUA_FILES set(AWE_LUA_FILES
${SOURCE_DIR}/lib/tabulous.lua ${SOURCE_DIR}/lib/tabulous.lua
@ -155,10 +156,10 @@ add_dependencies(${PROJECT_AWE_NAME} generated_sources)
# {{{ version stamp # {{{ version stamp
if(BUILD_FROM_GIT) if(BUILD_FROM_GIT)
add_custom_target(version_stamp ALL add_custom_target(version_stamp ALL
COMMAND ${SOURCE_DIR}/build-utils/git-version-stamp.sh COMMAND ${SOURCE_DIR}/build-utils/git-version-stamp.sh
${VERSION_STAMP_FILE} ${VERSION_STAMP_FILE}
${BUILD_DIR}/awesome-version-internal.h ${BUILD_DIR}/awesome-version-internal.h
WORKING_DIRECTORY ${SOURCE_DIR}) WORKING_DIRECTORY ${SOURCE_DIR})
add_dependencies(${PROJECT_AWE_NAME} version_stamp) add_dependencies(${PROJECT_AWE_NAME} version_stamp)
add_dependencies(${PROJECT_AWECLIENT_NAME} version_stamp) add_dependencies(${PROJECT_AWECLIENT_NAME} version_stamp)
@ -174,9 +175,10 @@ if(GENERATE_MANPAGES)
macro(a_file_match infile regex result_var) macro(a_file_match infile regex result_var)
if(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION LESS 6) if(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION LESS 6)
# cmake < 2.6 doesn't know FILE(STRINGS ...) # cmake < 2.6 doesn't know FILE(STRINGS ...)
execute_process(COMMAND ${GREP_EXECUTABLE} -l ${regex} ${infile} execute_process(
RESULT_VARIABLE exit_code COMMAND ${GREP_EXECUTABLE} -l ${regex} ${infile}
OUTPUT_QUIET) RESULT_VARIABLE exit_code
OUTPUT_QUIET)
if(exit_code EQUAL 0) if(exit_code EQUAL 0)
set(${result_var} TRUE) set(${result_var} TRUE)
else() else()
@ -201,14 +203,15 @@ if(GENERATE_MANPAGES)
endforeach() endforeach()
# luadoc target # luadoc target
add_custom_command(COMMAND ${CAT_EXECUTABLE} ${LUA_APIDOC_SRCS} add_custom_command(
| ${LUA_EXECUTABLE} ${SOURCE_DIR}/build-utils/gendoc.lua COMMAND ${CAT_EXECUTABLE} ${LUA_APIDOC_SRCS}
> ${LUADOC_FILE} | ${LUA_EXECUTABLE} ${SOURCE_DIR}/build-utils/gendoc.lua
OUTPUT ${LUADOC_FILE} > ${LUADOC_FILE}
WORKING_DIRECTORY ${SOURCE_DIR} OUTPUT ${LUADOC_FILE}
DEPENDS ${LUA_APIDOC_SRCS} WORKING_DIRECTORY ${SOURCE_DIR}
COMMENT "Generating Lua API documentation." DEPENDS ${LUA_APIDOC_SRCS}
VERBATIM) COMMENT "Generating Lua API documentation."
VERBATIM)
add_custom_target(luadoc DEPENDS ${LUADOC_FILE}) add_custom_target(luadoc DEPENDS ${LUADOC_FILE})
# }}} # }}}
@ -222,21 +225,24 @@ if(GENERATE_MANPAGES)
# TODO: This is still not 100% right. Actually only # TODO: This is still not 100% right. Actually only
# awesomerc.5.xml should depend on ${LUADOC_FILE}. # awesomerc.5.xml should depend on ${LUADOC_FILE}.
add_custom_command(COMMAND ${CAT_EXECUTABLE} ${txtfile} add_custom_command(
| ${ASCIIDOC_EXECUTABLE} -d manpage -b docbook -o ${xmlfile} - COMMAND ${CAT_EXECUTABLE} ${txtfile}
WORKING_DIRECTORY ${BUILD_DIR} | ${ASCIIDOC_EXECUTABLE} -d manpage -b docbook -o ${xmlfile} -
OUTPUT ${xmlfile} WORKING_DIRECTORY ${BUILD_DIR}
DEPENDS ${txtfile} ${LUADOC_FILE} OUTPUT ${xmlfile}
VERBATIM) DEPENDS ${txtfile} ${LUADOC_FILE}
add_custom_command(COMMAND ${XMLTO_EXECUTABLE} man ${xmlfile} VERBATIM)
OUTPUT ${manfile} add_custom_command(
DEPENDS ${xmlfile}) COMMAND ${XMLTO_EXECUTABLE} man ${xmlfile}
add_custom_command(COMMAND ${CAT_EXECUTABLE} ${manfile} OUTPUT ${manfile}
| ${GZIP_EXECUTABLE} DEPENDS ${xmlfile})
> ${gzfile} add_custom_command(
OUTPUT ${gzfile} COMMAND ${CAT_EXECUTABLE} ${manfile}
DEPENDS ${manfile} | ${GZIP_EXECUTABLE}
VERBATIM) > ${gzfile}
OUTPUT ${gzfile}
DEPENDS ${manfile}
VERBATIM)
set(MAN_FILES ${MAN_FILES} ${gzfile}) set(MAN_FILES ${MAN_FILES} ${gzfile})
@ -252,8 +258,8 @@ endif()
# {{{ Doxygen # {{{ Doxygen
if(DOXYGEN_EXECUTABLE) if(DOXYGEN_EXECUTABLE)
add_custom_target(doc add_custom_target(doc
COMMAND ${DOXYGEN_EXECUTABLE} awesome.doxygen COMMAND ${DOXYGEN_EXECUTABLE} awesome.doxygen
WORKING_DIRECTORY ${BUILD_DIR}) WORKING_DIRECTORY ${BUILD_DIR})
endif() endif()
# }}} # }}}

View File

@ -64,10 +64,11 @@ endif()
if(EXISTS ${SOURCE_DIR}/.git/HEAD) if(EXISTS ${SOURCE_DIR}/.git/HEAD)
if(GIT_EXECUTABLE) if(GIT_EXECUTABLE)
# get current version # get current version
execute_process(COMMAND ${GIT_EXECUTABLE} describe execute_process(
WORKING_DIRECTORY ${SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} describe
OUTPUT_VARIABLE VERSION WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_STRIP_TRAILING_WHITESPACE) OUTPUT_VARIABLE VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
# file the git-version-stamp.sh script will look into # file the git-version-stamp.sh script will look into
set(VERSION_STAMP_FILE ${BUILD_DIR}/.version_stamp) set(VERSION_STAMP_FILE ${BUILD_DIR}/.version_stamp)
file(WRITE ${VERSION_STAMP_FILE} ${VERSION}) file(WRITE ${VERSION_STAMP_FILE} ${VERSION})
@ -131,12 +132,13 @@ if(NOT LUA_LIB)
endif() endif()
set(AWESOME_REQUIRED_LIBRARIES ${AWESOME_REQUIRED_LIBRARIES} set(AWESOME_REQUIRED_LIBRARIES ${AWESOME_REQUIRED_LIBRARIES}
${LIB_READLINE} ${LIB_READLINE}
${LIB_NCURSES} ${LIB_NCURSES}
${LIB_EV} ${LIB_EV}
${LUA_LIB}) ${LUA_LIB})
set(AWESOME_REQUIRED_INCLUDE_DIRS ${AWESOME_REQUIRED_INCLUDE_DIRS} ${LUA_INC_DIR}) set(AWESOME_REQUIRED_INCLUDE_DIRS ${AWESOME_REQUIRED_INCLUDE_DIRS}
${LUA_INC_DIR})
# }}} # }}}
# {{{ Optional libraries. # {{{ Optional libraries.
@ -191,10 +193,11 @@ set(AWESOME_REL_DOC_PATH ${AWESOME_SHARE}/doc/${PROJECT_AWE_NAME})
# }}} # }}}
# {{{ Configure files. # {{{ Configure files.
set (AWESOME_CONFIGURE_FILES config.h.in set(AWESOME_CONFIGURE_FILES
awesomerc.lua.in config.h.in
awesome-version-internal.h.in awesomerc.lua.in
awesome.doxygen.in) awesome-version-internal.h.in
awesome.doxygen.in)
macro(a_configure_file file) macro(a_configure_file file)
string(REGEX REPLACE ".in\$" "" outfile ${file}) string(REGEX REPLACE ".in\$" "" outfile ${file})