From: Petr Štetiar Date: Tue, 8 Dec 2020 15:37:42 +0000 (+0100) Subject: cmake: fix building out of the tree X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=c26f71e844df078d2b52307594022bf4924b4915;p=project%2Fustream-ssl.git cmake: fix building out of the tree When building out of the tree, linker is unable to find the ubox library so fix it by using find_library CMake command. Signed-off-by: Petr Štetiar --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 86e1b07..315aeb8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,9 +34,10 @@ ENDIF() FIND_PATH(ubox_include_dir libubox/ustream.h) INCLUDE_DIRECTORIES(${ubox_include_dir}) +FIND_LIBRARY(ubox_library NAMES ubox) ADD_LIBRARY(ustream-ssl SHARED ustream-ssl.c ${SSL_SRC}) -TARGET_LINK_LIBRARIES(ustream-ssl ubox ${SSL_LIB}) +TARGET_LINK_LIBRARIES(ustream-ssl ${ubox_library} ${SSL_LIB}) ADD_EXECUTABLE(ustream-example-server ustream-example-server.c) TARGET_LINK_LIBRARIES(ustream-example-server ustream-ssl)