-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathPCMSolverConfig.cmake.in
More file actions
161 lines (146 loc) · 6.3 KB
/
PCMSolverConfig.cmake.in
File metadata and controls
161 lines (146 loc) · 6.3 KB
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# PCMSolverConfig.cmake
# ---------------------
#
# PCMSolver cmake module.
# This module sets the following variables in your project:
#
# ::
#
# PCMSolver_FOUND - true if PCMSolver and all required components found on the system
# PCMSolver_VERSION - PCMSolver version in format Major.Minor.Release.
# PCMSolver_INCLUDE_DIRS - Directory where the PCMSolver/pcmsolver.h,
# PCMSolver/PCMInput.h headers and PCMSolver/pcmsolver.f90 source file are located.
# Prefer targets.
# PCMSolver_INCLUDE_DIR - same as DIRS. Prefer targets.
# PCMSolver_DEFINITIONS: Definitions necessary to use PCMSolver, namely USING_PCMSolver. Prefer targets.
# PCMSolver_LIBRARIES - PCMSolver library to link against plus any dependent libraries. Prefer targets.
# PCMSolver_LIBRARY - same as LIBRARIES. Prefer targets.
# PCMSolver_EXECUTABLE - path to PCMSolver executable. Prefer targets.
# PCMSolver_PYMOD - path to PCMSolver python modules. Prefer target variable.
#
#
# Target variables:
#
# It is preferred to use properties set on the base target rather than using the above variables.
#
# ::
#
# PCMSolver_VERSION - (DNE) PCMSolver version in format Major.Minor.Release . Does not exist b/c computed at compile-time.
# PCMSolver_PYMOD - path to PCMSolver python modules
#
# get_property(_pym TARGET PCMSolver::pcm PROPERTY PCMSolver_PYMOD)
#
#
# Available components: shared static exe
#
# ::
#
# shared - search for only shared library
# static - search for only static library
# exe - search for executable as well as library
#
#
# Exported targets:
#
# ::
#
# If PCMSolver is found and no language components are requested, this module
# defines at least the following :prop_tgt:`IMPORTED` target. ::
#
# PCMSolver::pcm - the main PCMSolver library with header & defs attached.
#
# If PCMSolver is found, depending on components requested and fullness of the
# installation, this module defines up to the following :prop_tgt:`IMPORTED` targets. ::
#
# PCMSolver::pcm - the main PCMSolver library with header & defs attached.
# PCMSolver::exe - the PCMSolver run_pcm program (COMPONENT exe)
#
#
# Suggested usage:
#
# ::
#
# find_package(PCMSolver)
# find_package(PCMSolver 1.2.3 CONFIG REQUIRED COMPONENTS shared)
#
#
# The following variables can be set to guide the search for this package:
#
# ::
#
# PCMSolver_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_PCMSolver - CMake variable, disables
# find_package(PCMSolver) perhaps to force internal build
#
@PACKAGE_INIT@
set(pcm PCMSolver) # NameSpace
# check library style component
# * using EXISTS Targets-shared instead of @SHARED_LIBRARY_ONLY@ so packages can
# truncate their builds (e.g., build static for tests but only ship shared)
if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/${pcm}Targets-shared.cmake")
set(${pcm}_shared_FOUND 1)
endif()
if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/${pcm}Targets-static.cmake")
set(${pcm}_static_FOUND 1)
endif()
list(FIND ${pcm}_FIND_COMPONENTS "shared" _seek_shared)
list(FIND ${pcm}_FIND_COMPONENTS "static" _seek_static)
# check executable component
if (@BUILD_STANDALONE@ AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/${pcm}Targets-exe.cmake") # BUILD_STANDALONE
set(${pcm}_exe_FOUND 1)
endif()
list(FIND ${pcm}_FIND_COMPONENTS "exe" _seek_exe)
# check library dependency available
include(CMakeFindDependencyMacro)
if(NOT TARGET ZLIB::ZLIB)
find_dependency(ZLIB)
endif()
# Check all required components are available before trying to load any
check_required_components(${pcm})
#-----------------------------------------------------------------------------
# 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 ${pcm}::pcm)
if(_seek_static GREATER -1)
include("${CMAKE_CURRENT_LIST_DIR}/${pcm}Targets-static.cmake")
elseif(_seek_shared GREATER -1)
include("${CMAKE_CURRENT_LIST_DIR}/${pcm}Targets-shared.cmake")
elseif(NOT @STATIC_LIBRARY_ONLY@) # STATIC_LIBRARY_ONLY
include("${CMAKE_CURRENT_LIST_DIR}/${pcm}Targets-shared.cmake")
elseif(NOT @SHARED_LIBRARY_ONLY@) # SHARED_LIBRARY_ONLY
include("${CMAKE_CURRENT_LIST_DIR}/${pcm}Targets-static.cmake")
endif()
get_property(_loc TARGET ${pcm}::pcm PROPERTY LOCATION)
get_property(_ill TARGET ${pcm}::pcm PROPERTY INTERFACE_LINK_LIBRARIES)
get_property(_iid TARGET ${pcm}::pcm PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
get_property(_icd TARGET ${pcm}::pcm PROPERTY INTERFACE_COMPILE_DEFINITIONS)
set(${pcm}_LIBRARY ${_loc})
set(${pcm}_LIBRARIES ${_loc};${_ill})
set(${pcm}_INCLUDE_DIR ${_iid})
set(${pcm}_INCLUDE_DIRS ${_iid})
set(${pcm}_DEFINITIONS ${_icd})
if(${pcm}_exe_FOUND)
include("${CMAKE_CURRENT_LIST_DIR}/${pcm}Targets-exe.cmake")
get_property(${pcm}_EXECUTABLE TARGET ${pcm}::exe PROPERTY LOCATION)
endif()
set(${pcm}_PYMOD ${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_LIBDIR@@PYMOD_INSTALL_LIBDIR@) # CMAKE_INSTALL_LIBDIR, PYMOD_INSTALL_LIBDIR
if (CMAKE_VERSION VERSION_GREATER 3.15)
message(VERBOSE "PCMSolver::pcm")
get_property(_ver TARGET ${pcm}::pcm PROPERTY PCMSolver_VERSION)
get_property(_pym TARGET ${pcm}::pcm PROPERTY PCMSolver_PYMOD)
message(VERBOSE "${pcm}::pcm.${pcm}_VERSION (DNE) ${_ver}")
message(VERBOSE "${pcm}::pcm.${pcm}_PYMOD ${_pym}")
message(VERBOSE "${pcm}_FOUND ${${pcm}_FOUND}")
message(VERBOSE "${pcm}_VERSION ${${pcm}_VERSION}")
message(VERBOSE "${pcm}_DEFINITIONS ${${pcm}_DEFINITIONS}")
message(VERBOSE "${pcm}_EXECUTABLE ${${pcm}_EXECUTABLE}")
message(VERBOSE "${pcm}_PYMOD ${${pcm}_PYMOD}")
message(VERBOSE "${pcm}_LIBRARY ${${pcm}_LIBRARY}")
message(VERBOSE "${pcm}_LIBRARIES ${${pcm}_LIBRARIES}")
message(VERBOSE "${pcm}_INCLUDE_DIR ${${pcm}_INCLUDE_DIR}")
message(VERBOSE "${pcm}_INCLUDE_DIRS ${${pcm}_INCLUDE_DIRS}")
endif()
endif()