File: Config.cmake.in

package info (click to toggle)
fastcdr 2.3.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,412 kB
  • sloc: cpp: 38,058; ansic: 80; xml: 22; makefile: 19; sh: 16
file content (79 lines) | stat: -rw-r--r-- 2,852 bytes parent folder | download | duplicates (2)
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
# 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@

@FASTCDR_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@")

set(fastcdr_known_comps static shared)
set(fastcdr_comp_static NO)
set(fastcdr_comp_shared NO)
foreach (fastcdr_comp IN LISTS ${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS)
    if (fastcdr_comp IN_LIST fastcdr_known_comps)
        set(fastcdr_comp_${fastcdr_comp} YES)
    else ()
        set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE
            "fastcdr does not recognize component `${fastcdr_comp}`.")
        set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
        return()
    endif ()
endforeach ()

if (fastcdr_comp_static AND fastcdr_comp_shared)
    set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE
        "fastcdr `static` and `shared` components are mutually exclusive.")
    set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
    return()
endif ()

set(fastcdr_static_targets "${CMAKE_CURRENT_LIST_DIR}/fastcdr-static-targets.cmake")
set(fastcdr_shared_targets "${CMAKE_CURRENT_LIST_DIR}/fastcdr-shared-targets.cmake")

macro(fastcdr_load_targets type)
    if (NOT EXISTS "${fastcdr_${type}_targets}")
        set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE
            "fastcdr `${type}` libraries were requested but not found.")
        set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
        return()
    endif ()
    include("${fastcdr_${type}_targets}")
endmacro()

if (fastcdr_comp_static)
    fastcdr_load_targets(static)
elseif (fastcdr_comp_shared)
    fastcdr_load_targets(shared)
elseif (DEFINED fastcdr_SHARED_LIBS AND fastcdr_SHARED_LIBS)
    fastcdr_load_targets(shared)
elseif (DEFINED fastcdr_SHARED_LIBS AND NOT fastcdr_SHARED_LIBS)
    fastcdr_load_targets(static)
elseif (BUILD_SHARED_LIBS)
    if (EXISTS "${fastcdr_shared_targets}")
        fastcdr_load_targets(shared)
    else ()
        fastcdr_load_targets(static)
    endif ()
else ()
    if (EXISTS "${fastcdr_static_targets}")
        fastcdr_load_targets(static)
    else ()
        fastcdr_load_targets(shared)
    endif ()
endif ()