-
Notifications
You must be signed in to change notification settings - Fork 197
/
Copy pathconfig.cmake.in
123 lines (98 loc) · 4.49 KB
/
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
#[=======================================================================[
@RAPIDS_PROJECT_DOCUMENTATION@
Result Variables
^^^^^^^^^^^^^^^^
This module will set the following variables::
@project_name_uppercase@_FOUND
@project_name_uppercase@_VERSION
@project_name_uppercase@_VERSION_MAJOR
@project_name_uppercase@_VERSION_MINOR
#]=======================================================================]
@PACKAGE_INIT@
cmake_minimum_required(VERSION @CMAKE_MINIMUM_REQUIRED_VERSION@)
set(rapids_global_languages @RAPIDS_LANGUAGES@)
foreach(lang IN LISTS rapids_global_languages)
include("${CMAKE_CURRENT_LIST_DIR}/@project_name@-${lang}-language.cmake")
endforeach()
unset(rapids_global_languages)
set(rapids_base_components @RAPIDS_COMPONENTS@)
set(rapids_allowed_components ${rapids_base_components})
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
endif()
foreach(comp IN LISTS rapids_allowed_components)
# find dependencies before creating targets that use them
# this way if a dependency can't be found we fail
if(${comp} IN_LIST @project_name@_FIND_COMPONENTS)
include("${CMAKE_CURRENT_LIST_DIR}/@project_name@-${comp}-dependencies.cmake" OPTIONAL)
include("${CMAKE_CURRENT_LIST_DIR}/@project_name@-${comp}-lib-dependencies.cmake" OPTIONAL)
endif()
endforeach()
include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]" OPTIONAL)
foreach(comp IN LISTS rapids_allowed_components)
if(${comp} IN_LIST @project_name@_FIND_COMPONENTS)
include("${CMAKE_CURRENT_LIST_DIR}/@project_name@-${comp}-targets.cmake" OPTIONAL)
include("${CMAKE_CURRENT_LIST_DIR}/@project_name@-${comp}-lib-targets.cmake" OPTIONAL)
set(@project_name@_${comp}_FOUND TRUE)
endif()
endforeach()
unset(rapids_allowed_components)
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
endif()
# Set our version variables
set(@project_name_uppercase@_VERSION_MAJOR @rapids_orig_major_version@)
set(@project_name_uppercase@_VERSION_MINOR @rapids_orig_minor_version@)
set(@project_name_uppercase@_VERSION_PATCH @rapids_orig_patch_version@)
set(@project_name_uppercase@_VERSION @rapids_orig_version@)
set(rapids_global_targets @RAPIDS_GLOBAL_TARGETS@)
set(rapids_namespaced_global_targets @RAPIDS_GLOBAL_TARGETS@)
if(rapids_namespaced_global_targets)
list(TRANSFORM rapids_namespaced_global_targets PREPEND @RAPIDS_NAMESPACE@ )
endif()
foreach(target IN LISTS rapids_namespaced_global_targets)
if(TARGET ${target})
get_target_property(_is_imported ${target} IMPORTED)
get_target_property(_already_global ${target} IMPORTED_GLOBAL)
if(_is_imported AND NOT _already_global)
set_target_properties(${target} PROPERTIES IMPORTED_GLOBAL TRUE)
endif()
endif()
endforeach()
# For backwards compat
if("rapids_config_@type@" STREQUAL "rapids_config_build")
foreach(target IN LISTS rapids_global_targets)
if(TARGET ${target})
get_target_property(_is_imported ${target} IMPORTED)
get_target_property(_already_global ${target} IMPORTED_GLOBAL)
if(_is_imported AND NOT _already_global)
set_target_properties(${target} PROPERTIES IMPORTED_GLOBAL TRUE)
endif()
if(NOT TARGET @RAPIDS_NAMESPACE@${target})
add_library(@RAPIDS_NAMESPACE@${target} ALIAS ${target})
endif()
endif()
endforeach()
endif()
unset(rapids_global_targets)
unset(rapids_namespaced_global_targets)
check_required_components(@project_name@)
set(${CMAKE_FIND_PACKAGE_NAME}_CONFIG "${CMAKE_CURRENT_LIST_FILE}")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(${CMAKE_FIND_PACKAGE_NAME} CONFIG_MODE HANDLE_COMPONENTS)
@RAPIDS_PROJECT_FINAL_CODE_BLOCK@