diff --git a/recipes/paho-mqtt-c/all/conandata.yml b/recipes/paho-mqtt-c/all/conandata.yml index 5ad1371fba68b..765cd59200376 100644 --- a/recipes/paho-mqtt-c/all/conandata.yml +++ b/recipes/paho-mqtt-c/all/conandata.yml @@ -21,30 +21,22 @@ patches: "1.3.0": - patch_file: "patches/0001-fix-MinGW-and-OSX-builds-for-1-3-0.patch" base_path: "source_subfolder" - - patch_file: "patches/0003-fix-cmake-install.patch" + - patch_file: "patches/0004-fix-cmake-find-openssl.patch" base_path: "source_subfolder" "1.3.1": - patch_file: "patches/0002-fix-MinGW-and-OSX-builds-for-1-3-1.patch" base_path: "source_subfolder" - - patch_file: "patches/0003-fix-cmake-install.patch" + - patch_file: "patches/0004-fix-cmake-find-openssl.patch" base_path: "source_subfolder" "1.3.4": - patch_file: "patches/0002-fix-MinGW-and-OSX-builds-for-1-3-4.patch" base_path: "source_subfolder" - - patch_file: "patches/0004-fix-cmake-install.patch" - base_path: "source_subfolder" "1.3.5": - - patch_file: "patches/0002-fix-MinGW-and-OSX-builds-for-1-3-5.patch" - base_path: "source_subfolder" - - patch_file: "patches/0004-fix-cmake-install.patch" + - patch_file: "patches/0003-allow-static-windows-runtimes.patch" base_path: "source_subfolder" "1.3.6": - - patch_file: "patches/0002-fix-MinGW-and-OSX-builds-for-1-3-5.patch" - base_path: "source_subfolder" - - patch_file: "patches/0004-fix-cmake-install.patch" + - patch_file: "patches/0003-allow-static-windows-runtimes.patch" base_path: "source_subfolder" "1.3.8": - - patch_file: "patches/0002-fix-MinGW-and-OSX-builds-for-1-3-5.patch" - base_path: "source_subfolder" - - patch_file: "patches/0005-fix-cmake-install-for-1-3-8.patch" + - patch_file: "patches/0003-allow-static-windows-runtimes.patch" base_path: "source_subfolder" diff --git a/recipes/paho-mqtt-c/all/conanfile.py b/recipes/paho-mqtt-c/all/conanfile.py index e3932924a5be3..35b1572c05156 100644 --- a/recipes/paho-mqtt-c/all/conanfile.py +++ b/recipes/paho-mqtt-c/all/conanfile.py @@ -1,27 +1,34 @@ -import os from conans import CMake, ConanFile, tools from conans.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.29.1" + class PahoMqttcConan(ConanFile): name = "paho-mqtt-c" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/eclipse/paho.mqtt.c" - topics = ("MQTT", "IoT", "eclipse", "SSL", "paho", "C") + topics = ("mqtt", "iot", "eclipse", "ssl", "tls", "paho", "c") license = "EPL-2.0" description = "Eclipse Paho MQTT C client library for Linux, Windows and MacOS" exports_sources = ["CMakeLists.txt", "patches/*"] generators = "cmake" settings = "os", "arch", "compiler", "build_type" - options = {"shared": [True, False], - "fPIC": [True, False], - "ssl": [True, False], - "samples": [True, False], - "asynchronous": [True, False]} - default_options = {"shared": False, - "fPIC": True, - "ssl": True, - "asynchronous" : True, - "samples": False} + options = { + "shared": [True, False], + "fPIC": [True, False], + "ssl": [True, False], + "asynchronous": [True, False], + "samples": [True, False, "deprecated"] + } + default_options = { + "shared": False, + "fPIC": True, + "ssl": True, + "asynchronous": True, + "samples": "deprecated" + } _cmake = None @@ -32,20 +39,22 @@ def _source_subfolder(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - # There is unsureness if static linking before 1.3.4 did every work. - # If you need it, teak here, on Linux and OSX you might have success. - if tools.Version(self.version) < "1.3.4": - self.options.shared = True def configure(self): + if self.options.shared: + del self.options.fPIC del self.settings.compiler.cppstd del self.settings.compiler.libcxx - if self.options.shared == False and self.settings.os == "Windows" and tools.Version(self.version) < "1.3.4": - raise ConanInvalidConfiguration("Static linking in Windows did not work before version 1.3.4") + + if self.options.samples != "deprecated": + self.output.warn("samples option is deprecated and they are no longer provided in the package.") + + if not self.options.shared and tools.Version(self.version) < "1.3.4": + raise ConanInvalidConfiguration("{}/{} does not support static linking".format(self.name, self.version)) def requirements(self): if self.options.ssl: - self.requires("openssl/1.1.1i") + self.requires("openssl/1.1.1k") def source(self): tools.get(**self.conan_data["sources"][self.version]) @@ -63,39 +72,45 @@ def _configure_cmake(self): self._cmake.definitions["PAHO_BUILD_ASYNC"] = self.options.asynchronous self._cmake.definitions["PAHO_BUILD_STATIC"] = not self.options.shared self._cmake.definitions["PAHO_BUILD_SHARED"] = self.options.shared - self._cmake.definitions["PAHO_BUILD_SAMPLES"] = self.options.samples + self._cmake.definitions["PAHO_BUILD_SAMPLES"] = False self._cmake.definitions["PAHO_WITH_SSL"] = self.options.ssl if self.options.ssl: - self._cmake.definitions["OPENSSL_SEARCH_PATH"] = self.deps_cpp_info["openssl"].rootpath - self._cmake.definitions["OPENSSL_ROOT_DIR"] = self.deps_cpp_info["openssl"].rootpath + self._cmake.definitions["OPENSSL_SEARCH_PATH"] = self.deps_cpp_info["openssl"].rootpath.replace("\\", "/") + self._cmake.definitions["OPENSSL_ROOT_DIR"] = self.deps_cpp_info["openssl"].rootpath.replace("\\", "/") self._cmake.configure() return self._cmake - def build(self): + def _patch_source(self): for patch in self.conan_data.get("patches", {}).get(self.version, []): tools.patch(**patch) + if not self.options.get_safe("fPIC", True): + tools.replace_in_file(os.path.join(self._source_subfolder, "src", "CMakeLists.txt"), "POSITION_INDEPENDENT_CODE ON", "") + + def build(self): + self._patch_source() cmake = self._configure_cmake() - cmake.build() + cmake.build(target=self._cmake_target) def package(self): self.copy("edl-v10", src=self._source_subfolder, dst="licenses") - if self.version in ['1.3.0', '1.3.1']: - eplfile = "epl-v10" - else: - eplfile = "epl-v20" # EPL changed to V2 - self.copy(eplfile, src=self._source_subfolder, dst="licenses") + self.copy(self._epl_file, src=self._source_subfolder, dst="licenses") self.copy("notice.html", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() - cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - tools.rmdir(os.path.join(self.package_folder, "share")) + # Manually copy since the CMake installs everything + self.copy(pattern="MQTT*.h", src=os.path.join(self._source_subfolder, "src"), dst="include") + self.copy(os.path.join("lib", "*{}.*".format(self._lib_target)), dst="lib", keep_path=False) + self.copy(os.path.join("bin", "*{}.*".format(self._lib_target)), dst="bin", keep_path=False) + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.pdb") + tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "*.pdb") + def package_id(self): + del self.info.options.samples + def package_info(self): self.cpp_info.names["cmake_find_package"] = "eclipse-paho-mqtt-c" self.cpp_info.names["cmake_find_package_multi"] = "eclipse-paho-mqtt-c" self.cpp_info.components["_paho-mqtt-c"].names["cmake_find_package"] = self._cmake_target self.cpp_info.components["_paho-mqtt-c"].names["cmake_find_package_multi"] = self._cmake_target - self.cpp_info.components["_paho-mqtt-c"].libs = tools.collect_libs(self) + self.cpp_info.components["_paho-mqtt-c"].libs = [self._lib_target] if self.settings.os == "Windows": if not self.options.shared: self.cpp_info.components["_paho-mqtt-c"].system_libs.append("ws2_32") @@ -111,9 +126,14 @@ def package_info(self): self.cpp_info.components["_paho-mqtt-c"].system_libs.extend(["c"]) else: self.cpp_info.components["_paho-mqtt-c"].system_libs.extend(["c", "pthread"]) + if self.options.ssl: self.cpp_info.components["_paho-mqtt-c"].requires = ["openssl::openssl"] + @property + def _epl_file(self): + return "epl-v10" if self.version in ['1.3.0', '1.3.1'] else "epl-v20" # EPL changed to V2 + @property def _cmake_target(self): target = "paho-mqtt3" @@ -123,3 +143,15 @@ def _cmake_target(self): if not self.options.shared: target += "-static" return target + + @property + def _lib_target(self): + target = "paho-mqtt3" + target += "a" if self.options.asynchronous else "c" + if self.options.ssl: + target += "s" + if not self.options.shared: + # https://github.com/eclipse/paho.mqtt.c/blob/317fb008e1541838d1c29076d2bc5c3e4b6c4f53/src/CMakeLists.txt#L154 + if tools.Version(self.version) < "1.3.2" or self.settings.os == "Windows": + target += "-static" + return target diff --git a/recipes/paho-mqtt-c/all/patches/0002-fix-MinGW-and-OSX-builds-for-1-3-5.patch b/recipes/paho-mqtt-c/all/patches/0003-allow-static-windows-runtimes.patch similarity index 100% rename from recipes/paho-mqtt-c/all/patches/0002-fix-MinGW-and-OSX-builds-for-1-3-5.patch rename to recipes/paho-mqtt-c/all/patches/0003-allow-static-windows-runtimes.patch diff --git a/recipes/paho-mqtt-c/all/patches/0003-fix-cmake-install.patch b/recipes/paho-mqtt-c/all/patches/0003-fix-cmake-install.patch deleted file mode 100644 index bc1466d06caeb..0000000000000 --- a/recipes/paho-mqtt-c/all/patches/0003-fix-cmake-install.patch +++ /dev/null @@ -1,221 +0,0 @@ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index b46eaca..d8df5ba 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -68,69 +68,18 @@ ENDIF() - - ## common compilation for libpaho-mqtt3c and libpaho-mqtt3a - 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 $ MQTTClient.c) --ADD_LIBRARY(paho-mqtt3a SHARED $ 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 ${CMAKE_INSTALL_BINDIR}) -- --IF (PAHO_BUILD_STATIC) -- ADD_LIBRARY(paho-mqtt3c-static STATIC $ MQTTClient.c) -- ADD_LIBRARY(paho-mqtt3a-static STATIC $ MQTTAsync.c) -- -- TARGET_LINK_LIBRARIES(paho-mqtt3c-static ${LIBS_SYSTEM}) -- TARGET_LINK_LIBRARIES(paho-mqtt3a-static ${LIBS_SYSTEM}) -- -- INSTALL(TARGETS paho-mqtt3c-static paho-mqtt3a-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}) - - IF (PAHO_WITH_SSL) - SET(OPENSSL_SEARCH_PATH "" CACHE PATH "Directory containing OpenSSL libraries and includes") -- -- IF (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") -- SET(OPENSSL_SEARCH_PATH "/usr/local/opt/openssl") -- ENDIF (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") -- -- IF (WIN32) -- SET(OPENSSL_SEARCH_PATH "C:/OpenSSL-Win64") -- SET(OPENSSL_SEARCH_LIB_PATH "${OPENSSL_SEARCH_PATH}/lib64") -- IF (DEFINED ENV{PAHO_WINDOWS_BUILD_BIT}) -- IF ($ENV{PAHO_WINDOWS_BUILD_BIT} STREQUAL "x86") -- SET(OPENSSL_SEARCH_PATH "C:/OpenSSL-Win32") -- SET(OPENSSL_SEARCH_LIB_PATH "${OPENSSL_SEARCH_PATH}/lib32") -- ENDIF () -- ENDIF () -- ELSE() -- SET(OPENSSL_SEARCH_LIB_PATH "${OPENSSL_SEARCH_PATH}/lib64") -- ENDIF () -- -- FIND_PATH(OPENSSL_INCLUDE_DIR openssl/ssl.h -- HINTS ${OPENSSL_SEARCH_PATH}/include) -- FIND_LIBRARY(OPENSSL_LIB NAMES ssl libssl ssleay32 -- HINTS ${OPENSSL_SEARCH_PATH}/lib ${OPENSSL_SEARCH_LIB_PATH}) -- FIND_LIBRARY(OPENSSLCRYPTO_LIB NAMES crypto libcrypto libeay32 -- HINTS ${OPENSSL_SEARCH_PATH}/lib ${OPENSSL_SEARCH_LIB_PATH}) -+ SET(OPENSSL_ROOT_DIR "" CACHE PATH "Directory containing OpenSSL libraries and includes") -+ -+ find_package(OpenSSL REQUIRED) -+ -+ SET(OPENSSL_LIB ${OPENSSL_SSL_LIBRARY}) -+ SET(OPENSSLCRYPTO_LIB ${OPENSSL_CRYPTO_LIBRARY}) - - MESSAGE(STATUS "OpenSSL hints: ${OPENSSL_SEARCH_PATH}") - MESSAGE(STATUS "OpenSSL headers found at ${OPENSSL_INCLUDE_DIR}") -@@ -144,54 +93,94 @@ IF (PAHO_WITH_SSL) - ## common compilation for libpaho-mqtt3cs and libpaho-mqtt3as - ## Note: SSL libraries must be recompiled due ifdefs - 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 $ MQTTClient.c SSLSocket.c) -- ADD_LIBRARY(paho-mqtt3as SHARED $ 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) -- ADD_LIBRARY(paho-mqtt3cs-static STATIC $ MQTTClient.c SSLSocket.c) -- ADD_LIBRARY(paho-mqtt3as-static STATIC $ MQTTAsync.c SSLSocket.c) -- -- TARGET_LINK_LIBRARIES(paho-mqtt3cs-static ${OPENSSL_LIBRARIES} ${LIBS_SYSTEM}) -- TARGET_LINK_LIBRARIES(paho-mqtt3as-static ${OPENSSL_LIBRARIES} ${LIBS_SYSTEM}) -- SET_TARGET_PROPERTIES( -- paho-mqtt3cs-static paho-mqtt3as-static PROPERTIES -- VERSION ${CLIENT_VERSION} -- SOVERSION ${PAHO_VERSION_MAJOR} -- COMPILE_DEFINITIONS "OPENSSL=1") -+ IF (NOT PAHO_BUILD_STATIC) -+ IF (PAHO_BUILD_ASYNC) -+ ADD_LIBRARY(paho-mqtt3as SHARED $ MQTTAsync.c SSLSocket.c) -+ TARGET_LINK_LIBRARIES(paho-mqtt3as ${OPENSSL_LIB} ${OPENSSLCRYPTO_LIB} ${LIBS_SYSTEM}) -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3as PROPERTIES -+ VERSION ${CLIENT_VERSION} -+ SOVERSION ${PAHO_VERSION_MAJOR} -+ COMPILE_DEFINITIONS "OPENSSL=1") -+ INSTALL(TARGETS paho-mqtt3as -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ ELSE () -+ ADD_LIBRARY(paho-mqtt3cs SHARED $ MQTTClient.c SSLSocket.c) -+ TARGET_LINK_LIBRARIES(paho-mqtt3cs ${OPENSSL_LIB} ${OPENSSLCRYPTO_LIB} ${LIBS_SYSTEM}) -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3cs PROPERTIES -+ VERSION ${CLIENT_VERSION} -+ SOVERSION ${PAHO_VERSION_MAJOR} -+ COMPILE_DEFINITIONS "OPENSSL=1") -+ INSTALL(TARGETS paho-mqtt3cs -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ ENDIF () - -- INSTALL(TARGETS paho-mqtt3cs-static paho-mqtt3as-static -- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ ELSE () -+ IF (PAHO_BUILD_ASYNC) -+ ADD_LIBRARY(paho-mqtt3as-static STATIC $ MQTTAsync.c SSLSocket.c) -+ TARGET_LINK_LIBRARIES(paho-mqtt3as-static ${OPENSSL_LIBRARIES} ${LIBS_SYSTEM}) -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3as-static PROPERTIES -+ VERSION ${CLIENT_VERSION} -+ SOVERSION ${PAHO_VERSION_MAJOR} -+ COMPILE_DEFINITIONS "OPENSSL=1") -+ INSTALL(TARGETS paho-mqtt3as-static -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ ELSE () -+ ADD_LIBRARY(paho-mqtt3cs-static STATIC $ MQTTClient.c SSLSocket.c) -+ TARGET_LINK_LIBRARIES(paho-mqtt3cs-static ${OPENSSL_LIBRARIES} ${LIBS_SYSTEM}) -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3cs-static PROPERTIES -+ VERSION ${CLIENT_VERSION} -+ SOVERSION ${PAHO_VERSION_MAJOR} -+ COMPILE_DEFINITIONS "OPENSSL=1") -+ INSTALL(TARGETS paho-mqtt3cs-static -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ ENDIF () - ENDIF() -+ELSE() -+ IF (NOT PAHO_BUILD_STATIC) -+ IF (PAHO_BUILD_ASYNC) -+ ADD_LIBRARY(paho-mqtt3a SHARED $ MQTTAsync.c) -+ TARGET_LINK_LIBRARIES(paho-mqtt3a ${LIBS_SYSTEM}) -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3a PROPERTIES -+ VERSION ${CLIENT_VERSION} -+ SOVERSION ${PAHO_VERSION_MAJOR}) -+ INSTALL(TARGETS paho-mqtt3a -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ ELSE () -+ ADD_LIBRARY(paho-mqtt3c SHARED $ MQTTClient.c) -+ TARGET_LINK_LIBRARIES(paho-mqtt3c ${LIBS_SYSTEM}) -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3c PROPERTIES -+ VERSION ${CLIENT_VERSION} -+ SOVERSION ${PAHO_VERSION_MAJOR}) -+ INSTALL(TARGETS paho-mqtt3c -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ ENDIF () -+ ELSE () -+ IF (PAHO_BUILD_ASYNC) -+ ADD_LIBRARY(paho-mqtt3a-static STATIC $ MQTTAsync.c) -+ TARGET_LINK_LIBRARIES(paho-mqtt3a-static ${LIBS_SYSTEM}) -+ INSTALL(TARGETS paho-mqtt3a-static -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ ELSE () -+ ADD_LIBRARY(paho-mqtt3c-static STATIC $ MQTTClient.c) -+ TARGET_LINK_LIBRARIES(paho-mqtt3c-static ${LIBS_SYSTEM}) -+ INSTALL(TARGETS paho-mqtt3c-static -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ ENDIF () -+ ENDIF () - ENDIF() - --# Base64 test --ADD_EXECUTABLE( Base64Test EXCLUDE_FROM_ALL Base64.c Base64.h ) --TARGET_COMPILE_DEFINITIONS( Base64Test PUBLIC "-DBASE64_TEST" ) --IF (PAHO_WITH_SSL) -- ADD_EXECUTABLE( Base64TestOpenSSL EXCLUDE_FROM_ALL Base64.c Base64.h ) -- TARGET_LINK_LIBRARIES( Base64TestOpenSSL ${OPENSSL_LIB} ${OPENSSLCRYPTO_LIB} ) -- TARGET_COMPILE_DEFINITIONS( Base64TestOpenSSL PUBLIC "-DBASE64_TEST -DOPENSSL=1" ) --ENDIF (PAHO_WITH_SSL) -- --# SHA1 test --ADD_EXECUTABLE( Sha1Test EXCLUDE_FROM_ALL SHA1.c SHA1.h ) --TARGET_COMPILE_DEFINITIONS( Sha1Test PUBLIC "-DSHA1_TEST" ) --IF (PAHO_WITH_SSL) -- ADD_EXECUTABLE( Sha1TestOpenSSL EXCLUDE_FROM_ALL SHA1.c SHA1.h ) -- TARGET_LINK_LIBRARIES( Sha1TestOpenSSL ${OPENSSL_LIB} ${OPENSSLCRYPTO_LIB} ) -- TARGET_COMPILE_DEFINITIONS( Sha1TestOpenSSL PUBLIC "-DSHA1_TEST -DOPENSSL=1" ) --ENDIF (PAHO_WITH_SSL) diff --git a/recipes/paho-mqtt-c/all/patches/0004-fix-cmake-find-openssl.patch b/recipes/paho-mqtt-c/all/patches/0004-fix-cmake-find-openssl.patch new file mode 100644 index 0000000000000..55186be096e0f --- /dev/null +++ b/recipes/paho-mqtt-c/all/patches/0004-fix-cmake-find-openssl.patch @@ -0,0 +1,47 @@ +From 3deb6cb1fe233e321b32d86b17016122d6f82ee7 Mon Sep 17 00:00:00 2001 +From: Chris Mc +Date: Mon, 19 Apr 2021 22:14:02 -0400 +Subject: [PATCH] to allow linking with openssl on windows since it overrides the path + +--- + src/CMakeLists.txt | 27 ++++----------------------- + 1 file changed, 4 insertions(+), 23 deletions(-) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index b46eaca0..93ade4fb 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -108,29 +108,10 @@ INSTALL(FILES MQTTAsync.h MQTTClient.h MQTTClientPersistence.h MQTTProperties.h + IF (PAHO_WITH_SSL) + SET(OPENSSL_SEARCH_PATH "" CACHE PATH "Directory containing OpenSSL libraries and includes") + +- IF (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") +- SET(OPENSSL_SEARCH_PATH "/usr/local/opt/openssl") +- ENDIF (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") +- +- IF (WIN32) +- SET(OPENSSL_SEARCH_PATH "C:/OpenSSL-Win64") +- SET(OPENSSL_SEARCH_LIB_PATH "${OPENSSL_SEARCH_PATH}/lib64") +- IF (DEFINED ENV{PAHO_WINDOWS_BUILD_BIT}) +- IF ($ENV{PAHO_WINDOWS_BUILD_BIT} STREQUAL "x86") +- SET(OPENSSL_SEARCH_PATH "C:/OpenSSL-Win32") +- SET(OPENSSL_SEARCH_LIB_PATH "${OPENSSL_SEARCH_PATH}/lib32") +- ENDIF () +- ENDIF () +- ELSE() +- SET(OPENSSL_SEARCH_LIB_PATH "${OPENSSL_SEARCH_PATH}/lib64") +- ENDIF () +- +- FIND_PATH(OPENSSL_INCLUDE_DIR openssl/ssl.h +- HINTS ${OPENSSL_SEARCH_PATH}/include) +- FIND_LIBRARY(OPENSSL_LIB NAMES ssl libssl ssleay32 +- HINTS ${OPENSSL_SEARCH_PATH}/lib ${OPENSSL_SEARCH_LIB_PATH}) +- FIND_LIBRARY(OPENSSLCRYPTO_LIB NAMES crypto libcrypto libeay32 +- HINTS ${OPENSSL_SEARCH_PATH}/lib ${OPENSSL_SEARCH_LIB_PATH}) ++ find_package(OpenSSL REQUIRED) ++ ++ SET(OPENSSL_LIB ${OPENSSL_SSL_LIBRARY}) ++ SET(OPENSSLCRYPTO_LIB ${OPENSSL_CRYPTO_LIBRARY}) + + MESSAGE(STATUS "OpenSSL hints: ${OPENSSL_SEARCH_PATH}") + MESSAGE(STATUS "OpenSSL headers found at ${OPENSSL_INCLUDE_DIR}") diff --git a/recipes/paho-mqtt-c/all/patches/0004-fix-cmake-install.patch b/recipes/paho-mqtt-c/all/patches/0004-fix-cmake-install.patch deleted file mode 100644 index 5a5992e7ab8a0..0000000000000 --- a/recipes/paho-mqtt-c/all/patches/0004-fix-cmake-install.patch +++ /dev/null @@ -1,539 +0,0 @@ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 20b578a..52cea7c 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -83,10 +83,6 @@ ADD_LIBRARY(common_obj OBJECT ${common_src}) - SET_TARGET_PROPERTIES(common_obj PROPERTIES - POSITION_INDEPENDENT_CODE ON - COMPILE_DEFINITIONS "PAHO_MQTT_EXPORTS=1") --ADD_EXECUTABLE(MQTTVersion MQTTVersion.c) --SET_TARGET_PROPERTIES(MQTTVersion PROPERTIES -- POSITION_INDEPENDENT_CODE ON -- COMPILE_DEFINITIONS "PAHO_MQTT_IMPORTS=1") - ENDIF() - - IF (PAHO_BUILD_STATIC) -@@ -96,89 +92,153 @@ SET_TARGET_PROPERTIES(common_obj_static PROPERTIES - COMPILE_DEFINITIONS "PAHO_MQTT_STATIC=1") - ENDIF() - --IF (PAHO_BUILD_SHARED) -- ADD_LIBRARY(paho-mqtt3c SHARED $ MQTTClient.c) -- ADD_LIBRARY(paho-mqtt3a SHARED $ 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} -- COMPILE_DEFINITIONS "PAHO_MQTT_EXPORTS=1") -- -- IF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") -- SET(MQTTCLIENT_ENTRY_POINT _MQTTClient_init) -- SET(MQTTASYNC_ENTRY_POINT _MQTTAsync_init) -- ELSEIF (NOT WIN32) -- SET(MQTTCLIENT_ENTRY_POINT MQTTClient_init) -- SET(MQTTASYNC_ENTRY_POINT MQTTAsync_init) -- ENDIF() -- -- IF (NOT WIN32) -- SET_TARGET_PROPERTIES( -- paho-mqtt3c PROPERTIES -- LINK_FLAGS "-Wl,-init,${MQTTCLIENT_ENTRY_POINT}") -- SET_TARGET_PROPERTIES( -- paho-mqtt3a PROPERTIES -- LINK_FLAGS "-Wl,-init,${MQTTASYNC_ENTRY_POINT}") -+IF (NOT PAHO_WITH_SSL) -+ IF (PAHO_BUILD_SHARED) -+ IF (PAHO_BUILD_ASYNC) -+ ADD_LIBRARY(paho-mqtt3a SHARED $ MQTTAsync.c) -+ TARGET_LINK_LIBRARIES(paho-mqtt3a ${LIBS_SYSTEM}) -+ -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3a PROPERTIES -+ VERSION ${CLIENT_VERSION} -+ SOVERSION ${PAHO_VERSION_MAJOR} -+ COMPILE_DEFINITIONS "PAHO_MQTT_EXPORTS=1") -+ -+ IF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") -+ SET(MQTTASYNC_ENTRY_POINT _MQTTAsync_init) -+ ELSEIF (NOT WIN32) -+ SET(MQTTASYNC_ENTRY_POINT MQTTAsync_init) -+ ENDIF() -+ -+ IF (NOT WIN32) -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3a PROPERTIES -+ LINK_FLAGS "-Wl,-init,${MQTTASYNC_ENTRY_POINT}") -+ ENDIF() -+ -+ FOREACH(TARGET paho-mqtt3a) -+ TARGET_INCLUDE_DIRECTORIES(${TARGET} -+ PUBLIC -+ $ -+ $ -+ PRIVATE -+ ${CMAKE_BINARY_DIR}) -+ ENDFOREACH() -+ -+ INSTALL(TARGETS paho-mqtt3a -+ EXPORT eclipse-paho-mqtt-cTargets -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ -+ ELSE() -+ ADD_LIBRARY(paho-mqtt3c SHARED $ MQTTClient.c) -+ TARGET_LINK_LIBRARIES(paho-mqtt3c ${LIBS_SYSTEM}) -+ -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3c PROPERTIES -+ VERSION ${CLIENT_VERSION} -+ SOVERSION ${PAHO_VERSION_MAJOR} -+ COMPILE_DEFINITIONS "PAHO_MQTT_EXPORTS=1") -+ -+ IF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") -+ SET(MQTTCLIENT_ENTRY_POINT _MQTTClient_init) -+ ELSEIF (NOT WIN32) -+ SET(MQTTCLIENT_ENTRY_POINT MQTTClient_init) -+ ENDIF() -+ -+ IF (NOT WIN32) -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3c PROPERTIES -+ LINK_FLAGS "-Wl,-init,${MQTTCLIENT_ENTRY_POINT}") -+ ENDIF() -+ -+ FOREACH(TARGET paho-mqtt3c) -+ TARGET_INCLUDE_DIRECTORIES(${TARGET} -+ PUBLIC -+ $ -+ $ -+ PRIVATE -+ ${CMAKE_BINARY_DIR}) -+ ENDFOREACH() -+ -+ INSTALL(TARGETS paho-mqtt3c -+ EXPORT eclipse-paho-mqtt-cTargets -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ -+ ENDIF() - ENDIF() -- -- FOREACH(TARGET paho-mqtt3c paho-mqtt3a) -- TARGET_INCLUDE_DIRECTORIES(${TARGET} -- PUBLIC -- $ -- $ -- 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}) -- INSTALL(TARGETS MQTTVersion -- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) --ENDIF() -- --IF (PAHO_BUILD_STATIC) -- ADD_LIBRARY(paho-mqtt3c-static STATIC $ MQTTClient.c) -- ADD_LIBRARY(paho-mqtt3a-static STATIC $ MQTTAsync.c) -- -- TARGET_LINK_LIBRARIES(paho-mqtt3c-static ${LIBS_SYSTEM}) -- TARGET_LINK_LIBRARIES(paho-mqtt3a-static ${LIBS_SYSTEM}) -- IF (NOT WIN32) -- SET_TARGET_PROPERTIES(paho-mqtt3c-static PROPERTIES OUTPUT_NAME paho-mqtt3c) -- SET_TARGET_PROPERTIES(paho-mqtt3a-static PROPERTIES OUTPUT_NAME paho-mqtt3a) -- ENDIF() -- SET_TARGET_PROPERTIES( -- paho-mqtt3c-static paho-mqtt3a-static PROPERTIES -- VERSION ${CLIENT_VERSION} -- SOVERSION ${PAHO_VERSION_MAJOR} -- COMPILE_DEFINITIONS "PAHO_MQTT_STATIC=1") -- -- FOREACH(TARGET paho-mqtt3c-static paho-mqtt3a-static) -- TARGET_INCLUDE_DIRECTORIES(${TARGET} -- PUBLIC -- $ -- $ -- PRIVATE -- ${CMAKE_BINARY_DIR}) -- ENDFOREACH() -- -- IF (NOT PAHO_BUILD_SHARED) -- INSTALL(TARGETS paho-mqtt3c-static paho-mqtt3a-static -- EXPORT eclipse-paho-mqtt-cTargets -- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -- ELSE() -- INSTALL(TARGETS paho-mqtt3c-static paho-mqtt3a-static -- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ IF (PAHO_BUILD_STATIC) -+ IF (PAHO_BUILD_ASYNC) -+ ADD_LIBRARY(paho-mqtt3a-static STATIC $ MQTTAsync.c) -+ TARGET_LINK_LIBRARIES(paho-mqtt3a-static ${LIBS_SYSTEM}) -+ -+ IF (NOT WIN32) -+ SET_TARGET_PROPERTIES(paho-mqtt3a-static PROPERTIES OUTPUT_NAME paho-mqtt3a) -+ ENDIF() -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3a-static PROPERTIES -+ VERSION ${CLIENT_VERSION} -+ SOVERSION ${PAHO_VERSION_MAJOR} -+ COMPILE_DEFINITIONS "PAHO_MQTT_STATIC=1") -+ -+ FOREACH(TARGET paho-mqtt3a-static) -+ TARGET_INCLUDE_DIRECTORIES(${TARGET} -+ PUBLIC -+ $ -+ $ -+ PRIVATE -+ ${CMAKE_BINARY_DIR}) -+ ENDFOREACH() -+ -+ IF (NOT PAHO_BUILD_SHARED) -+ INSTALL(TARGETS paho-mqtt3a-static -+ EXPORT eclipse-paho-mqtt-cTargets -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ ELSE() -+ INSTALL(TARGETS paho-mqtt3a-static -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ ENDIF() -+ -+ ELSE() -+ ADD_LIBRARY(paho-mqtt3c-static STATIC $ MQTTClient.c) -+ TARGET_LINK_LIBRARIES(paho-mqtt3c-static ${LIBS_SYSTEM}) -+ -+ IF (NOT WIN32) -+ SET_TARGET_PROPERTIES(paho-mqtt3c-static PROPERTIES OUTPUT_NAME paho-mqtt3c) -+ ENDIF() -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3c-static PROPERTIES -+ VERSION ${CLIENT_VERSION} -+ SOVERSION ${PAHO_VERSION_MAJOR} -+ COMPILE_DEFINITIONS "PAHO_MQTT_STATIC=1") -+ -+ FOREACH(TARGET paho-mqtt3c-static) -+ TARGET_INCLUDE_DIRECTORIES(${TARGET} -+ PUBLIC -+ $ -+ $ -+ PRIVATE -+ ${CMAKE_BINARY_DIR}) -+ ENDFOREACH() -+ -+ IF (NOT PAHO_BUILD_SHARED) -+ INSTALL(TARGETS paho-mqtt3c-static -+ EXPORT eclipse-paho-mqtt-cTargets -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ ELSE() -+ INSTALL(TARGETS paho-mqtt3c-static -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ ENDIF() -+ -+ ENDIF() - ENDIF() - ENDIF() - -@@ -197,48 +257,81 @@ IF (PAHO_WITH_SSL) - SET_PROPERTY(TARGET common_ssl_obj PROPERTY POSITION_INDEPENDENT_CODE ON) - SET_PROPERTY(TARGET common_ssl_obj PROPERTY COMPILE_DEFINITIONS "OPENSSL=1;PAHO_MQTT_EXPORTS=1") - -- ADD_LIBRARY(paho-mqtt3cs SHARED $ MQTTClient.c SSLSocket.c) -- ADD_LIBRARY(paho-mqtt3as SHARED $ MQTTAsync.c SSLSocket.c) -+ IF (PAHO_BUILD_ASYNC) -+ ADD_LIBRARY(paho-mqtt3as SHARED $ MQTTAsync.c SSLSocket.c) -+ -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3as PROPERTIES -+ VERSION ${CLIENT_VERSION} -+ SOVERSION ${PAHO_VERSION_MAJOR} -+ COMPILE_DEFINITIONS "OPENSSL=1;PAHO_MQTT_EXPORTS=1") - -- SET_TARGET_PROPERTIES( -- paho-mqtt3cs paho-mqtt3as PROPERTIES -- VERSION ${CLIENT_VERSION} -- SOVERSION ${PAHO_VERSION_MAJOR} -- COMPILE_DEFINITIONS "OPENSSL=1;PAHO_MQTT_EXPORTS=1") -- -- IF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") -- SET(MQTTCLIENT_ENTRY_POINT _MQTTClient_init) -- SET(MQTTASYNC_ENTRY_POINT _MQTTAsync_init) -- ELSEIF (NOT WIN32) -- SET(MQTTCLIENT_ENTRY_POINT MQTTClient_init) -- SET(MQTTASYNC_ENTRY_POINT MQTTAsync_init) -- ENDIF() -- -- IF (NOT WIN32) -+ IF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") -+ SET(MQTTASYNC_ENTRY_POINT _MQTTAsync_init) -+ ELSEIF (NOT WIN32) -+ SET(MQTTASYNC_ENTRY_POINT MQTTAsync_init) -+ ENDIF() -+ -+ IF (NOT WIN32) -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3as PROPERTIES -+ LINK_FLAGS "-Wl,-init,${MQTTASYNC_ENTRY_POINT}") -+ ENDIF() -+ -+ FOREACH(TARGET paho-mqtt3as) -+ TARGET_INCLUDE_DIRECTORIES(${TARGET} -+ PUBLIC -+ $ -+ $ -+ PRIVATE -+ ${CMAKE_BINARY_DIR}) -+ TARGET_LINK_LIBRARIES(${TARGET} -+ PUBLIC -+ OpenSSL::SSL OpenSSL::Crypto ${LIBS_SYSTEM}) -+ ENDFOREACH() -+ INSTALL(TARGETS paho-mqtt3as -+ EXPORT eclipse-paho-mqtt-cTargets -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ ELSE() -+ ADD_LIBRARY(paho-mqtt3cs SHARED $ MQTTClient.c SSLSocket.c) -+ - SET_TARGET_PROPERTIES( -- paho-mqtt3cs PROPERTIES -- LINK_FLAGS "-Wl,-init,${MQTTCLIENT_ENTRY_POINT}") -- SET_TARGET_PROPERTIES( -- paho-mqtt3as PROPERTIES -- LINK_FLAGS "-Wl,-init,${MQTTASYNC_ENTRY_POINT}") -+ paho-mqtt3cs PROPERTIES -+ VERSION ${CLIENT_VERSION} -+ SOVERSION ${PAHO_VERSION_MAJOR} -+ COMPILE_DEFINITIONS "OPENSSL=1;PAHO_MQTT_EXPORTS=1") -+ -+ IF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") -+ SET(MQTTCLIENT_ENTRY_POINT _MQTTClient_init) -+ ELSEIF (NOT WIN32) -+ SET(MQTTCLIENT_ENTRY_POINT MQTTClient_init) -+ ENDIF() -+ -+ IF (NOT WIN32) -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3cs PROPERTIES -+ LINK_FLAGS "-Wl,-init,${MQTTCLIENT_ENTRY_POINT}") -+ ENDIF() -+ -+ FOREACH(TARGET paho-mqtt3cs) -+ TARGET_INCLUDE_DIRECTORIES(${TARGET} -+ PUBLIC -+ $ -+ $ -+ PRIVATE -+ ${CMAKE_BINARY_DIR}) -+ TARGET_LINK_LIBRARIES(${TARGET} -+ PUBLIC -+ OpenSSL::SSL OpenSSL::Crypto ${LIBS_SYSTEM}) -+ ENDFOREACH() -+ INSTALL(TARGETS paho-mqtt3cs -+ EXPORT eclipse-paho-mqtt-cTargets -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - ENDIF() -- -- FOREACH(TARGET paho-mqtt3cs paho-mqtt3as) -- TARGET_INCLUDE_DIRECTORIES(${TARGET} -- PUBLIC -- $ -- $ -- PRIVATE -- ${CMAKE_BINARY_DIR}) -- TARGET_LINK_LIBRARIES(${TARGET} -- PUBLIC -- OpenSSL::SSL OpenSSL::Crypto ${LIBS_SYSTEM}) -- 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}) - ENDIF() - - IF (PAHO_BUILD_STATIC) -@@ -249,57 +342,97 @@ IF (PAHO_WITH_SSL) - SET_PROPERTY(TARGET common_ssl_obj_static PROPERTY POSITION_INDEPENDENT_CODE ON) - SET_PROPERTY(TARGET common_ssl_obj_static PROPERTY COMPILE_DEFINITIONS "OPENSSL=1;PAHO_MQTT_STATIC=1") - -- ADD_LIBRARY(paho-mqtt3cs-static STATIC $ MQTTClient.c SSLSocket.c) -- ADD_LIBRARY(paho-mqtt3as-static STATIC $ MQTTAsync.c SSLSocket.c) -- -- SET_TARGET_PROPERTIES( -- paho-mqtt3cs-static paho-mqtt3as-static PROPERTIES -- VERSION ${CLIENT_VERSION} -- SOVERSION ${PAHO_VERSION_MAJOR} -- COMPILE_DEFINITIONS "OPENSSL=1;PAHO_MQTT_STATIC=1") -- IF (NOT WIN32) -- SET_TARGET_PROPERTIES(paho-mqtt3cs-static PROPERTIES OUTPUT_NAME paho-mqtt3cs) -- SET_TARGET_PROPERTIES(paho-mqtt3as-static PROPERTIES OUTPUT_NAME paho-mqtt3as) -- ENDIF() -- -- IF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") -- SET(MQTTCLIENT_ENTRY_POINT _MQTTClient_init) -- SET(MQTTASYNC_ENTRY_POINT _MQTTAsync_init) -- ELSEIF (NOT WIN32) -- SET(MQTTCLIENT_ENTRY_POINT MQTTClient_init) -- SET(MQTTASYNC_ENTRY_POINT MQTTAsync_init) -- ENDIF() -- -- IF (NOT WIN32) -- SET_TARGET_PROPERTIES( -- paho-mqtt3cs-static PROPERTIES -- LINK_FLAGS "-Wl,-init,${MQTTCLIENT_ENTRY_POINT}") -- SET_TARGET_PROPERTIES( -- paho-mqtt3as-static PROPERTIES -- LINK_FLAGS "-Wl,-init,${MQTTASYNC_ENTRY_POINT}") -- ENDIF() -- -- IF (NOT PAHO_BUILD_SHARED) -- INSTALL(TARGETS paho-mqtt3cs-static paho-mqtt3as-static -- EXPORT eclipse-paho-mqtt-cTargets -- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ IF (PAHO_BUILD_ASYNC) -+ ADD_LIBRARY(paho-mqtt3as-static STATIC $ MQTTAsync.c SSLSocket.c) -+ -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3as-static PROPERTIES -+ VERSION ${CLIENT_VERSION} -+ SOVERSION ${PAHO_VERSION_MAJOR} -+ COMPILE_DEFINITIONS "OPENSSL=1;PAHO_MQTT_STATIC=1") -+ IF (NOT WIN32) -+ SET_TARGET_PROPERTIES(paho-mqtt3as-static PROPERTIES OUTPUT_NAME paho-mqtt3as) -+ ENDIF() -+ -+ IF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") -+ SET(MQTTASYNC_ENTRY_POINT _MQTTAsync_init) -+ ELSEIF (NOT WIN32) -+ SET(MQTTASYNC_ENTRY_POINT MQTTAsync_init) -+ ENDIF() -+ -+ IF (NOT WIN32) -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3as-static PROPERTIES -+ LINK_FLAGS "-Wl,-init,${MQTTASYNC_ENTRY_POINT}") -+ ENDIF() -+ -+ IF (NOT PAHO_BUILD_SHARED) -+ INSTALL(TARGETS paho-mqtt3as-static -+ EXPORT eclipse-paho-mqtt-cTargets -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ ELSE() -+ INSTALL(TARGETS paho-mqtt3as-static -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ ENDIF() -+ FOREACH(TARGET paho-mqtt3as-static) -+ TARGET_INCLUDE_DIRECTORIES(${TARGET} -+ PUBLIC -+ $ -+ $ -+ PRIVATE -+ ${CMAKE_BINARY_DIR}) -+ TARGET_LINK_LIBRARIES(${TARGET} -+ PUBLIC -+ OpenSSL::SSL OpenSSL::Crypto ${LIBS_SYSTEM}) -+ ENDFOREACH() - ELSE() -- INSTALL(TARGETS paho-mqtt3cs-static paho-mqtt3as-static -- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ ADD_LIBRARY(paho-mqtt3cs-static STATIC $ MQTTClient.c SSLSocket.c) -+ -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3cs-static PROPERTIES -+ VERSION ${CLIENT_VERSION} -+ SOVERSION ${PAHO_VERSION_MAJOR} -+ COMPILE_DEFINITIONS "OPENSSL=1;PAHO_MQTT_STATIC=1") -+ IF (NOT WIN32) -+ SET_TARGET_PROPERTIES(paho-mqtt3cs-static PROPERTIES OUTPUT_NAME paho-mqtt3cs) -+ ENDIF() -+ -+ IF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") -+ SET(MQTTCLIENT_ENTRY_POINT _MQTTClient_init) -+ ELSEIF (NOT WIN32) -+ SET(MQTTCLIENT_ENTRY_POINT MQTTClient_init) -+ ENDIF() -+ -+ IF (NOT WIN32) -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3cs-static PROPERTIES -+ LINK_FLAGS "-Wl,-init,${MQTTCLIENT_ENTRY_POINT}") -+ ENDIF() -+ -+ IF (NOT PAHO_BUILD_SHARED) -+ INSTALL(TARGETS paho-mqtt3cs-static -+ EXPORT eclipse-paho-mqtt-cTargets -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ ELSE() -+ INSTALL(TARGETS paho-mqtt3cs-static -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ ENDIF() -+ FOREACH(TARGET paho-mqtt3cs-static) -+ TARGET_INCLUDE_DIRECTORIES(${TARGET} -+ PUBLIC -+ $ -+ $ -+ PRIVATE -+ ${CMAKE_BINARY_DIR}) -+ TARGET_LINK_LIBRARIES(${TARGET} -+ PUBLIC -+ OpenSSL::SSL OpenSSL::Crypto ${LIBS_SYSTEM}) -+ ENDFOREACH() - ENDIF() -- FOREACH(TARGET paho-mqtt3cs-static paho-mqtt3as-static) -- TARGET_INCLUDE_DIRECTORIES(${TARGET} -- PUBLIC -- $ -- $ -- PRIVATE -- ${CMAKE_BINARY_DIR}) -- TARGET_LINK_LIBRARIES(${TARGET} -- PUBLIC -- OpenSSL::SSL OpenSSL::Crypto ${LIBS_SYSTEM}) -- ENDFOREACH() - ENDIF() - ENDIF() - -@@ -316,20 +449,3 @@ INSTALL(FILES - "${CMAKE_CURRENT_BINARY_DIR}/eclipse-paho-mqtt-cConfigVersion.cmake" - DESTINATION lib/cmake/eclipse-paho-mqtt-c) - --# Base64 test --ADD_EXECUTABLE( Base64Test EXCLUDE_FROM_ALL Base64.c Base64.h ) --TARGET_COMPILE_DEFINITIONS( Base64Test PUBLIC "-DBASE64_TEST" ) --IF (PAHO_WITH_SSL) -- ADD_EXECUTABLE( Base64TestOpenSSL EXCLUDE_FROM_ALL Base64.c Base64.h ) -- TARGET_LINK_LIBRARIES( Base64TestOpenSSL OpenSSL::SSL OpenSSL::Crypto) -- TARGET_COMPILE_DEFINITIONS( Base64TestOpenSSL PUBLIC "-DBASE64_TEST -DOPENSSL=1" ) --ENDIF (PAHO_WITH_SSL) -- --# SHA1 test --ADD_EXECUTABLE( Sha1Test EXCLUDE_FROM_ALL SHA1.c SHA1.h ) --TARGET_COMPILE_DEFINITIONS( Sha1Test PUBLIC "-DSHA1_TEST" ) --IF (PAHO_WITH_SSL) -- ADD_EXECUTABLE( Sha1TestOpenSSL EXCLUDE_FROM_ALL SHA1.c SHA1.h ) -- TARGET_LINK_LIBRARIES( Sha1TestOpenSSL OpenSSL::SSL OpenSSL::Crypto) -- TARGET_COMPILE_DEFINITIONS( Sha1TestOpenSSL PUBLIC "-DSHA1_TEST -DOPENSSL=1" ) --ENDIF (PAHO_WITH_SSL) diff --git a/recipes/paho-mqtt-c/all/patches/0005-fix-cmake-install-for-1-3-8.patch b/recipes/paho-mqtt-c/all/patches/0005-fix-cmake-install-for-1-3-8.patch deleted file mode 100644 index 746d540fa7f5e..0000000000000 --- a/recipes/paho-mqtt-c/all/patches/0005-fix-cmake-install-for-1-3-8.patch +++ /dev/null @@ -1,544 +0,0 @@ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 4137d38..9f71d09 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -83,102 +83,162 @@ ADD_LIBRARY(common_obj OBJECT ${common_src}) - SET_TARGET_PROPERTIES(common_obj PROPERTIES - POSITION_INDEPENDENT_CODE ON - COMPILE_DEFINITIONS "PAHO_MQTT_EXPORTS=1") --ADD_EXECUTABLE(MQTTVersion MQTTVersion.c) --SET_TARGET_PROPERTIES(MQTTVersion PROPERTIES -- POSITION_INDEPENDENT_CODE ON -- COMPILE_DEFINITIONS "PAHO_MQTT_IMPORTS=1") - ENDIF() - --IF (PAHO_BUILD_STATIC) -+IF (PAHO_BUILD_STATIC) - ADD_LIBRARY(common_obj_static OBJECT ${common_src}) - SET_TARGET_PROPERTIES(common_obj_static PROPERTIES - POSITION_INDEPENDENT_CODE ON - COMPILE_DEFINITIONS "PAHO_MQTT_STATIC=1") - ENDIF() - --IF (PAHO_BUILD_SHARED) -- ADD_LIBRARY(paho-mqtt3c SHARED $ MQTTClient.c) -- ADD_LIBRARY(paho-mqtt3a SHARED $ MQTTAsync.c MQTTAsyncUtils.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} -- COMPILE_DEFINITIONS "PAHO_MQTT_EXPORTS=1") -- -- IF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") -- SET(MQTTCLIENT_ENTRY_POINT _MQTTClient_init) -- SET(MQTTASYNC_ENTRY_POINT _MQTTAsync_init) -- ELSEIF (NOT WIN32) -- SET(MQTTCLIENT_ENTRY_POINT MQTTClient_init) -- SET(MQTTASYNC_ENTRY_POINT MQTTAsync_init) -- ENDIF() -- -- IF (NOT WIN32) -- SET_TARGET_PROPERTIES( -- paho-mqtt3c PROPERTIES -- LINK_FLAGS "-Wl,-init,${MQTTCLIENT_ENTRY_POINT}") -- SET_TARGET_PROPERTIES( -- paho-mqtt3a PROPERTIES -- LINK_FLAGS "-Wl,-init,${MQTTASYNC_ENTRY_POINT}") -+IF (NOT PAHO_WITH_SSL) -+ IF (PAHO_BUILD_SHARED) -+ IF (PAHO_BUILD_ASYNC) -+ ADD_LIBRARY(paho-mqtt3a SHARED $ MQTTAsync.c MQTTAsyncUtils.c) -+ TARGET_LINK_LIBRARIES(paho-mqtt3a ${LIBS_SYSTEM}) -+ -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3a PROPERTIES -+ VERSION ${CLIENT_VERSION} -+ SOVERSION ${PAHO_VERSION_MAJOR} -+ COMPILE_DEFINITIONS "PAHO_MQTT_EXPORTS=1") -+ -+ IF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") -+ SET(MQTTASYNC_ENTRY_POINT _MQTTAsync_init) -+ ELSEIF (NOT WIN32) -+ SET(MQTTASYNC_ENTRY_POINT MQTTAsync_init) -+ ENDIF() -+ -+ IF (NOT WIN32) -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3a PROPERTIES -+ LINK_FLAGS "-Wl,-init,${MQTTASYNC_ENTRY_POINT}") -+ ENDIF() -+ -+ FOREACH(TARGET paho-mqtt3a) -+ TARGET_INCLUDE_DIRECTORIES(${TARGET} -+ PUBLIC -+ $ -+ $ -+ PRIVATE -+ ${CMAKE_BINARY_DIR}) -+ ENDFOREACH() -+ -+ INSTALL(TARGETS paho-mqtt3a -+ EXPORT eclipse-paho-mqtt-cTargets -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ -+ ELSE() -+ ADD_LIBRARY(paho-mqtt3c SHARED $ MQTTClient.c) -+ TARGET_LINK_LIBRARIES(paho-mqtt3c ${LIBS_SYSTEM}) -+ -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3c PROPERTIES -+ VERSION ${CLIENT_VERSION} -+ SOVERSION ${PAHO_VERSION_MAJOR} -+ COMPILE_DEFINITIONS "PAHO_MQTT_EXPORTS=1") -+ -+ IF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") -+ SET(MQTTCLIENT_ENTRY_POINT _MQTTClient_init) -+ ELSEIF (NOT WIN32) -+ SET(MQTTCLIENT_ENTRY_POINT MQTTClient_init) -+ ENDIF() -+ -+ IF (NOT WIN32) -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3c PROPERTIES -+ LINK_FLAGS "-Wl,-init,${MQTTCLIENT_ENTRY_POINT}") -+ ENDIF() -+ -+ FOREACH(TARGET paho-mqtt3c) -+ TARGET_INCLUDE_DIRECTORIES(${TARGET} -+ PUBLIC -+ $ -+ $ -+ PRIVATE -+ ${CMAKE_BINARY_DIR}) -+ ENDFOREACH() -+ -+ INSTALL(TARGETS paho-mqtt3c -+ EXPORT eclipse-paho-mqtt-cTargets -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ -+ ENDIF() - ENDIF() - -- FOREACH(TARGET paho-mqtt3c paho-mqtt3a) -- TARGET_INCLUDE_DIRECTORIES(${TARGET} -- PUBLIC -- $ -- $ -- 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}) -- INSTALL(TARGETS MQTTVersion -- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) --ENDIF() -+ IF (PAHO_BUILD_STATIC) -+ IF (PAHO_BUILD_ASYNC) -+ ADD_LIBRARY(paho-mqtt3a-static STATIC $ MQTTAsync.c MQTTAsyncUtils.c) -+ TARGET_LINK_LIBRARIES(paho-mqtt3a-static ${LIBS_SYSTEM}) - --IF (PAHO_BUILD_STATIC) -- ADD_LIBRARY(paho-mqtt3c-static STATIC $ MQTTClient.c) -- ADD_LIBRARY(paho-mqtt3a-static STATIC $ MQTTAsync.c MQTTAsyncUtils.c) -- -- TARGET_LINK_LIBRARIES(paho-mqtt3c-static ${LIBS_SYSTEM}) -- TARGET_LINK_LIBRARIES(paho-mqtt3a-static ${LIBS_SYSTEM}) -- IF (NOT WIN32) -- SET_TARGET_PROPERTIES(paho-mqtt3c-static PROPERTIES OUTPUT_NAME paho-mqtt3c) -- SET_TARGET_PROPERTIES(paho-mqtt3a-static PROPERTIES OUTPUT_NAME paho-mqtt3a) -- ENDIF() -- SET_TARGET_PROPERTIES( -- paho-mqtt3c-static paho-mqtt3a-static PROPERTIES -- VERSION ${CLIENT_VERSION} -- SOVERSION ${PAHO_VERSION_MAJOR} -- COMPILE_DEFINITIONS "PAHO_MQTT_STATIC=1") -- -- FOREACH(TARGET paho-mqtt3c-static paho-mqtt3a-static) -- TARGET_INCLUDE_DIRECTORIES(${TARGET} -- PUBLIC -- $ -- $ -- PRIVATE -- ${CMAKE_BINARY_DIR}) -- ENDFOREACH() -- -- IF (NOT PAHO_BUILD_SHARED) -- INSTALL(TARGETS paho-mqtt3c-static paho-mqtt3a-static -- EXPORT eclipse-paho-mqtt-cTargets -- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -- ELSE() -- INSTALL(TARGETS paho-mqtt3c-static paho-mqtt3a-static -- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ IF (NOT WIN32) -+ SET_TARGET_PROPERTIES(paho-mqtt3a-static PROPERTIES OUTPUT_NAME paho-mqtt3a) -+ ENDIF() -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3a-static PROPERTIES -+ VERSION ${CLIENT_VERSION} -+ SOVERSION ${PAHO_VERSION_MAJOR} -+ COMPILE_DEFINITIONS "PAHO_MQTT_STATIC=1") -+ -+ FOREACH(TARGET paho-mqtt3a-static) -+ TARGET_INCLUDE_DIRECTORIES(${TARGET} -+ PUBLIC -+ $ -+ $ -+ PRIVATE -+ ${CMAKE_BINARY_DIR}) -+ ENDFOREACH() -+ -+ IF (NOT PAHO_BUILD_SHARED) -+ INSTALL(TARGETS paho-mqtt3a-static -+ EXPORT eclipse-paho-mqtt-cTargets -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ ELSE() -+ INSTALL(TARGETS paho-mqtt3a-static -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ ENDIF() -+ -+ ELSE() -+ ADD_LIBRARY(paho-mqtt3c-static STATIC $ MQTTClient.c) -+ TARGET_LINK_LIBRARIES(paho-mqtt3c-static ${LIBS_SYSTEM}) -+ -+ IF (NOT WIN32) -+ SET_TARGET_PROPERTIES(paho-mqtt3c-static PROPERTIES OUTPUT_NAME paho-mqtt3c) -+ ENDIF() -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3c-static PROPERTIES -+ VERSION ${CLIENT_VERSION} -+ SOVERSION ${PAHO_VERSION_MAJOR} -+ COMPILE_DEFINITIONS "PAHO_MQTT_STATIC=1") -+ -+ FOREACH(TARGET paho-mqtt3c-static) -+ TARGET_INCLUDE_DIRECTORIES(${TARGET} -+ PUBLIC -+ $ -+ $ -+ PRIVATE -+ ${CMAKE_BINARY_DIR}) -+ ENDFOREACH() -+ -+ IF (NOT PAHO_BUILD_SHARED) -+ INSTALL(TARGETS paho-mqtt3c-static -+ EXPORT eclipse-paho-mqtt-cTargets -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ ELSE() -+ INSTALL(TARGETS paho-mqtt3c-static -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ ENDIF() -+ -+ ENDIF() - ENDIF() - ENDIF() - -@@ -196,49 +256,82 @@ IF (PAHO_WITH_SSL) - TARGET_INCLUDE_DIRECTORIES(common_ssl_obj PUBLIC ${OPENSSL_INCLUDE_DIR}) - SET_PROPERTY(TARGET common_ssl_obj PROPERTY POSITION_INDEPENDENT_CODE ON) - SET_PROPERTY(TARGET common_ssl_obj PROPERTY COMPILE_DEFINITIONS "OPENSSL=1;PAHO_MQTT_EXPORTS=1") -- -- ADD_LIBRARY(paho-mqtt3cs SHARED $ MQTTClient.c SSLSocket.c) -- ADD_LIBRARY(paho-mqtt3as SHARED $ MQTTAsync.c MQTTAsyncUtils.c SSLSocket.c) -- -- SET_TARGET_PROPERTIES( -- paho-mqtt3cs paho-mqtt3as PROPERTIES -- VERSION ${CLIENT_VERSION} -- SOVERSION ${PAHO_VERSION_MAJOR} -- COMPILE_DEFINITIONS "OPENSSL=1;PAHO_MQTT_EXPORTS=1") -- -- IF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") -- SET(MQTTCLIENT_ENTRY_POINT _MQTTClient_init) -- SET(MQTTASYNC_ENTRY_POINT _MQTTAsync_init) -- ELSEIF (NOT WIN32) -- SET(MQTTCLIENT_ENTRY_POINT MQTTClient_init) -- SET(MQTTASYNC_ENTRY_POINT MQTTAsync_init) -- ENDIF() - -- IF (NOT WIN32) -+ IF (PAHO_BUILD_ASYNC) -+ ADD_LIBRARY(paho-mqtt3as SHARED $ MQTTAsync.c MQTTAsyncUtils.c SSLSocket.c) -+ - SET_TARGET_PROPERTIES( -- paho-mqtt3cs PROPERTIES -- LINK_FLAGS "-Wl,-init,${MQTTCLIENT_ENTRY_POINT}") -- SET_TARGET_PROPERTIES( -- paho-mqtt3as PROPERTIES -- LINK_FLAGS "-Wl,-init,${MQTTASYNC_ENTRY_POINT}") -- ENDIF() -+ paho-mqtt3as PROPERTIES -+ VERSION ${CLIENT_VERSION} -+ SOVERSION ${PAHO_VERSION_MAJOR} -+ COMPILE_DEFINITIONS "OPENSSL=1;PAHO_MQTT_EXPORTS=1") -+ -+ IF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") -+ SET(MQTTASYNC_ENTRY_POINT _MQTTAsync_init) -+ ELSEIF (NOT WIN32) -+ SET(MQTTASYNC_ENTRY_POINT MQTTAsync_init) -+ ENDIF() -+ -+ IF (NOT WIN32) -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3as PROPERTIES -+ LINK_FLAGS "-Wl,-init,${MQTTASYNC_ENTRY_POINT}") -+ ENDIF() - -- FOREACH(TARGET paho-mqtt3cs paho-mqtt3as) -- TARGET_INCLUDE_DIRECTORIES(${TARGET} -- PUBLIC -- $ -- $ -- PRIVATE -- ${CMAKE_BINARY_DIR}) -- TARGET_LINK_LIBRARIES(${TARGET} -- PUBLIC -- OpenSSL::SSL OpenSSL::Crypto ${LIBS_SYSTEM}) -- 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}) -+ FOREACH(TARGET paho-mqtt3as) -+ TARGET_INCLUDE_DIRECTORIES(${TARGET} -+ PUBLIC -+ $ -+ $ -+ PRIVATE -+ ${CMAKE_BINARY_DIR}) -+ TARGET_LINK_LIBRARIES(${TARGET} -+ PUBLIC -+ OpenSSL::SSL OpenSSL::Crypto ${LIBS_SYSTEM}) -+ ENDFOREACH() -+ INSTALL(TARGETS paho-mqtt3as -+ EXPORT eclipse-paho-mqtt-cTargets -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ ELSE() -+ ADD_LIBRARY(paho-mqtt3cs SHARED $ MQTTClient.c SSLSocket.c) -+ -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3cs PROPERTIES -+ VERSION ${CLIENT_VERSION} -+ SOVERSION ${PAHO_VERSION_MAJOR} -+ COMPILE_DEFINITIONS "OPENSSL=1;PAHO_MQTT_EXPORTS=1") -+ -+ IF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") -+ SET(MQTTCLIENT_ENTRY_POINT _MQTTClient_init) -+ ELSEIF (NOT WIN32) -+ SET(MQTTCLIENT_ENTRY_POINT MQTTClient_init) -+ ENDIF() -+ -+ IF (NOT WIN32) -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3cs PROPERTIES -+ LINK_FLAGS "-Wl,-init,${MQTTCLIENT_ENTRY_POINT}") -+ ENDIF() -+ -+ FOREACH(TARGET paho-mqtt3cs) -+ TARGET_INCLUDE_DIRECTORIES(${TARGET} -+ PUBLIC -+ $ -+ $ -+ PRIVATE -+ ${CMAKE_BINARY_DIR}) -+ TARGET_LINK_LIBRARIES(${TARGET} -+ PUBLIC -+ OpenSSL::SSL OpenSSL::Crypto ${LIBS_SYSTEM}) -+ ENDFOREACH() -+ INSTALL(TARGETS paho-mqtt3cs -+ EXPORT eclipse-paho-mqtt-cTargets -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ ENDIF() - ENDIF() - - IF (PAHO_BUILD_STATIC) -@@ -248,58 +341,98 @@ IF (PAHO_WITH_SSL) - TARGET_INCLUDE_DIRECTORIES(common_ssl_obj_static PUBLIC ${OPENSSL_INCLUDE_DIR}) - SET_PROPERTY(TARGET common_ssl_obj_static PROPERTY POSITION_INDEPENDENT_CODE ON) - SET_PROPERTY(TARGET common_ssl_obj_static PROPERTY COMPILE_DEFINITIONS "OPENSSL=1;PAHO_MQTT_STATIC=1") -- -- ADD_LIBRARY(paho-mqtt3cs-static STATIC $ MQTTClient.c SSLSocket.c) -- ADD_LIBRARY(paho-mqtt3as-static STATIC $ MQTTAsync.c MQTTAsyncUtils.c SSLSocket.c) -- -- SET_TARGET_PROPERTIES( -- paho-mqtt3cs-static paho-mqtt3as-static PROPERTIES -- VERSION ${CLIENT_VERSION} -- SOVERSION ${PAHO_VERSION_MAJOR} -- COMPILE_DEFINITIONS "OPENSSL=1;PAHO_MQTT_STATIC=1") -- IF (NOT WIN32) -- SET_TARGET_PROPERTIES(paho-mqtt3cs-static PROPERTIES OUTPUT_NAME paho-mqtt3cs) -- SET_TARGET_PROPERTIES(paho-mqtt3as-static PROPERTIES OUTPUT_NAME paho-mqtt3as) -- ENDIF() - -- IF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") -- SET(MQTTCLIENT_ENTRY_POINT _MQTTClient_init) -- SET(MQTTASYNC_ENTRY_POINT _MQTTAsync_init) -- ELSEIF (NOT WIN32) -- SET(MQTTCLIENT_ENTRY_POINT MQTTClient_init) -- SET(MQTTASYNC_ENTRY_POINT MQTTAsync_init) -- ENDIF() -- -- IF (NOT WIN32) -- SET_TARGET_PROPERTIES( -- paho-mqtt3cs-static PROPERTIES -- LINK_FLAGS "-Wl,-init,${MQTTCLIENT_ENTRY_POINT}") -- SET_TARGET_PROPERTIES( -- paho-mqtt3as-static PROPERTIES -- LINK_FLAGS "-Wl,-init,${MQTTASYNC_ENTRY_POINT}") -- ENDIF() -- -- IF (NOT PAHO_BUILD_SHARED) -- INSTALL(TARGETS paho-mqtt3cs-static paho-mqtt3as-static -- EXPORT eclipse-paho-mqtt-cTargets -- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ IF (PAHO_BUILD_ASYNC) -+ ADD_LIBRARY(paho-mqtt3as-static STATIC $ MQTTAsync.c MQTTAsyncUtils.c SSLSocket.c) -+ -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3as-static PROPERTIES -+ VERSION ${CLIENT_VERSION} -+ SOVERSION ${PAHO_VERSION_MAJOR} -+ COMPILE_DEFINITIONS "OPENSSL=1;PAHO_MQTT_STATIC=1") -+ IF (NOT WIN32) -+ SET_TARGET_PROPERTIES(paho-mqtt3as-static PROPERTIES OUTPUT_NAME paho-mqtt3as) -+ ENDIF() -+ -+ IF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") -+ SET(MQTTASYNC_ENTRY_POINT _MQTTAsync_init) -+ ELSEIF (NOT WIN32) -+ SET(MQTTASYNC_ENTRY_POINT MQTTAsync_init) -+ ENDIF() -+ -+ IF (NOT WIN32) -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3as-static PROPERTIES -+ LINK_FLAGS "-Wl,-init,${MQTTASYNC_ENTRY_POINT}") -+ ENDIF() -+ -+ IF (NOT PAHO_BUILD_SHARED) -+ INSTALL(TARGETS paho-mqtt3as-static -+ EXPORT eclipse-paho-mqtt-cTargets -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ ELSE() -+ INSTALL(TARGETS paho-mqtt3as-static -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ ENDIF() -+ FOREACH(TARGET paho-mqtt3as-static) -+ TARGET_INCLUDE_DIRECTORIES(${TARGET} -+ PUBLIC -+ $ -+ $ -+ PRIVATE -+ ${CMAKE_BINARY_DIR}) -+ TARGET_LINK_LIBRARIES(${TARGET} -+ PUBLIC -+ OpenSSL::SSL OpenSSL::Crypto ${LIBS_SYSTEM}) -+ ENDFOREACH() - ELSE() -- INSTALL(TARGETS paho-mqtt3cs-static paho-mqtt3as-static -- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ ADD_LIBRARY(paho-mqtt3cs-static STATIC $ MQTTClient.c SSLSocket.c) -+ -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3cs-static PROPERTIES -+ VERSION ${CLIENT_VERSION} -+ SOVERSION ${PAHO_VERSION_MAJOR} -+ COMPILE_DEFINITIONS "OPENSSL=1;PAHO_MQTT_STATIC=1") -+ IF (NOT WIN32) -+ SET_TARGET_PROPERTIES(paho-mqtt3cs-static PROPERTIES OUTPUT_NAME paho-mqtt3cs) -+ ENDIF() -+ -+ IF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") -+ SET(MQTTCLIENT_ENTRY_POINT _MQTTClient_init) -+ ELSEIF (NOT WIN32) -+ SET(MQTTCLIENT_ENTRY_POINT MQTTClient_init) -+ ENDIF() -+ -+ IF (NOT WIN32) -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3cs-static PROPERTIES -+ LINK_FLAGS "-Wl,-init,${MQTTCLIENT_ENTRY_POINT}") -+ ENDIF() -+ -+ IF (NOT PAHO_BUILD_SHARED) -+ INSTALL(TARGETS paho-mqtt3cs-static -+ EXPORT eclipse-paho-mqtt-cTargets -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ ELSE() -+ INSTALL(TARGETS paho-mqtt3cs-static -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ ENDIF() -+ FOREACH(TARGET paho-mqtt3cs-static) -+ TARGET_INCLUDE_DIRECTORIES(${TARGET} -+ PUBLIC -+ $ -+ $ -+ PRIVATE -+ ${CMAKE_BINARY_DIR}) -+ TARGET_LINK_LIBRARIES(${TARGET} -+ PUBLIC -+ OpenSSL::SSL OpenSSL::Crypto ${LIBS_SYSTEM}) -+ ENDFOREACH() - ENDIF() -- FOREACH(TARGET paho-mqtt3cs-static paho-mqtt3as-static) -- TARGET_INCLUDE_DIRECTORIES(${TARGET} -- PUBLIC -- $ -- $ -- PRIVATE -- ${CMAKE_BINARY_DIR}) -- TARGET_LINK_LIBRARIES(${TARGET} -- PUBLIC -- OpenSSL::SSL OpenSSL::Crypto ${LIBS_SYSTEM}) -- ENDFOREACH() - ENDIF() - ENDIF() - -@@ -316,20 +449,3 @@ INSTALL(FILES - "${CMAKE_CURRENT_BINARY_DIR}/eclipse-paho-mqtt-cConfigVersion.cmake" - DESTINATION lib/cmake/eclipse-paho-mqtt-c) - --# Base64 test --ADD_EXECUTABLE( Base64Test EXCLUDE_FROM_ALL Base64.c Base64.h ) --TARGET_COMPILE_DEFINITIONS( Base64Test PUBLIC "-DBASE64_TEST" ) --IF (PAHO_WITH_SSL) -- ADD_EXECUTABLE( Base64TestOpenSSL EXCLUDE_FROM_ALL Base64.c Base64.h ) -- TARGET_LINK_LIBRARIES( Base64TestOpenSSL OpenSSL::SSL OpenSSL::Crypto) -- TARGET_COMPILE_DEFINITIONS( Base64TestOpenSSL PUBLIC "-DBASE64_TEST -DOPENSSL=1" ) --ENDIF (PAHO_WITH_SSL) -- --# SHA1 test --ADD_EXECUTABLE( Sha1Test EXCLUDE_FROM_ALL SHA1.c SHA1.h ) --TARGET_COMPILE_DEFINITIONS( Sha1Test PUBLIC "-DSHA1_TEST" ) --IF (PAHO_WITH_SSL) -- ADD_EXECUTABLE( Sha1TestOpenSSL EXCLUDE_FROM_ALL SHA1.c SHA1.h ) -- TARGET_LINK_LIBRARIES( Sha1TestOpenSSL OpenSSL::SSL OpenSSL::Crypto) -- TARGET_COMPILE_DEFINITIONS( Sha1TestOpenSSL PUBLIC "-DSHA1_TEST -DOPENSSL=1" ) --ENDIF (PAHO_WITH_SSL)