1 diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
2 index a9f8908..5c98f3f 100644
3 --- a/cmake/CMakeLists.txt
4 +++ b/cmake/CMakeLists.txt
5 @@ -17,6 +17,5 @@ install(EXPORT ${package_name} DESTINATION lib/cmake/${package_name}
8 "${CMAKE_CURRENT_BINARY_DIR}/${package_name}Config.cmake"
10 "${CMAKE_CURRENT_BINARY_DIR}/${package_name}ConfigVersion.cmake"
11 DESTINATION lib/cmake/${package_name})
12 diff --git a/cmake/PahoMqttCppConfig.cmake.in b/cmake/PahoMqttCppConfig.cmake.in
13 index 164e123..9beac1c 100644
14 --- a/cmake/PahoMqttCppConfig.cmake.in
15 +++ b/cmake/PahoMqttCppConfig.cmake.in
16 @@ -5,7 +5,7 @@ set(PAHO_WITH_SSL @PAHO_WITH_SSL@)
18 include(CMakeFindDependencyMacro)
19 list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
20 -find_dependency(PahoMqttC REQUIRED)
21 +find_dependency(eclipse-paho-mqtt-c REQUIRED)
22 list(REMOVE_AT CMAKE_MODULE_PATH -1)
23 find_dependency(Threads REQUIRED)
25 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
26 index 3d43595..a25f74d 100644
27 --- a/src/CMakeLists.txt
28 +++ b/src/CMakeLists.txt
30 # Frank Pagliughi - made the shared library optional
31 #*******************************************************************************/
33 -find_package(PahoMqttC REQUIRED)
34 +find_package(eclipse-paho-mqtt-c CONFIG REQUIRED)
38 @@ -81,13 +81,21 @@ target_include_directories(paho-cpp-objs
39 ## --- Build the shared library, if requested ---
44 + find_package(OpenSSL REQUIRED)
45 + set(_PAHO_MQTT_C_LIB_NAME eclipse-paho-mqtt-c::paho-mqtt3as eclipse-paho-mqtt-c::paho-mqtt3cs)
47 + set(_PAHO_MQTT_C_LIB_NAME eclipse-paho-mqtt-c::paho-mqtt3a eclipse-paho-mqtt-c::paho-mqtt3c)
50 ## create the shared library
51 add_library(paho-mqttpp3 SHARED $<TARGET_OBJECTS:paho-cpp-objs>)
53 ## add dependencies to the shared library
54 target_link_libraries(paho-mqttpp3
55 PRIVATE ${LIBS_SYSTEM}
56 - PUBLIC PahoMqttC::PahoMqttC Threads::Threads)
57 + PUBLIC ${_PAHO_MQTT_C_LIB_NAME} Threads::Threads)
59 # It would be nice to exort the include paths from the obj lib, but we
60 # get an export error. Perhaps in a future version?
61 @@ -119,13 +127,22 @@ endif()
62 ## --- Build static version of the library, if requested ---
68 + find_package(OpenSSL REQUIRED)
69 + set(_PAHO_MQTT_C_LIB_NAME eclipse-paho-mqtt-c::paho-mqtt3as-static eclipse-paho-mqtt-c::paho-mqtt3cs-static)
71 + set(_PAHO_MQTT_C_LIB_NAME eclipse-paho-mqtt-c::paho-mqtt3a-static eclipse-paho-mqtt-c::paho-mqtt3c-static)
74 ## create the static library
75 add_library(paho-mqttpp3-static STATIC $<TARGET_OBJECTS:paho-cpp-objs>)
77 ## add dependencies to the shared library
78 target_link_libraries(paho-mqttpp3-static
79 PRIVATE ${LIBS_SYSTEM}
80 - PUBLIC PahoMqttC::PahoMqttC Threads::Threads)
81 + PUBLIC ${_PAHO_MQTT_C_LIB_NAME} Threads::Threads)
83 target_include_directories(paho-mqttpp3-static PUBLIC
84 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>