-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathFindBrigand.cmake
47 lines (40 loc) · 1.71 KB
/
FindBrigand.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
39
40
41
42
43
44
45
46
47
################################################################################
#
# \file FindBrigand.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 the Brigand template metaprogramming library
#
################################################################################
# Brigand: https://github.com/edouarda/brigand
#
# BRIGAND_FOUND - System has Brigand
# BRIGAND_INCLUDE_DIRS - The Brigand include directory
#
# Set the BRIGAND_ROOT cmake variable or shell environment variable before
# calling find_package to a path to add an additional search path, e.g.,
#
# Usage:
#
# set(BRIGAND_ROOT "/path/to/custom/brigand") # prefer over system
# find_package(Brigand)
# include_directories(${BRIGAND_INCLUDE_DIRS})
# If already in cache, be silent
if(BRIGAND_INCLUDE_DIRS)
set (BRIGAND_FIND_QUIETLY TRUE)
endif()
find_path(BRIGAND_INCLUDE_DIR NAMES brigand.hpp
HINTS ${BRIGAND_ROOT}/include
$ENV{BRIGAND_ROOT}/include
PATH_SUFFIXES brigand)
# Remove last 'brigand' from path found, otherwise some compilers, e.g., gc++
# 4.8, will not find brigand.
get_filename_component(BRIGAND_INCLUDE_DIR ${BRIGAND_INCLUDE_DIR} DIRECTORY)
set(BRIGAND_INCLUDE_DIRS ${BRIGAND_INCLUDE_DIR})
# Handle the QUIETLY and REQUIRED arguments and set Brigand_FOUND to TRUE if
# all listed variables are TRUE.
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Brigand REQUIRED_VARS BRIGAND_INCLUDE_DIRS)
MARK_AS_ADVANCED(BRIGAND_INCLUDE_DIRS)