cmake: group external utilities

This commit is contained in:
Michael Gehring 2008-06-20 18:01:42 +02:00 committed by Julien Danjou
parent de0d6045ba
commit 0aa87e68b8
2 changed files with 14 additions and 12 deletions

View File

@ -98,7 +98,6 @@ TARGET_LINK_LIBRARIES(${PROJECT_AWECLIENT_NAME}
IF(AWESOME_GENERATE_MAN) IF(AWESOME_GENERATE_MAN)
# Create luadoc file # Create luadoc file
FIND_PROGRAM(CAT_EXECUTABLE cat)
EXECUTE_PROCESS(COMMAND ${CAT_EXECUTABLE} ${AWE_SRCS} EXECUTE_PROCESS(COMMAND ${CAT_EXECUTABLE} ${AWE_SRCS}
COMMAND ${LUA_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/build-utils/gendoc.lua COMMAND ${LUA_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/build-utils/gendoc.lua
OUTPUT_FILE ${AWE_LUADOC_FILE} OUTPUT_FILE ${AWE_LUADOC_FILE}

View File

@ -19,10 +19,23 @@ ADD_DEFINITIONS(-std=gnu99 -ggdb3 -fno-strict-aliasing -Wall -Wextra
-Wpointer-arith -Wredundant-decls -Wformat-nonliteral -Wpointer-arith -Wredundant-decls -Wformat-nonliteral
-Wno-format-zero-length -Wmissing-format-attribute) -Wno-format-zero-length -Wmissing-format-attribute)
# {{{ external utilities
FIND_PROGRAM(CAT_EXECUTABLE cat)
FIND_PROGRAM(GIT_EXECUTABLE git)
FIND_PROGRAM(LUA_EXECUTABLE lua)
# programs needed for man pages
FIND_PROGRAM(ASCIIDOC_EXECUTABLE asciidoc)
FIND_PROGRAM(XMLTO_EXECUTABLE xmlto)
FIND_PROGRAM(GZIP_EXECUTABLE gzip)
# doxygen
INCLUDE(FindDoxygen)
# pkg-config
INCLUDE(FindPkgConfig)
# }}}
# If this is a git repository... # If this is a git repository...
IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git/HEAD) IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git/HEAD)
# ...update version # ...update version
FIND_PROGRAM(GIT_EXECUTABLE git)
IF(GIT_EXECUTABLE) IF(GIT_EXECUTABLE)
EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} describe EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} describe
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
@ -31,9 +44,6 @@ IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git/HEAD)
ENDIF() ENDIF()
ENDIF() ENDIF()
# Check for doxygen
INCLUDE(FindDoxygen)
INCLUDE(FindPkgConfig)
SET(AWE_COMMON_DIR common) SET(AWE_COMMON_DIR common)
SET(AWE_LAYOUT_DIR layouts) SET(AWE_LAYOUT_DIR layouts)
@ -97,8 +107,6 @@ FIND_LIBRARY(LUA_LIB NAMES lua5.1 lua
/usr/lib/lua /usr/lib/lua
/usr/local/lib) /usr/local/lib)
FIND_PROGRAM(LUA_EXECUTABLE lua)
# Error check # Error check
IF(NOT LIB_EV) IF(NOT LIB_EV)
MESSAGE( FATAL_ERROR "ev library not found") MESSAGE( FATAL_ERROR "ev library not found")
@ -120,11 +128,6 @@ IF(DOXYGEN_EXECUTABLE)
ADD_CUSTOM_TARGET(doc ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/awesome.doxygen) ADD_CUSTOM_TARGET(doc ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/awesome.doxygen)
ENDIF() ENDIF()
# Check for programs needed for man pages
FIND_PROGRAM(ASCIIDOC_EXECUTABLE asciidoc)
FIND_PROGRAM(XMLTO_EXECUTABLE xmlto)
FIND_PROGRAM(GZIP_EXECUTABLE gzip)
IF(ASCIIDOC_EXECUTABLE AND XMLTO_EXECUTABLE AND GZIP_EXECUTABLE) IF(ASCIIDOC_EXECUTABLE AND XMLTO_EXECUTABLE AND GZIP_EXECUTABLE)
SET(AWESOME_GENERATE_MAN TRUE) SET(AWESOME_GENERATE_MAN TRUE)
ENDIF() ENDIF()