1#############################################################################
2##    Kwave                - cmake/FindRequiredProgram.cmake
3##                           -------------------
4##    begin                : Mon May 14 2007
5##    copyright            : (C) 2007 by Thomas Eschenbacher
6##    email                : Thomas.Eschenbacher@gmx.de
7#############################################################################
8#
9#############################################################################
10#                                                                           #
11# Redistribution and use in source and binary forms, with or without        #
12# modification, are permitted provided that the following conditions        #
13# are met:                                                                  #
14#                                                                           #
15# 1. Redistributions of source code must retain the above copyright         #
16#    notice, this list of conditions and the following disclaimer.          #
17# 2. Redistributions in binary form must reproduce the above copyright      #
18#    notice, this list of conditions and the following disclaimer in the    #
19#    documentation and/or other materials provided with the distribution.   #
20#                                                                           #
21# For details see the accompanying cmake/COPYING-CMAKE-SCRIPTS file.        #
22#                                                                           #
23#############################################################################
24
25# like FIND_PROGRAM, but show status message or abort if nothing found
26# usage: FIND_REQUIRED_PROGRAM(variable name1 [name2] ...)
27MACRO(FIND_REQUIRED_PROGRAM _variable)
28
29    FIND_PROGRAM(${_variable} NAMES ${ARGN})
30
31    IF (${_variable})
32        GET_FILENAME_COMPONENT(_basename ${${_variable}} NAME_WE)
33        MESSAGE(STATUS "Found ${_basename}: ${${_variable}}")
34    ELSE (${_variable})
35        MESSAGE(FATAL_ERROR "Unable to find executable for ${ARGN}")
36    ENDIF (${_variable})
37
38ENDMACRO(FIND_REQUIRED_PROGRAM)
39
40#############################################################################
41#############################################################################
42