forked from OpenDDS/OpenDDS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.cmake
151 lines (123 loc) · 4.32 KB
/
init.cmake
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
# Distributed under the OpenDDS License. See accompanying LICENSE
# file or http://www.opendds.org/license.html for details.
include(${CMAKE_CURRENT_LIST_DIR}/config.cmake)
if(NOT DEFINED OPENDDS_DEBUG)
set(OPENDDS_DEBUG ON)
endif()
if(NOT DEFINED OPENDDS_INLINE)
set(OPENDDS_INLINE ON)
endif()
if(NOT DEFINED OPENDDS_BUILT_IN_TOPICS)
set(OPENDDS_BUILT_IN_TOPICS ON)
endif()
if(NOT DEFINED OPENDDS_OBJECT_MODEL_PROFILE)
set(OPENDDS_OBJECT_MODEL_PROFILE ON)
endif()
if(NOT DEFINED OPENDDS_PERSISTENCE_PROFILE)
set(OPENDDS_PERSISTENCE_PROFILE ON)
endif()
if(NOT DEFINED OPENDDS_OWNERSHIP_PROFILE)
set(OPENDDS_OWNERSHIP_PROFILE ON)
endif()
if(NOT DEFINED OPENDDS_OWNERSHIP_KIND_EXCLUSIVE)
set(OPENDDS_OWNERSHIP_KIND_EXCLUSIVE ${OPENDDS_OWNERSHIP_PROFILE})
endif()
if(NOT DEFINED OPENDDS_CONTENT_SUBSCRIPTION)
set(OPENDDS_CONTENT_SUBSCRIPTION ON)
endif()
if(NOT DEFINED OPENDDS_CONTENT_FILTERED_TOPIC)
set(OPENDDS_CONTENT_FILTERED_TOPIC ${OPENDDS_CONTENT_SUBSCRIPTION})
endif()
if(NOT DEFINED OPENDDS_MULTI_TOPIC)
set(OPENDDS_MULTI_TOPIC ${OPENDDS_CONTENT_SUBSCRIPTION})
endif()
if(NOT DEFINED OPENDDS_QUERY_CONDITION)
set(OPENDDS_QUERY_CONDITION ${OPENDDS_CONTENT_SUBSCRIPTION})
endif()
if(NOT DEFINED OPENDDS_SUPPRESS_ANYS)
set(OPENDDS_SUPPRESS_ANYS ON)
endif()
# Make Sure CMake can use the Paths
file(TO_CMAKE_PATH "${OPENDDS_ACE}" OPENDDS_ACE)
file(TO_CMAKE_PATH "${OPENDDS_MPC}" OPENDDS_MPC)
file(TO_CMAKE_PATH "${OPENDDS_TAO}" OPENDDS_TAO)
option(OPENDDS_CMAKE_VERBOSE "Print verbose output when loading the OpenDDS Config Package" OFF)
option(OPENDDS_DEFAULT_NESTED "Require topic types to be declared explicitly" ON)
option(OPENDDS_FILENAME_ONLY_INCLUDES "No directory info in generated #includes." OFF)
set(OPENDDS_DEFAULT_SCOPE "PRIVATE" CACHE STRING "Default scope for OPENDDS_TARGET_SOURCES")
set_property(CACHE OPENDDS_DEFAULT_SCOPE PROPERTY STRINGS "PUBLIC" "PRIVATE" "INTERFACE")
option(OPENDDS_ALWAYS_GENERATE_LIB_EXPORT_HEADER "Always generate an export header for libraries" OFF)
macro(_OPENDDS_RETURN_ERR msg)
message(SEND_ERROR "${msg}")
set(OPENDDS_FOUND FALSE)
return()
endmacro()
if(NOT DEFINED OPENDDS_INSTALL_LIB)
set(OPENDDS_INSTALL_LIB "lib")
endif()
if(OPENDDS_USE_PREFIX_PATH)
set(OPENDDS_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../..")
else()
set(OPENDDS_ROOT "${CMAKE_CURRENT_LIST_DIR}/..")
endif()
get_filename_component(OPENDDS_ROOT "${OPENDDS_ROOT}" ABSOLUTE)
if(NOT DEFINED DDS_ROOT)
if(OPENDDS_USE_PREFIX_PATH)
set(DDS_ROOT "${OPENDDS_ROOT}/share/dds")
set(OPENDDS_INCLUDE_DIRS "${OPENDDS_ROOT}/include")
else()
set(DDS_ROOT "${OPENDDS_ROOT}")
set(OPENDDS_INCLUDE_DIRS "${OPENDDS_ROOT}")
endif()
set(OPENDDS_BIN_DIR "${OPENDDS_ROOT}/bin")
set(OPENDDS_LIB_DIR "${OPENDDS_ROOT}/${OPENDDS_INSTALL_LIB}")
endif()
if(NOT DEFINED ACE_ROOT)
if(OPENDDS_USE_PREFIX_PATH)
set(ACE_ROOT "${OPENDDS_ROOT}/share/ace")
set(ACE_INCLUDE_DIRS "${OPENDDS_ROOT}/include")
set(ACE_LIB_DIR "${OPENDDS_ROOT}/${OPENDDS_INSTALL_LIB}")
elseif(OPENDDS_ACE)
set(ACE_ROOT ${OPENDDS_ACE})
set(ACE_INCLUDE_DIRS "${ACE_ROOT}")
set(ACE_LIB_DIR "${ACE_ROOT}/lib")
else()
_OPENDDS_RETURN_ERR("Failed to locate ACE_ROOT")
endif()
set(ACE_BIN_DIR "${ACE_ROOT}/bin")
endif()
if(NOT DEFINED TAO_ROOT)
if(OPENDDS_USE_PREFIX_PATH)
set(TAO_ROOT "${OPENDDS_ROOT}/share/tao")
set(TAO_INCLUDE_DIR "${OPENDDS_ROOT}/include")
elseif(OPENDDS_TAO)
set(TAO_ROOT "${OPENDDS_TAO}")
set(TAO_INCLUDE_DIR "${OPENDDS_TAO}")
else()
_OPENDDS_RETURN_ERR("Failed to locate TAO_ROOT")
endif()
set(TAO_BIN_DIR "${ACE_BIN_DIR}")
set(TAO_LIB_DIR "${ACE_LIB_DIR}")
set(TAO_INCLUDE_DIRS
"${TAO_INCLUDE_DIR}"
"${TAO_INCLUDE_DIR}/orbsvcs"
)
endif()
if(NOT DEFINED OPENDDS_STATIC)
set(OPENDDS_STATIC OFF)
endif()
if(OPENDDS_STATIC)
set(OPENDDS_LIBRARY_TYPE STATIC)
else()
set(OPENDDS_LIBRARY_TYPE SHARED)
endif()
if(OPENDDS_COVERAGE)
list(APPEND OPENDDS_JUST_OPENDDS_LIBS_INTERFACE_COMPILE_OPTIONS "--coverage")
list(APPEND OPENDDS_JUST_OPENDDS_LIBS_INTERFACE_LINK_OPTIONS "--coverage")
endif()
if(DEFINED OPENDDS_SANITIZER_COMPILER_ARGS)
list(APPEND OPENDDS_ALL_LIBS_INTERFACE_COMPILE_OPTIONS "${OPENDDS_SANITIZER_COMPILER_ARGS}")
endif()
if(DEFINED OPENDDS_SANITIZER_LINKER_ARGS)
list(APPEND OPENDDS_ALL_LIBS_INTERFACE_LINK_OPTIONS "${OPENDDS_SANITIZER_LINKER_ARGS}")
endif()