Skip to content
Snippets Groups Projects
Commit 9c5f0198 authored by Petar Paradzik's avatar Petar Paradzik
Browse files

cmake: add libubus module

parent 1657b098
Branches
Tags
No related merge requests found
...@@ -17,8 +17,13 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules") ...@@ -17,8 +17,13 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
find_package(LIBUBOX REQUIRED) find_package(LIBUBOX REQUIRED)
find_package(LIBUCI REQUIRED) find_package(LIBUCI REQUIRED)
find_package(LIBUBUS REQUIRED)
set(RULENGD_LINK ${LIBUBOX_LIBRARIES} ${LIBUCI_LIBRARIES}) set(RULENGD_LINK
${LIBUBOX_LIBRARIES}
${LIBUCI_LIBRARIES}
${LIBUBUS_LIBRARIES}
)
set(SOURCES set(SOURCES
src/main.c src/main.c
......
find_path(LIBUBUS_INCLUDE_DIRS libubus.h)
find_library(LIBUBUS_LIBRARIES NAMES ubus)
if (LIBUBUS_INCLUDE_DIRS AND LIBUBUS_LIBRARIES)
SET(UBUS_FOUND TRUE)
endif (LIBUBUS_INCLUDE_DIRS AND LIBUBUS_LIBRARIES)
if (UBUS_FOUND)
message(STATUS "Found libubus: ${LIBUBUS_LIBRARIES}")
else (UBUS_FOUND)
if (UBUS_FOUND REQUIRED)
if (NOT LIBUBUS_INCLUDE_DIRS)
message(FATAL_ERROR "Could not find libubus.h header file!")
endif (NOT LIBUBUS_INCLUDE_DIRS)
if (NOT LIBUBUS_LIBRARIES)
message(FATAL_ERROR "Could not find libubus.so libraries!")
endif (NOT LIBUBUS_LIBRARIES)
endif (UBUS_FOUND REQUIRED)
endif (UBUS_FOUND)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment