cmake: exit if a required utility is not found

This commit is contained in:
Michael Gehring 2008-07-18 22:24:05 +02:00 committed by Julien Danjou
parent 38ff94733b
commit 56de5faab4
1 changed files with 25 additions and 12 deletions

View File

@ -30,20 +30,33 @@ add_definitions(-std=gnu99 -ggdb3 -fno-strict-aliasing -Wall -Wextra
# }}} # }}}
# {{{ Find external utilities # {{{ Find external utilities
find_program(CAT_EXECUTABLE cat) macro(a_find_program var prg req)
find_program(LN_EXECUTABLE ln) set(required ${req})
find_program(GREP_EXECUTABLE grep) find_program(${var} ${prg})
find_program(GIT_EXECUTABLE git) if(NOT ${var})
find_program(HOSTNAME_EXECUTABLE hostname) message(STATUS "${prg} not found.")
find_program(GPERF_EXECUTABLE gperf) if(required)
find_program(LUAC_EXECUTABLE luac) message(FATAL_ERROR "${prg} is required to build awesome")
endif()
else()
message(STATUS "${prg} -> ${${var}}")
endif()
endmacro()
a_find_program(CAT_EXECUTABLE cat TRUE)
a_find_program(LN_EXECUTABLE ln TRUE)
a_find_program(GREP_EXECUTABLE grep TRUE)
a_find_program(GIT_EXECUTABLE git FALSE)
a_find_program(HOSTNAME_EXECUTABLE hostname FALSE)
a_find_program(GPERF_EXECUTABLE gperf TRUE)
a_find_program(LUAC_EXECUTABLE luac TRUE)
# programs needed for man pages # programs needed for man pages
find_program(ASCIIDOC_EXECUTABLE asciidoc) a_find_program(ASCIIDOC_EXECUTABLE asciidoc FALSE)
find_program(XMLTO_EXECUTABLE xmlto) a_find_program(XMLTO_EXECUTABLE xmlto FALSE)
find_program(GZIP_EXECUTABLE gzip) a_find_program(GZIP_EXECUTABLE gzip FALSE)
# lua documentation # lua documentation
find_program(LUA_EXECUTABLE lua) a_find_program(LUA_EXECUTABLE lua FALSE)
find_program(LUADOC_EXECUTABLE luadoc) a_find_program(LUADOC_EXECUTABLE luadoc FALSE)
# doxygen # doxygen
include(FindDoxygen) include(FindDoxygen)
# pkg-config # pkg-config