11
11
# All rights reserved. This program and the accompanying materials
12
12
# are made available under the terms of the Eclipse Public License v2.0
13
13
# and Eclipse Distribution License v1.0 which accompany this distribution.
14
- #
14
+ #
15
15
# The Eclipse Public License is available at
16
16
# http://www.eclipse.org/legal/epl-v20.html
17
17
# and the Eclipse Distribution License is available at
18
18
# http://www.eclipse.org/org/documents/edl-v10.php.
19
- #
19
+ #
20
20
# Contributors:
21
21
# Guilherme Maciel Ferreira - initial version
22
22
# Frank Pagliughi
@@ -50,14 +50,25 @@ endif()
50
50
51
51
## --- Find Paho C or build it, if reqested ---
52
52
53
+ if (PAHO_WITH_SSL )
54
+ find_package (OpenSSL REQUIRED )
55
+ set (PAHO_MQTT_C_LIB paho-mqtt3as )
56
+ else ()
57
+ set (PAHO_MQTT_C_LIB paho-mqtt3a )
58
+ endif ()
59
+
60
+ if (PAHO_BUILD_STATIC AND NOT PAHO_BUILD_SHARED )
61
+ set (PAHO_MQTT_C_LIB ${PAHO_MQTT_C_LIB} -static )
62
+ endif ()
63
+
53
64
if (PAHO_WITH_MQTT_C )
54
65
message (STATUS "Paho C: Bundled" )
55
66
56
67
## Build the Paho C library from the submodule
57
68
set (PAHO_ENABLE_TESTING FALSE CACHE BOOL "No Paho C tests" )
58
69
set (PAHO_HIGH_PERFORMANCE TRUE CACHE BOOL "Paho C high performance" )
59
70
60
- add_subdirectory (${PROJECT_SOURCE_DIR} /externals/paho-mqtt-c )
71
+ add_subdirectory (${PROJECT_SOURCE_DIR} /src/ externals/paho-mqtt-c EXCLUDE_FROM_ALL )
61
72
62
73
## Alias namespace so that the full names can be used with the subdir.
63
74
if (PAHO_BUILD_SHARED )
@@ -83,16 +94,7 @@ else()
83
94
find_package (eclipse-paho-mqtt-c REQUIRED )
84
95
endif ()
85
96
86
- if (PAHO_WITH_SSL )
87
- find_package (OpenSSL REQUIRED )
88
- set (PAHO_MQTT_C_LIB eclipse-paho-mqtt-c::paho-mqtt3as )
89
- else ()
90
- set (PAHO_MQTT_C_LIB eclipse-paho-mqtt-c::paho-mqtt3a )
91
- endif ()
92
-
93
- if (PAHO_BUILD_STATIC AND NOT PAHO_BUILD_SHARED )
94
- set (PAHO_MQTT_C_LIB ${PAHO_MQTT_C_LIB} -static )
95
- endif ()
97
+ set (PAHO_MQTT_C_LIB "eclipse-paho-mqtt-c::${PAHO_MQTT_C_LIB} " )
96
98
97
99
## --- C++11 build flags ---
98
100
@@ -161,4 +163,3 @@ endif()
161
163
include (CPack )
162
164
163
165
add_subdirectory (cmake )
164
-
0 commit comments