1
0
mirror of https://github.com/eclipse/paho.mqtt.cpp.git synced 2025-05-09 11:21:24 +08:00

Added OpenSSL as link interfacy library to PahoMqttC and moved OPENSSL definition to PahoMqttC library interface definitions.

PAHO_BUILD_SSL does only really affect the paho.mqtt.c library, not the paho.mqtt.cpp.

Signed-off-by: Vitaly Ogoltsov <vitaly.ogoltsov@me.com>
This commit is contained in:
Vitaly Ogoltsov 2019-06-13 15:18:34 +03:00
parent 0d13c33be0
commit 041c33ec4f
2 changed files with 5 additions and 5 deletions

View File

@ -15,8 +15,12 @@ add_library(PahoMqttC::PahoMqttC UNKNOWN IMPORTED)
set_target_properties(PahoMqttC::PahoMqttC PROPERTIES
IMPORTED_LOCATION "${PAHO_MQTT_C_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${PAHO_MQTT_C_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${PAHO_MQTT_C_LIBRARIES}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C")
if(PAHO_WITH_SSL)
set_target_properties(PahoMqttC::PahoMqttC PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "OPENSSL=1"
INTERFACE_LINK_LIBRARIES "OpenSSL::SSL;OpenSSL::Crypto")
endif()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PahoMqttC

View File

@ -61,10 +61,6 @@ add_library(paho-cpp-objs OBJECT
# OBJECTS DESTINATION ${CMAKE_INSTALL_LIBDIR}
#)
if(PAHO_WITH_SSL)
add_definitions(-DOPENSSL)
endif()
# Object libraries can't use target_link_libraries in order to take advantage
# of transitive usage requirements until CMake 3.12. This is a workaround:
#target_include_directories(OBJS PRIVATE ${PAHO_MQTT_C_INCLUDE_DIRS})