-
Notifications
You must be signed in to change notification settings - Fork 2
/
FindNumDiff.cmake
38 lines (33 loc) · 1.36 KB
/
FindNumDiff.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
################################################################################
#
# \file FindNumDiff.cmake
# \copyright 2012-2015 J. Bakosi,
# 2016-2018 Los Alamos National Security, LLC.,
# 2019-2021 Triad National Security, LLC.
# All rights reserved. See the LICENSE file for details.
# \brief Find NumDiff
#
################################################################################
# NumDiff: https://github.com/MethodicalAcceleratorDesign/MAD-X/tree/master/tools/numdiff
#
# NUMDIFF_FOUND - System has numdiff
# NUMDIFF_EXECUTABLE - The numdiff executable
#
# Usage:
#
# set(NUMDIFF_ROOT "/path/to/custom/numdiff") # prefer over system
# find_package(NumDiff)
if(NUMDIFF_EXECUTABLE)
# Already in cache, be silent
set (NUMDIFF_FIND_QUIETLY TRUE)
endif()
FIND_PROGRAM(NUMDIFF_EXECUTABLE NAMES maddiff mad-numdiff numdiff
PATHS ${NUMDIFF_ROOT}/bin
$ENV{NUMDIFF_ROOT}/bin
PATH_SUFFIXES bin)
# Handle the QUIETLY and REQUIRED arguments and set NUMDIFF_FOUND to TRUE if
# all listed variables are TRUE.
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(NumDiff DEFAULT_MSG NUMDIFF_EXECUTABLE)
get_filename_component(${NUMDIFF_EXECUTABLE} NUMDIFF_EXECUTABLE ABSOLUTE)
MARK_AS_ADVANCED(NUMDIFF_EXECUTABLE)