Signed-off-by: Petr Štetiar <ynezz@true.cz>
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