2019-10-30 14:24:53 +08:00
|
|
|
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
|
|
|
|
index a9f8908..5c98f3f 100644
|
|
|
|
--- a/cmake/CMakeLists.txt
|
|
|
|
+++ b/cmake/CMakeLists.txt
|
|
|
|
@@ -17,6 +17,5 @@ install(EXPORT ${package_name} DESTINATION lib/cmake/${package_name}
|
|
|
|
|
|
|
|
install(FILES
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/${package_name}Config.cmake"
|
|
|
|
- FindPahoMqttC.cmake
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/${package_name}ConfigVersion.cmake"
|
|
|
|
DESTINATION lib/cmake/${package_name})
|
|
|
|
diff --git a/cmake/PahoMqttCppConfig.cmake.in b/cmake/PahoMqttCppConfig.cmake.in
|
2020-05-16 07:57:28 +08:00
|
|
|
index aff9472..275655c 100644
|
2019-10-30 14:24:53 +08:00
|
|
|
--- a/cmake/PahoMqttCppConfig.cmake.in
|
|
|
|
+++ b/cmake/PahoMqttCppConfig.cmake.in
|
2020-05-16 07:57:28 +08:00
|
|
|
@@ -5,7 +5,7 @@ set(PAHO_WITH_SSL @PAHO_WITH_SSL@)
|
|
|
|
|
2019-10-30 14:24:53 +08:00
|
|
|
include(CMakeFindDependencyMacro)
|
|
|
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
|
|
|
|
-find_dependency(PahoMqttC REQUIRED)
|
|
|
|
+find_dependency(eclipse-paho-mqtt-c REQUIRED)
|
|
|
|
list(REMOVE_AT CMAKE_MODULE_PATH -1)
|
|
|
|
|
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/@package_name@Targets.cmake")
|
|
|
|
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
2020-11-12 07:18:34 +08:00
|
|
|
index 4e9b7c4..93eaae9 100644
|
2019-10-30 14:24:53 +08:00
|
|
|
--- a/src/CMakeLists.txt
|
|
|
|
+++ b/src/CMakeLists.txt
|
|
|
|
@@ -23,7 +23,7 @@
|
|
|
|
# Frank Pagliughi - made the shared library optional
|
|
|
|
#*******************************************************************************/
|
|
|
|
|
|
|
|
-find_package(PahoMqttC REQUIRED)
|
|
|
|
+find_package(eclipse-paho-mqtt-c CONFIG REQUIRED)
|
|
|
|
|
|
|
|
# --- The headers ---
|
|
|
|
|
2020-11-12 07:18:34 +08:00
|
|
|
@@ -80,13 +80,21 @@ target_include_directories(paho-cpp-objs
|
2020-05-16 07:57:28 +08:00
|
|
|
## --- Build the shared library, if requested ---
|
|
|
|
|
|
|
|
if(PAHO_BUILD_SHARED)
|
|
|
|
+ ## set PAHO_C_LIB
|
|
|
|
+ if(PAHO_WITH_SSL)
|
2020-11-12 07:18:34 +08:00
|
|
|
+ find_package(OpenSSL REQUIRED)
|
2020-05-16 07:57:28 +08:00
|
|
|
+ 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)
|
|
|
|
+ endif()
|
|
|
|
+
|
|
|
|
## create the shared library
|
|
|
|
add_library(paho-mqttpp3 SHARED $<TARGET_OBJECTS:paho-cpp-objs>)
|
|
|
|
|
2019-10-30 14:24:53 +08:00
|
|
|
## add dependencies to the shared library
|
|
|
|
target_link_libraries(paho-mqttpp3
|
|
|
|
PRIVATE ${LIBS_SYSTEM}
|
2020-05-16 07:57:28 +08:00
|
|
|
- PUBLIC PahoMqttC::PahoMqttC Threads::Threads)
|
|
|
|
+ PUBLIC ${_PAHO_MQTT_C_LIB_NAME} Threads::Threads)
|
2019-10-30 14:24:53 +08:00
|
|
|
|
|
|
|
# It would be nice to exort the include paths from the obj lib, but we
|
|
|
|
# get an export error. Perhaps in a future version?
|
2020-11-12 07:18:34 +08:00
|
|
|
@@ -118,13 +126,22 @@ endif()
|
2020-05-16 07:57:28 +08:00
|
|
|
## --- Build static version of the library, if requested ---
|
|
|
|
|
|
|
|
if(PAHO_BUILD_STATIC)
|
|
|
|
+
|
|
|
|
+ ## set PAHO_C_LIB
|
|
|
|
+ if(PAHO_WITH_SSL)
|
2020-11-12 07:18:34 +08:00
|
|
|
+ find_package(OpenSSL REQUIRED)
|
2020-05-16 07:57:28 +08:00
|
|
|
+ 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)
|
|
|
|
+ endif()
|
|
|
|
+
|
|
|
|
## create the static library
|
|
|
|
add_library(paho-mqttpp3-static STATIC $<TARGET_OBJECTS:paho-cpp-objs>)
|
|
|
|
|
2019-10-30 14:24:53 +08:00
|
|
|
## add dependencies to the shared library
|
|
|
|
target_link_libraries(paho-mqttpp3-static
|
|
|
|
PRIVATE ${LIBS_SYSTEM}
|
2020-05-16 07:57:28 +08:00
|
|
|
- PUBLIC PahoMqttC::PahoMqttC Threads::Threads)
|
|
|
|
+ PUBLIC ${_PAHO_MQTT_C_LIB_NAME} Threads::Threads)
|
2019-10-30 14:24:53 +08:00
|
|
|
|
|
|
|
target_include_directories(paho-mqttpp3-static PUBLIC
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|