Signed-off-by: Petr Štetiar <yn...@true.cz>
---
 CMakeLists.txt | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 326e649..7fe7a16 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,15 +7,19 @@ SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
 
 SET(SOURCES main.c nmea)
 
-SET(LIBS ubox ubus)
-
 IF(DEBUG)
   ADD_DEFINITIONS(-DDEBUG -g3)
 ENDIF()
 
+FIND_LIBRARY(ubus NAMES ubus)
+FIND_LIBRARY(ubox NAMES ubox)
+FIND_PATH(ubus_include_dir NAMES libubus.h)
+FIND_PATH(ubox_include_dir NAMES libubox/usock.h)
+INCLUDE_DIRECTORIES(${ubox_include_dir} ${ubus_include_dir})
+
 ADD_EXECUTABLE(ugps ${SOURCES})
 
-TARGET_LINK_LIBRARIES(ugps ${LIBS})
+TARGET_LINK_LIBRARIES(ugps ${ubox} ${ubus})
 
 INSTALL(TARGETS ugps
        RUNTIME DESTINATION sbin
-- 
1.9.1


_______________________________________________
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev

Reply via email to