-
Notifications
You must be signed in to change notification settings - Fork 0
/
dkhConfig.cmake.in
115 lines (101 loc) · 4.17 KB
/
dkhConfig.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
# dkhConfig.cmake
# ---------------
#
# DKH cmake module.
# This module sets the following variables in your project::
#
# dkh_FOUND - true if dkh and all required components found on the system
# dkh_VERSION - dkh version in format Major.Minor.Release. Prefer target variable.
# dkh_INCLUDE_DIRS - Directories where dkh header and any dependent headers are located. Prefer targets.
# dkh_INCLUDE_DIR - Directories where dkh header is located. Prefer targets.
# dkh_DEFINITIONS: Definitions necessary to use dkh, namely USING_dkh.
# dkh_LIBRARIES - dkh library to link against plus any dependent libraries. Prefer targets.
# dkh_LIBRARY - dkh library to link against. Prefer targets.
#
#
# Target variables:
#
# It is preferred to use properties set on the base target rather than using the above variables.
#
# ::
#
# dkh_VERSION - dkh version in format Major.Minor.Release
#
# get_property(_ver TARGET dkh::dkh PROPERTY dkh_VERSION)
#
#
# Available components: shared static ::
#
# shared - search for only shared library
# static - search for only static library
#
#
# Exported targets::
#
# If dkh is found, this module defines the following :prop_tgt:`IMPORTED`
# target. Note that if dkh library is static, importing project must
# declare Fortran as a language in order to populate the link libs. ::
#
# dkh::dkh - the main dkh library with header, defs, & linker lang attached.
#
#
# Suggested usage::
#
# find_package(dkh)
# find_package(dkh 1.2 EXACT CONFIG REQUIRED COMPONENTS static)
#
#
# The following variables can be set to guide the search for this package::
#
# dkh_DIR - CMake variable, set to directory containing this Config file
# CMAKE_PREFIX_PATH - CMake variable, set to root directory of this package
# PATH - environment variable, set to bin directory of this package
# CMAKE_DISABLE_FIND_PACKAGE_dkh - CMake variable, disables
# find_package(dkh) when not REQUIRED, perhaps to force internal build
@PACKAGE_INIT@
set(dkh dkh) # NameSpace
# check library style component
if (@BUILD_SHARED_LIBS@) # BUILD_SHARED_LIBS
set(${dkh}_shared_FOUND 1)
else()
set(${dkh}_static_FOUND 1)
endif()
list(FIND ${dkh}_FIND_COMPONENTS "shared" _seek_shared)
list(FIND ${dkh}_FIND_COMPONENTS "static" _seek_static)
# make detectable the various cmake modules exported alongside
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
# check library dependency available
include(CMakeFindDependencyMacro)
if(NOT TARGET tgt::lapack)
find_dependency(TargetLAPACK)
endif()
# Check all required components are available before trying to load any
check_required_components(${dkh})
#-----------------------------------------------------------------------------
# Don't include targets if this file is being picked up by another
# project which has already built this as a subproject
#-----------------------------------------------------------------------------
if(NOT TARGET ${dkh}::dkh)
include("${CMAKE_CURRENT_LIST_DIR}/${dkh}Targets.cmake")
get_property(_loc TARGET ${dkh}::dkh PROPERTY LOCATION)
get_property(_ill TARGET ${dkh}::dkh PROPERTY INTERFACE_LINK_LIBRARIES)
get_property(_iid TARGET ${dkh}::dkh PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
get_property(_icd TARGET ${dkh}::dkh PROPERTY INTERFACE_COMPILE_DEFINITIONS)
set(${dkh}_LIBRARY ${_loc})
set(${dkh}_LIBRARIES ${_loc};${_ill})
set(${dkh}_INCLUDE_DIR ${_iid})
set(${dkh}_INCLUDE_DIRS ${_iid})
set(${dkh}_DEFINITIONS ${_icd})
if (CMAKE_VERSION VERSION_GREATER 3.15)
message(VERBOSE "dkh::dkh")
get_property(_ver TARGET ${dkh}::dkh PROPERTY dkh_VERSION)
message(VERBOSE "${dkh}::dkh.${dkh}_VERSION ${_ver}")
message(VERBOSE "${dkh}_FOUND ${${dkh}_FOUND}")
message(VERBOSE "${dkh}_VERSION ${${dkh}_VERSION}")
message(VERBOSE "${dkh}_DEFINITIONS ${${dkh}_DEFINITIONS}")
message(VERBOSE "${dkh}_LIBRARY ${${dkh}_LIBRARY}")
message(VERBOSE "${dkh}_LIBRARIES ${${dkh}_LIBRARIES}")
message(VERBOSE "${dkh}_INCLUDE_DIR ${${dkh}_INCLUDE_DIR}")
message(VERBOSE "${dkh}_INCLUDE_DIRS ${${dkh}_INCLUDE_DIRS}")
endif()
endif()