-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathinstall-config.cmake.in
55 lines (45 loc) · 1.88 KB
/
install-config.cmake.in
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
48
49
50
51
52
53
54
55
#
# Copyright (c) 2022-present, Trail of Bits, Inc.
# All rights reserved.
#
# This source code is licensed in accordance with the terms specified in
# the LICENSE file found in the root directory of this source tree.
#
# This file provides access to the installed sleigh targets.
#
# There are optional components that could also be installed:
# * Specs - Compiled sleigh specification files
# * Support - Support library for easier use of sleigh
# * ExtraTools - Extra tools created by Trail of Bits
@PACKAGE_INIT@
# Extra version details. Either 'stable' or 'HEAD'
set(sleigh_RELEASE_IS_HEAD "@sleigh_RELEASE_IS_HEAD@")
include(CMakeFindDependencyMacro)
find_dependency(ZLIB)
include("${CMAKE_CURRENT_LIST_DIR}/sleighTargets.cmake")
# Helpers exposed by default when finding sleigh
include("${CMAKE_CURRENT_LIST_DIR}/modules/sleighCompile.cmake")
# Find-package component handling for Support library and ExtraTools
set(_sleigh_supported_components Specs Support ExtraTools)
# Specs just sets a variable to the directory of installation
set(_sleigh_Specs_targets "${CMAKE_CURRENT_LIST_DIR}/specfiles.cmake")
set(_sleigh_Support_targets "${CMAKE_CURRENT_LIST_DIR}/sleighSupportTargets.cmake")
set(_sleigh_ExtraTools_targets "${CMAKE_CURRENT_LIST_DIR}/sleighExtraToolsTargets.cmake")
macro(sleigh_load_component comp)
if(NOT EXISTS "${_sleigh_${comp}_targets}" AND ${sleigh_FIND_REQUIRED_${comp}})
set(sleigh_NOT_FOUND_MESSAGE
"sleigh `${comp}` component targets were requested but not found.")
set(sleigh_FOUND FALSE)
return()
endif()
if(EXISTS "${_sleigh_${comp}_targets}")
include("${_sleigh_${comp}_targets}")
endif()
endmacro()
foreach(_comp ${sleigh_FIND_COMPONENTS})
if (NOT _comp IN_LIST _sleigh_supported_components)
set(sleigh_FOUND FALSE)
set(sleigh_NOT_FOUND_MESSAGE "Unsupported component: ${_comp}")
endif()
sleigh_load_component("${_comp}")
endforeach()