forked from KoynovStas/onvif_srvd
-
Notifications
You must be signed in to change notification settings - Fork 1
/
FindgSOAP.cmake
210 lines (161 loc) · 5.44 KB
/
FindgSOAP.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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# SPDX-License-Identifier: MIT
#
# Copyright (C) Koynov Stas - skojnov@yandex.ru
#
#
# This module try find the system gsoap
#
# This code sets the following variables:
#
# GSOAP_VERSION = gSOAP version
#
# GSOAP_INCLUDE_DIR = Full path to the main gSOAP header stdsoap2.h
# GSOAP_CUSTOM_DIR = Full path to gSOAP custom serializers for various data types
# GSOAP_IMPORT_DIR = Full path to gSOAP import-ed header files for soapcpp2 compiler
# GSOAP_PLUGIN_DIR = Full path to gSOAP plug-ins for advanced features
# GSOAP_WS_DIR = Full path to gSOAP WS-typemap.dat and WS-* protocol schemas for plug-in development
#
# GSOAP_C_LIBRARY = Full path to libgsoap.a
# GSOAP_CK_C_LIBRARY = Full path to libgsoapck.a
# GSOAP_SSL_C_LIBRARY = Full path to libgsoapssl.a
# GSOAP_CXX_LIBRARY = Full path to libgsoap++.a
# GSOAP_CK_CXX_LIBRARY = Full path to libgsoapck++.a
# GSOAP_SSL_CXX_LIBRARY = Full path to libgsoapssl++.a
#
# GSOAP_WSDL2H = Full path to wsdl2h binary tool
# GSOAP_SOAPCPP2 = Full path to soapcpp2 binary tool
#
# GSOAP_FOUND = set to true if gsoap was found successfully
message(STATUS "Searching gSOAP")
find_path(GSOAP_INCLUDE_DIR
NAMES stdsoap2.h
HINTS ${GSOAP_DIR} ${GSOAP_DIR}/include ${GSOAP_DIR}/include/*
DOC "The main gSOAP header"
)
find_path(GSOAP_CUSTOM_DIR
NAMES chrono_duration.cpp
HINTS ${GSOAP_DIR}/custom /usr/share/gsoap/custom
DOC "gSOAP custom serializers for various data types"
)
find_path(GSOAP_IMPORT_DIR
NAMES wsa.h
HINTS ${GSOAP_DIR}/import /usr/share/gsoap/import
DOC "gSOAP import-ed header files for soapcpp2 compiler"
)
find_path(GSOAP_PLUGIN_DIR
NAMES wsaapi.h
HINTS ${GSOAP_DIR}/plugin /usr/share/gsoap/plugin
DOC "gSOAP plug-ins for advanced features"
)
find_path(GSOAP_WS_DIR
NAMES typemap.dat
HINTS ${GSOAP_DIR}/WS /usr/share/gsoap/WS
DOC "gSOAP WS-typemap.dat and WS-* protocol schemas for plug-in development"
)
# user want use only static library
if(DEFINED USE_GSOAP_STATIC_LIB)
set(CMAKE_FIND_LIBRARY_SUFFIXES_OLD ${CMAKE_FIND_LIBRARY_SUFFIXES})
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
endif()
# C Library
find_library(GSOAP_C_LIBRARY
NAMES gsoap
HINTS ${GSOAP_DIR} ${GSOAP_DIR}/lib ${GSOAP_DIR}/lib64
${GSOAP_DIR}/lib32
)
find_library(GSOAP_CK_C_LIBRARY
NAMES gsoapck
HINTS ${GSOAP_DIR} ${GSOAP_DIR}/lib ${GSOAP_DIR}/lib64
${GSOAP_DIR}/lib32
)
find_library(GSOAP_SSL_C_LIBRARY
NAMES gsoapssl
HINTS ${GSOAP_DIR} ${GSOAP_DIR}/lib ${GSOAP_DIR}/lib64
${GSOAP_DIR}/lib32
)
# C++ Library
find_library(GSOAP_CXX_LIBRARY
NAMES gsoap++
HINTS ${GSOAP_DIR} ${GSOAP_DIR}/lib ${GSOAP_DIR}/lib64
${GSOAP_DIR}/lib32
)
find_library(GSOAP_CK_CXX_LIBRARY
NAMES gsoapck++
HINTS ${GSOAP_DIR} ${GSOAP_DIR}/lib ${GSOAP_DIR}/lib64
${GSOAP_DIR}/lib32
)
find_library(GSOAP_SSL_CXX_LIBRARY
NAMES gsoapssl++
HINTS ${GSOAP_DIR} ${GSOAP_DIR}/lib ${GSOAP_DIR}/lib64
${GSOAP_DIR}/lib32
)
# restore old value for CMAKE_FIND_LIBRARY_SUFFIXES
if(DEFINED USE_GSOAP_STATIC_LIB)
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_OLD})
unset(CMAKE_FIND_LIBRARY_SUFFIXES_OLD)
endif()
# gSOAP tools
find_program(GSOAP_WSDL2H
NAMES wsdl2h
HINTS ${GSOAP_DIR}/wsdl ${GSOAP_DIR}/bin
)
find_program(GSOAP_SOAPCPP2
NAMES soapcpp2
HINTS ${GSOAP_DIR}/src ${GSOAP_DIR}/bin
)
# Try get gSOAP version
execute_process(COMMAND ${GSOAP_SOAPCPP2} "-V"
OUTPUT_VARIABLE GSOAP_STRING_VERSION
ERROR_VARIABLE GSOAP_STRING_VERSION
)
string(REGEX MATCH "[0-9]*\\.[0-9]*\\.[0-9]*" GSOAP_VERSION ${GSOAP_STRING_VERSION})
unset(GSOAP_STRING_VERSION)
# Show find results
message(STATUS "GSOAP_VERSION = ${GSOAP_VERSION}")
if(DEFINED GSOAP_DIR)
message(STATUS "GSOAP_DIR = ${GSOAP_DIR}")
endif()
message(STATUS "GSOAP_INCLUDE_DIR = ${GSOAP_INCLUDE_DIR}")
message(STATUS "GSOAP_CUSTOM_DIR = ${GSOAP_CUSTOM_DIR}")
message(STATUS "GSOAP_IMPORT_DIR = ${GSOAP_IMPORT_DIR}")
message(STATUS "GSOAP_PLUGIN_DIR = ${GSOAP_PLUGIN_DIR}")
message(STATUS "GSOAP_WS_DIR = ${GSOAP_WS_DIR}")
message(STATUS "GSOAP_C_LIBRARY = ${GSOAP_C_LIBRARY}")
message(STATUS "GSOAP_CK_C_LIBRARY = ${GSOAP_CK_C_LIBRARY}")
message(STATUS "GSOAP_SSL_C_LIBRARY = ${GSOAP_SSL_C_LIBRARY}")
message(STATUS "GSOAP_CXX_LIBRARY = ${GSOAP_CXX_LIBRARY}")
message(STATUS "GSOAP_CK_CXX_LIBRARY = ${GSOAP_CK_CXX_LIBRARY}")
message(STATUS "GSOAP_SSL_CXX_LIBRARY = ${GSOAP_SSL_CXX_LIBRARY}")
message(STATUS "GSOAP_SOAPCPP2 = ${GSOAP_SOAPCPP2}")
message(STATUS "GSOAP_WSDL2H = ${GSOAP_WSDL2H}")
# -----------------------------------------------------
# handle the QUIETLY and REQUIRED arguments and set GSOAP_FOUND to TRUE if
# all listed variables are TRUE
# -----------------------------------------------------
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(gSOAP DEFAULT_MSG
GSOAP_C_LIBRARY
GSOAP_SSL_C_LIBRARY
GSOAP_CXX_LIBRARY
GSOAP_SSL_CXX_LIBRARY
GSOAP_INCLUDE_DIR
GSOAP_CUSTOM_DIR
GSOAP_IMPORT_DIR
GSOAP_PLUGIN_DIR
GSOAP_SOAPCPP2
GSOAP_WSDL2H
)
mark_as_advanced(
GSOAP_C_LIBRARY
GSOAP_CK_C_LIBRARY
GSOAP_SSL_C_LIBRARY
GSOAP_CXX_LIBRARY
GSOAP_CK_CXX_LIBRARY
GSOAP_SSL_CXX_LIBRARY
GSOAP_INCLUDE_DIR
GSOAP_CUSTOM_DIR
GSOAP_IMPORT_DIR
GSOAP_PLUGIN_DIR
GSOAP_SOAPCPP2
GSOAP_WSDL2H
)