-
Notifications
You must be signed in to change notification settings - Fork 799
/
Copy pathConfig.cmake.in
92 lines (80 loc) · 3.1 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
# Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
#
# 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.
set(@PROJECT_NAME@_VERSION @PROJECT_VERSION@)
@PACKAGE_INIT@
@FASTDDS_PACKAGE_OPT_BIN_DIR_CONDITION@
set_and_check(@PROJECT_NAME@_BIN_DIR "@PACKAGE_BIN_INSTALL_DIR@")
endif()
set_and_check(@PROJECT_NAME@_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
set_and_check(@PROJECT_NAME@_LIB_DIR "@PACKAGE_LIB_INSTALL_DIR@")
find_package(fastcdr REQUIRED)
find_package(foonathan_memory REQUIRED)
find_package(TinyXML2 QUIET)
@FASTDDS_INSTALLER_DEPS_ANCILLARY@
@FASTDDS_PACKAGE_UNIX_OPT_DEPS@
set(fastdds_known_comps static shared)
set(fastdds_comp_static NO)
set(fastdds_comp_shared NO)
foreach (fastdds_comp IN LISTS ${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS)
if (fastdds_comp IN_LIST fastdds_known_comps)
set(fastdds_comp_${fastdds_comp} YES)
else ()
set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE
"fastdds does not recognize component `${fastdds_comp}`.")
set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
return()
endif ()
endforeach ()
if (fastdds_comp_static AND fastdds_comp_shared)
set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE
"fastdds `static` and `shared` components are mutually exclusive.")
set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
return()
endif ()
set(fastdds_static_targets "${CMAKE_CURRENT_LIST_DIR}/fastdds-static-targets.cmake")
set(fastdds_shared_targets "${CMAKE_CURRENT_LIST_DIR}/fastdds-shared-targets.cmake")
macro(fastdds_load_targets type)
if (NOT EXISTS "${fastdds_${type}_targets}")
set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE
"fastdds `${type}` libraries were requested but not found.")
set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
return()
endif ()
# find related dependency packages like OpenSSL
@FASTDDS_INSTALLER_OPT_DEPS@
@FASTDDS_PACKAGE_WIN32_OPT_DEPS@
include("${fastdds_${type}_targets}")
endmacro()
if (fastdds_comp_static)
fastdds_load_targets(static)
elseif (fastdds_comp_shared)
fastdds_load_targets(shared)
elseif (DEFINED fastdds_SHARED_LIBS AND fastdds_SHARED_LIBS)
fastdds_load_targets(shared)
elseif (DEFINED fastdds_SHARED_LIBS AND NOT fastdds_SHARED_LIBS)
fastdds_load_targets(static)
elseif (BUILD_SHARED_LIBS)
if (EXISTS "${fastdds_shared_targets}")
fastdds_load_targets(shared)
else ()
fastdds_load_targets(static)
endif ()
else ()
if (EXISTS "${fastdds_static_targets}")
fastdds_load_targets(static)
else ()
fastdds_load_targets(shared)
endif ()
endif ()
@INCLUDE_FASTDDS_TARGETS@