mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-19 04:53:02 +08:00
[paho-mqtt] Update to version 1.3.5 (#13680)
* [paho-mqtt] Update to version 1.3.5 * [paho-mqtt] Fix build error * [paho-mqttpp3] Fix build error * [paho-mqttpp3] Fix build error * [paho-mqttpp3] Fix build error * [paho-mqtt] Fix old patch * [paho-mqtt] Add vcpkg_copy_tools * [paho-mqtt] Fix build error
This commit is contained in:
parent
6a7a309ab8
commit
53b9f6eb5c
@ -1,5 +1,5 @@
|
||||
Source: paho-mqtt
|
||||
Version: 1.3.1
|
||||
Version: 1.3.5
|
||||
Homepage: https://github.com/eclipse/paho.mqtt.c
|
||||
Description: Paho project provides open-source client implementations of MQTT and MQTT-SN messaging protocols aimed at new, existing, and emerging applications for the Internet of Things
|
||||
Build-Depends: openssl
|
||||
|
@ -1,101 +0,0 @@
|
||||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
||||
index 4fdafef..dc8fd8a 100644
|
||||
--- a/src/CMakeLists.txt
|
||||
+++ b/src/CMakeLists.txt
|
||||
@@ -19,10 +19,6 @@
|
||||
# Note: on OS X you should install XCode and the associated command-line tools
|
||||
|
||||
## compilation/linkage settings
|
||||
-INCLUDE_DIRECTORIES(
|
||||
- .
|
||||
- ${CMAKE_BINARY_DIR}
|
||||
- )
|
||||
|
||||
CONFIGURE_FILE(VersionInfo.h.in
|
||||
${CMAKE_BINARY_DIR}/VersionInfo.h
|
||||
@@ -84,8 +80,17 @@ IF (NOT PAHO_BUILD_STATIC)
|
||||
paho-mqtt3c paho-mqtt3a PROPERTIES
|
||||
VERSION ${CLIENT_VERSION}
|
||||
SOVERSION ${PAHO_VERSION_MAJOR})
|
||||
+ FOREACH(TARGET paho-mqtt3c paho-mqtt3a)
|
||||
+ TARGET_INCLUDE_DIRECTORIES(${TARGET}
|
||||
+ PUBLIC
|
||||
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
+ PRIVATE
|
||||
+ ${CMAKE_BINARY_DIR})
|
||||
+ ENDFOREACH()
|
||||
|
||||
INSTALL(TARGETS paho-mqtt3c paho-mqtt3a
|
||||
+ EXPORT eclipse-paho-mqtt-cTargets
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
@@ -98,7 +103,14 @@ ELSE()
|
||||
|
||||
TARGET_LINK_LIBRARIES(paho-mqtt3c-static ${LIBS_SYSTEM})
|
||||
TARGET_LINK_LIBRARIES(paho-mqtt3a-static ${LIBS_SYSTEM})
|
||||
-
|
||||
+ FOREACH(TARGET paho-mqtt3c-static paho-mqtt3a-static)
|
||||
+ TARGET_INCLUDE_DIRECTORIES(${TARGET}
|
||||
+ PUBLIC
|
||||
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
+ PRIVATE
|
||||
+ ${CMAKE_BINARY_DIR})
|
||||
+ ENDFOREACH()
|
||||
INSTALL(TARGETS paho-mqtt3c-static paho-mqtt3a-static
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
ENDIF()
|
||||
@@ -159,7 +171,16 @@ IF (PAHO_WITH_SSL)
|
||||
VERSION ${CLIENT_VERSION}
|
||||
SOVERSION ${PAHO_VERSION_MAJOR}
|
||||
COMPILE_DEFINITIONS "OPENSSL=1")
|
||||
+ FOREACH(TARGET paho-mqtt3cs paho-mqtt3as)
|
||||
+ TARGET_INCLUDE_DIRECTORIES(${TARGET}
|
||||
+ PUBLIC
|
||||
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
+ PRIVATE
|
||||
+ ${CMAKE_BINARY_DIR})
|
||||
+ ENDFOREACH()
|
||||
INSTALL(TARGETS paho-mqtt3cs paho-mqtt3as
|
||||
+ EXPORT eclipse-paho-mqtt-cTargets
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
@@ -175,12 +196,33 @@ IF (PAHO_WITH_SSL)
|
||||
VERSION ${CLIENT_VERSION}
|
||||
SOVERSION ${PAHO_VERSION_MAJOR}
|
||||
COMPILE_DEFINITIONS "OPENSSL=1")
|
||||
-
|
||||
+ FOREACH(TARGET paho-mqtt3cs-static paho-mqtt3as-static)
|
||||
+ TARGET_INCLUDE_DIRECTORIES(${TARGET}
|
||||
+ PUBLIC
|
||||
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
+ PRIVATE
|
||||
+ ${CMAKE_BINARY_DIR})
|
||||
+ ENDFOREACH()
|
||||
INSTALL(TARGETS paho-mqtt3cs-static paho-mqtt3as-static
|
||||
+ EXPORT eclipse-paho-mqtt-cTargets
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
+INSTALL(EXPORT eclipse-paho-mqtt-cTargets
|
||||
+ FILE eclipse-paho-mqtt-cConfig.cmake
|
||||
+ NAMESPACE eclipse-paho-mqtt-c::
|
||||
+ DESTINATION share/eclipse-paho-mqtt-c)
|
||||
+
|
||||
+INCLUDE(CMakePackageConfigHelpers)
|
||||
+WRITE_BASIC_PACKAGE_VERSION_FILE("eclipse-paho-mqtt-cConfigVersion.cmake"
|
||||
+ VERSION ${CLIENT_VERSION}
|
||||
+ COMPATIBILITY SameMajorVersion)
|
||||
+INSTALL(FILES
|
||||
+ "${CMAKE_CURRENT_BINARY_DIR}/eclipse-paho-mqtt-cConfigVersion.cmake"
|
||||
+ DESTINATION share/eclipse-paho-mqtt-c)
|
||||
+
|
||||
# Base64 test
|
||||
ADD_EXECUTABLE( Base64Test EXCLUDE_FROM_ALL Base64.c Base64.h )
|
||||
TARGET_COMPILE_DEFINITIONS( Base64Test PUBLIC "-DBASE64_TEST" )
|
@ -1,56 +1,28 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 64ae92c..6d552d1 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -64,11 +64,11 @@ ENDIF()
|
||||
IF (PAHO_ENABLE_CPACK)
|
||||
### packaging settings
|
||||
FILE(GLOB samples "src/samples/*.c")
|
||||
- INSTALL(FILES ${samples} DESTINATION samples)
|
||||
+ INSTALL(FILES ${samples} DESTINATION share/paho-mqtt/samples)
|
||||
|
||||
SET(CPACK_PACKAGE_VENDOR "Eclipse Paho")
|
||||
SET(CPACK_PACKAGE_NAME "Eclipse-Paho-MQTT-C")
|
||||
- INSTALL(FILES CONTRIBUTING.md epl-v10 edl-v10 README.md notice.html DESTINATION .)
|
||||
+ INSTALL(FILES CONTRIBUTING.md epl-v10 edl-v10 README.md notice.html DESTINATION share/paho-mqtt)
|
||||
|
||||
IF (WIN32)
|
||||
SET(CPACK_GENERATOR "ZIP")
|
||||
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
|
||||
index f15f314..54deec5 100644
|
||||
--- a/doc/CMakeLists.txt
|
||||
+++ b/doc/CMakeLists.txt
|
||||
@@ -39,7 +39,7 @@ ENDFOREACH(DOXYFILE_SRC)
|
||||
|
||||
ADD_CUSTOM_TARGET(doc ALL DEPENDS ${DOXYTARGETS})
|
||||
IF (PAHO_ENABLE_CPACK)
|
||||
- INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc DESTINATION share)
|
||||
+ INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc DESTINATION share/paho-mqtt)
|
||||
ELSE()
|
||||
INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc DESTINATION ${CMAKE_INSTALL_DOCDIR})
|
||||
ENDIF()
|
||||
\ No newline at end of file
|
||||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
||||
index b46eaca..a132062 100644
|
||||
--- a/src/CMakeLists.txt
|
||||
+++ b/src/CMakeLists.txt
|
||||
@@ -89,7 +89,7 @@ INSTALL(TARGETS paho-mqtt3c paho-mqtt3a
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
INSTALL(TARGETS MQTTVersion
|
||||
- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
+ RUNTIME DESTINATION tools/paho-mqtt)
|
||||
|
||||
IF (PAHO_BUILD_STATIC)
|
||||
ADD_LIBRARY(paho-mqtt3c-static STATIC $<TARGET_OBJECTS:common_obj> MQTTClient.c)
|
||||
@@ -102,8 +102,8 @@ IF (PAHO_BUILD_STATIC)
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
ENDIF()
|
||||
|
||||
-INSTALL(FILES MQTTAsync.h MQTTClient.h MQTTClientPersistence.h MQTTProperties.h MQTTReasonCodes.h MQTTSubscribeOpts.h
|
||||
- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
+INSTALL(FILES MQTTAsync.h MQTTClient.h MQTTClientPersistence.h MQTTProperties.h MQTTReasonCodes.h MQTTSubscribeOpts.h
|
||||
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/paho-mqtt)
|
||||
|
||||
IF (PAHO_WITH_SSL)
|
||||
SET(OPENSSL_SEARCH_PATH "" CACHE PATH "Directory containing OpenSSL libraries and includes")
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 3df385a..1ee7be0 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -60,8 +60,8 @@ IF (NOT PAHO_BUILD_SHARED AND NOT PAHO_BUILD_STATIC)
|
||||
MESSAGE(FATAL_ERROR "You must set either PAHO_BUILD_SHARED, PAHO_BUILD_STATIC, or both")
|
||||
ENDIF()
|
||||
|
||||
-IF(PAHO_BUILD_DEB_PACKAGE)
|
||||
- set(CMAKE_INSTALL_DOCDIR share/doc/libpaho-mqtt)
|
||||
+IF(1)
|
||||
+ set(CMAKE_INSTALL_DOCDIR share/paho-mqtt)
|
||||
ENDIF()
|
||||
|
||||
ADD_SUBDIRECTORY(src)
|
||||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
||||
index 20b578a..75dc833 100644
|
||||
--- a/src/CMakeLists.txt
|
||||
+++ b/src/CMakeLists.txt
|
||||
@@ -183,7 +183,7 @@ IF (PAHO_BUILD_STATIC)
|
||||
ENDIF()
|
||||
|
||||
INSTALL(FILES MQTTAsync.h MQTTClient.h MQTTClientPersistence.h MQTTProperties.h MQTTReasonCodes.h MQTTSubscribeOpts.h MQTTExportDeclarations.h
|
||||
- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/paho-mqtt)
|
||||
|
||||
IF (PAHO_WITH_SSL)
|
||||
SET(OPENSSL_ROOT_DIR "" CACHE PATH "Directory containing OpenSSL libraries and includes")
|
||||
|
@ -1,97 +0,0 @@
|
||||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
||||
index 14b94b1..508c5b1 100644
|
||||
--- a/src/CMakeLists.txt
|
||||
+++ b/src/CMakeLists.txt
|
||||
@@ -65,28 +65,29 @@ ENDIF()
|
||||
ADD_LIBRARY(common_obj OBJECT ${common_src})
|
||||
SET_PROPERTY(TARGET common_obj PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
-ADD_EXECUTABLE(MQTTVersion MQTTVersion.c)
|
||||
-
|
||||
-ADD_LIBRARY(paho-mqtt3c SHARED $<TARGET_OBJECTS:common_obj> MQTTClient.c)
|
||||
-ADD_LIBRARY(paho-mqtt3a SHARED $<TARGET_OBJECTS:common_obj> MQTTAsync.c)
|
||||
-
|
||||
-TARGET_LINK_LIBRARIES(paho-mqtt3c ${LIBS_SYSTEM})
|
||||
-TARGET_LINK_LIBRARIES(paho-mqtt3a ${LIBS_SYSTEM})
|
||||
-
|
||||
-TARGET_LINK_LIBRARIES(MQTTVersion paho-mqtt3a paho-mqtt3c ${LIBS_SYSTEM})
|
||||
-SET_TARGET_PROPERTIES(
|
||||
- paho-mqtt3c paho-mqtt3a PROPERTIES
|
||||
- VERSION ${CLIENT_VERSION}
|
||||
- SOVERSION ${PAHO_VERSION_MAJOR})
|
||||
-
|
||||
-INSTALL(TARGETS paho-mqtt3c paho-mqtt3a
|
||||
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
-INSTALL(TARGETS MQTTVersion
|
||||
- RUNTIME DESTINATION tools/paho-mqtt)
|
||||
-
|
||||
-IF (PAHO_BUILD_STATIC)
|
||||
+IF (NOT PAHO_BUILD_STATIC)
|
||||
+ ADD_EXECUTABLE(MQTTVersion MQTTVersion.c)
|
||||
+
|
||||
+ ADD_LIBRARY(paho-mqtt3c SHARED $<TARGET_OBJECTS:common_obj> MQTTClient.c)
|
||||
+ ADD_LIBRARY(paho-mqtt3a SHARED $<TARGET_OBJECTS:common_obj> MQTTAsync.c)
|
||||
+
|
||||
+ TARGET_LINK_LIBRARIES(paho-mqtt3c ${LIBS_SYSTEM})
|
||||
+ TARGET_LINK_LIBRARIES(paho-mqtt3a ${LIBS_SYSTEM})
|
||||
+
|
||||
+ TARGET_LINK_LIBRARIES(MQTTVersion paho-mqtt3a paho-mqtt3c ${LIBS_SYSTEM})
|
||||
+ SET_TARGET_PROPERTIES(
|
||||
+ paho-mqtt3c paho-mqtt3a PROPERTIES
|
||||
+ VERSION ${CLIENT_VERSION}
|
||||
+ SOVERSION ${PAHO_VERSION_MAJOR})
|
||||
+
|
||||
+ INSTALL(TARGETS paho-mqtt3c paho-mqtt3a
|
||||
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
+ INSTALL(TARGETS MQTTVersion
|
||||
+ RUNTIME DESTINATION tools/paho-mqtt)
|
||||
+ELSE()
|
||||
+ message("Build as static library")
|
||||
ADD_LIBRARY(paho-mqtt3c-static STATIC $<TARGET_OBJECTS:common_obj> MQTTClient.c)
|
||||
ADD_LIBRARY(paho-mqtt3a-static STATIC $<TARGET_OBJECTS:common_obj> MQTTAsync.c)
|
||||
|
||||
@@ -132,22 +133,24 @@ IF (PAHO_WITH_SSL)
|
||||
ADD_LIBRARY(common_ssl_obj OBJECT ${common_src})
|
||||
SET_PROPERTY(TARGET common_ssl_obj PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
SET_PROPERTY(TARGET common_ssl_obj PROPERTY COMPILE_DEFINITIONS "OPENSSL=1")
|
||||
- ADD_LIBRARY(paho-mqtt3cs SHARED $<TARGET_OBJECTS:common_ssl_obj> MQTTClient.c SSLSocket.c)
|
||||
- ADD_LIBRARY(paho-mqtt3as SHARED $<TARGET_OBJECTS:common_ssl_obj> MQTTAsync.c SSLSocket.c)
|
||||
-
|
||||
- TARGET_LINK_LIBRARIES(paho-mqtt3cs ${OPENSSL_LIB} ${OPENSSLCRYPTO_LIB} ${LIBS_SYSTEM})
|
||||
- TARGET_LINK_LIBRARIES(paho-mqtt3as ${OPENSSL_LIB} ${OPENSSLCRYPTO_LIB} ${LIBS_SYSTEM})
|
||||
- SET_TARGET_PROPERTIES(
|
||||
- paho-mqtt3cs paho-mqtt3as PROPERTIES
|
||||
- VERSION ${CLIENT_VERSION}
|
||||
- SOVERSION ${PAHO_VERSION_MAJOR}
|
||||
- COMPILE_DEFINITIONS "OPENSSL=1")
|
||||
- INSTALL(TARGETS paho-mqtt3cs paho-mqtt3as
|
||||
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
-
|
||||
- IF (PAHO_BUILD_STATIC)
|
||||
+
|
||||
+ IF (NOT PAHO_BUILD_STATIC)
|
||||
+ ADD_LIBRARY(paho-mqtt3cs SHARED $<TARGET_OBJECTS:common_ssl_obj> MQTTClient.c SSLSocket.c)
|
||||
+ ADD_LIBRARY(paho-mqtt3as SHARED $<TARGET_OBJECTS:common_ssl_obj> MQTTAsync.c SSLSocket.c)
|
||||
+
|
||||
+ TARGET_LINK_LIBRARIES(paho-mqtt3cs ${OPENSSL_LIB} ${OPENSSLCRYPTO_LIB} ${LIBS_SYSTEM})
|
||||
+ TARGET_LINK_LIBRARIES(paho-mqtt3as ${OPENSSL_LIB} ${OPENSSLCRYPTO_LIB} ${LIBS_SYSTEM})
|
||||
+ SET_TARGET_PROPERTIES(
|
||||
+ paho-mqtt3cs paho-mqtt3as PROPERTIES
|
||||
+ VERSION ${CLIENT_VERSION}
|
||||
+ SOVERSION ${PAHO_VERSION_MAJOR}
|
||||
+ COMPILE_DEFINITIONS "OPENSSL=1")
|
||||
+ INSTALL(TARGETS paho-mqtt3cs paho-mqtt3as
|
||||
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
+ ELSE()
|
||||
+ message("Build as static library")
|
||||
ADD_LIBRARY(paho-mqtt3cs-static STATIC $<TARGET_OBJECTS:common_ssl_obj> MQTTClient.c SSLSocket.c)
|
||||
ADD_LIBRARY(paho-mqtt3as-static STATIC $<TARGET_OBJECTS:common_ssl_obj> MQTTAsync.c SSLSocket.c)
|
||||
|
@ -1,12 +1,12 @@
|
||||
diff --git a/src/SHA1.c b/src/SHA1.c
|
||||
index 9bb1175..b2ef930 100644
|
||||
--- a/src/SHA1.c
|
||||
+++ b/src/SHA1.c
|
||||
@@ -19,6 +19,7 @@
|
||||
#if !defined(OPENSSL)
|
||||
#if defined(WIN32) || defined(WIN64)
|
||||
#pragma comment(lib, "crypt32.lib")
|
||||
+#pragma comment(lib, "Advapi32.lib")
|
||||
|
||||
int SHA1_Init(SHA_CTX *c)
|
||||
{
|
||||
diff --git a/src/SHA1.c b/src/SHA1.c
|
||||
index 3ef07d9..f0e82ce 100644
|
||||
--- a/src/SHA1.c
|
||||
+++ b/src/SHA1.c
|
||||
@@ -19,6 +19,7 @@
|
||||
#if !defined(OPENSSL)
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
#pragma comment(lib, "crypt32.lib")
|
||||
+#pragma comment(lib, "Advapi32.lib")
|
||||
|
||||
int SHA1_Init(SHA_CTX *c)
|
||||
{
|
||||
|
@ -1,79 +0,0 @@
|
||||
diff --git a/src/MQTTProperties.h b/src/MQTTProperties.h
|
||||
index deec124..872032c 100644
|
||||
--- a/src/MQTTProperties.h
|
||||
+++ b/src/MQTTProperties.h
|
||||
@@ -50,7 +50,7 @@ enum MQTTPropertyCodes {
|
||||
MQTTPROPERTY_CODE_SHARED_SUBSCRIPTION_AVAILABLE = 42/**< The value is 241 */
|
||||
};
|
||||
|
||||
-#if defined(WIN32) || defined(WIN64)
|
||||
+#if defined(_WIN32) || defined(_WIN64)
|
||||
#define DLLImport __declspec(dllimport)
|
||||
#define DLLExport __declspec(dllexport)
|
||||
#else
|
||||
diff --git a/src/MQTTAsync.h b/src/MQTTAsync.h
|
||||
index 1b3593d..04718f8 100644
|
||||
--- a/src/MQTTAsync.h
|
||||
+++ b/src/MQTTAsync.h
|
||||
@@ -92,7 +92,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
-#if defined(WIN32) || defined(WIN64)
|
||||
+#if defined(_WIN32) || defined(_WIN64)
|
||||
#define DLLImport __declspec(dllimport)
|
||||
#define DLLExport __declspec(dllexport)
|
||||
#else
|
||||
@@ -1764,7 +1764,7 @@ int main(int argc, char* argv[])
|
||||
"on topic %s for client with ClientID: %s\n",
|
||||
PAYLOAD, TOPIC, CLIENTID);
|
||||
while (!finished)
|
||||
- #if defined(WIN32) || defined(WIN64)
|
||||
+ #if defined(_WIN32) || defined(_WIN64)
|
||||
Sleep(100);
|
||||
#else
|
||||
usleep(10000L);
|
||||
@@ -1914,7 +1914,7 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
|
||||
while (!subscribed)
|
||||
- #if defined(WIN32) || defined(WIN64)
|
||||
+ #if defined(_WIN32) || defined(_WIN64)
|
||||
Sleep(100);
|
||||
#else
|
||||
usleep(10000L);
|
||||
@@ -1935,7 +1935,7 @@ int main(int argc, char* argv[])
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
while (!disc_finished)
|
||||
- #if defined(WIN32) || defined(WIN64)
|
||||
+ #if defined(_WIN32) || defined(_WIN64)
|
||||
Sleep(100);
|
||||
#else
|
||||
usleep(10000L);
|
||||
diff --git a/src/MQTTClient.h b/src/MQTTClient.h
|
||||
index b3fadbe..130b804 100644
|
||||
--- a/src/MQTTClient.h
|
||||
+++ b/src/MQTTClient.h
|
||||
@@ -110,7 +110,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
-#if defined(WIN32) || defined(WIN64)
|
||||
+#if defined(_WIN32) || defined(_WIN64)
|
||||
#define DLLImport __declspec(dllimport)
|
||||
#define DLLExport __declspec(dllexport)
|
||||
#else
|
||||
diff --git a/src/MQTTReasonCodes.h b/src/MQTTReasonCodes.h
|
||||
index 369543b..38c299b 100644
|
||||
--- a/src/MQTTReasonCodes.h
|
||||
+++ b/src/MQTTReasonCodes.h
|
||||
@@ -66,7 +66,7 @@ enum MQTTReasonCodes {
|
||||
MQTTREASONCODE_WILDCARD_SUBSCRIPTIONS_NOT_SUPPORTED = 162
|
||||
};
|
||||
|
||||
-#if defined(WIN32) || defined(WIN64)
|
||||
+#if defined(_WIN32) || defined(_WIN64)
|
||||
#define DLLImport __declspec(dllimport)
|
||||
#define DLLExport __declspec(dllexport)
|
||||
#else
|
@ -1,34 +1,37 @@
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO eclipse/paho.mqtt.c
|
||||
REF d34c51214f4172f2e12bb17532c9f44f72a57dd4 # v1.3.1
|
||||
SHA512 184a8ace64bb967c63ac11a2476e6753d7aad39f93b290be030356841a8891edec6e0ac4b925089f2234a56f6da9c09c1a92023d3883fa785d986342bfee3972
|
||||
REF 153dfd3a4a1d510697c5d55e169fa158db16e04a # v1.3.5
|
||||
SHA512 231978c9159b85f4b189574bfe982d99ef75aabbb616bf88f251e4fe1797fd89156b4090c6d7e05703fe9394b3243a906196cb54dab3044727b03bbc64a63e5b
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
remove_compiler_options.patch
|
||||
fix-install-path.patch
|
||||
fix-static-build.patch
|
||||
fix-unresolvedsymbol-arm.patch
|
||||
export-cmake-targets.patch
|
||||
fix-win-macro.patch
|
||||
)
|
||||
|
||||
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" PAHO_BUILD_STATIC)
|
||||
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" PAHO_BUILD_DYNAMIC)
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS
|
||||
-DPAHO_WITH_SSL=TRUE
|
||||
-DPAHO_BUILD_SHARED=${PAHO_BUILD_DYNAMIC}
|
||||
-DPAHO_BUILD_STATIC=${PAHO_BUILD_STATIC}
|
||||
-DPAHO_ENABLE_TESTING=FALSE
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH share/eclipse-paho-mqtt-c TARGET_PATH share/eclipse-paho-mqtt-c)
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/eclipse-paho-mqtt-c TARGET_PATH share/eclipse-paho-mqtt-c)
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share)
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
||||
vcpkg_copy_tools(TOOL_NAMES MQTTVersion AUTO_CLEAN)
|
||||
endif()
|
||||
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/paho-mqtt/README.md ${CURRENT_PACKAGES_DIR}/share/${PORT}/readme)
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
|
||||
file(COPY ${SOURCE_PATH}/README.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
|
||||
file(INSTALL ${SOURCE_PATH}/about.html DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
||||
|
@ -1,9 +1,9 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index be8d2e8..418e2f2 100644
|
||||
index 531c39c..3df385a 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -37,7 +37,7 @@ STRING(TIMESTAMP BUILD_TIMESTAMP UTC)
|
||||
MESSAGE(STATUS "Timestamp is ${BUILD_TIMESTAMP}")
|
||||
@@ -41,7 +41,7 @@ IF (PAHO_HIGH_PERFORMANCE)
|
||||
ENDIF()
|
||||
|
||||
IF(WIN32)
|
||||
- ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -DWIN32_LEAN_AND_MEAN -MD)
|
||||
|
@ -1,5 +1,6 @@
|
||||
Source: paho-mqttpp3
|
||||
Version: 1.1
|
||||
Port-Version: 1
|
||||
Homepage: https://github.com/eclipse/paho.mqtt.cpp
|
||||
Description: Paho project provides open-source C++ wrapper for Paho C library
|
||||
Build-Depends: paho-mqtt
|
||||
|
@ -23,7 +23,7 @@ index aff9472..275655c 100644
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/@package_name@Targets.cmake")
|
||||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
||||
index 4e9b7c4..bd1e0a5 100644
|
||||
index 4e9b7c4..93eaae9 100644
|
||||
--- a/src/CMakeLists.txt
|
||||
+++ b/src/CMakeLists.txt
|
||||
@@ -23,7 +23,7 @@
|
||||
@ -35,16 +35,13 @@ index 4e9b7c4..bd1e0a5 100644
|
||||
|
||||
# --- The headers ---
|
||||
|
||||
@@ -76,17 +76,23 @@ target_include_directories(paho-cpp-objs
|
||||
src
|
||||
)
|
||||
|
||||
-
|
||||
@@ -80,13 +80,21 @@ target_include_directories(paho-cpp-objs
|
||||
## --- Build the shared library, if requested ---
|
||||
|
||||
if(PAHO_BUILD_SHARED)
|
||||
+ ## set PAHO_C_LIB
|
||||
+ if(PAHO_WITH_SSL)
|
||||
+ find_package(OpenSSL REQUIRED)
|
||||
+ set(_PAHO_MQTT_C_LIB_NAME eclipse-paho-mqtt-c::paho-mqtt3as eclipse-paho-mqtt-c::paho-mqtt3cs)
|
||||
+ else()
|
||||
+ set(_PAHO_MQTT_C_LIB_NAME eclipse-paho-mqtt-c::paho-mqtt3a eclipse-paho-mqtt-c::paho-mqtt3c)
|
||||
@ -61,13 +58,14 @@ index 4e9b7c4..bd1e0a5 100644
|
||||
|
||||
# It would be nice to exort the include paths from the obj lib, but we
|
||||
# get an export error. Perhaps in a future version?
|
||||
@@ -118,13 +124,21 @@ endif()
|
||||
@@ -118,13 +126,22 @@ endif()
|
||||
## --- Build static version of the library, if requested ---
|
||||
|
||||
if(PAHO_BUILD_STATIC)
|
||||
+
|
||||
+ ## set PAHO_C_LIB
|
||||
+ if(PAHO_WITH_SSL)
|
||||
+ find_package(OpenSSL REQUIRED)
|
||||
+ set(_PAHO_MQTT_C_LIB_NAME eclipse-paho-mqtt-c::paho-mqtt3as-static eclipse-paho-mqtt-c::paho-mqtt3cs-static)
|
||||
+ else()
|
||||
+ set(_PAHO_MQTT_C_LIB_NAME eclipse-paho-mqtt-c::paho-mqtt3a-static eclipse-paho-mqtt-c::paho-mqtt3c-static)
|
||||
|
Loading…
Reference in New Issue
Block a user