Skip to content

Commit

Permalink
Merge pull request #350 from koalo/master
Browse files Browse the repository at this point in the history
avoid adding Paho MQTT C library twice
  • Loading branch information
fpagliughi authored Jul 29, 2023
2 parents 95928b6 + f2a15f4 commit 62868ec
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmake/FindPahoMqttC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ find_library(PAHO_MQTT_C_LIBRARIES NAMES ${_PAHO_MQTT_C_LIB_NAME})
unset(_PAHO_MQTT_C_LIB_NAME)
find_path(PAHO_MQTT_C_INCLUDE_DIRS NAMES MQTTAsync.h)

add_library(PahoMqttC::PahoMqttC UNKNOWN IMPORTED)
if (NOT TARGET PahoMqttC::PahoMqttC)
add_library(PahoMqttC::PahoMqttC UNKNOWN IMPORTED)
endif ()

set_target_properties(PahoMqttC::PahoMqttC PROPERTIES
IMPORTED_LOCATION "${PAHO_MQTT_C_LIBRARIES}"
Expand Down

0 comments on commit 62868ec

Please sign in to comment.