#
# Copyright (c) 2018 Jonathan Anderson
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#

#
# Find FileCheck, a part of the LLVM testing framework that checks test outputs.
#
# This will define:
#   FILECHECK_FOUND              whether we found a `FileCheck` executable
#   FILECHECK_EXECUTABLE         path to `FileCheck` executable
#

find_program(FILECHECK_EXECUTABLE FileCheck
	PATHS
		/usr/local/llvm-devel/bin
		/usr/local/llvm60/bin
		/usr/local/llvm50/bin
		/usr/local/llvm40/bin
		$ENV{PATH}
		DOC "Path to LLVM 'FileCheck' (test output checker) executable"
)


include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(FileCheck DEFAULT_MSG FILECHECK_EXECUTABLE)

mark_as_advanced(FILECHECK_EXECUTABLE)
