Skip to content

Commit

Permalink
[ci] Fix libcoap with system libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed May 26, 2024
1 parent 42cb5b7 commit 2576382
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions cmake/deps/coap.cmake
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
find_path(LIBCOAP_INCLUDEDIR coap3/libcoap.h)
find_library(LIBCOAP_LIBRARIES coap-3)
add_library(coap-3 IMPORTED SHARED GLOBAL)
add_library(libcoap::coap-3 ALIAS coap-3)
target_include_directories(coap-3 INTERFACE "${LIBCOAP_INCLUDEDIR}")
set_target_properties(coap-3 PROPERTIES IMPORTED_LOCATION "${LIBCOAP_LIBRARIES}")

if(LIBCOAP_INCLUDEDIR AND LIBCOAP_LIBRARIES)
add_library(coap-3 IMPORTED SHARED GLOBAL)
add_library(libcoap::coap-3 ALIAS coap-3)
target_include_directories(coap-3 INTERFACE "${LIBCOAP_INCLUDEDIR}")
set_target_properties(coap-3 PROPERTIES IMPORTED_LOCATION "${LIBCOAP_LIBRARIES}")
endif()
endif()

if(NOT TARGET libcoap::coap-3)
Expand Down

0 comments on commit 2576382

Please sign in to comment.