utils: fix build error with g++
[project/libubox.git] / examples / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.6)
2
3 IF (BUILD_EXAMPLES)
4     PROJECT(ubox-examples C)
5     ADD_DEFINITIONS(-O1 -Wall -Werror --std=gnu99 -g3)
6
7     INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/..)
8     LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/..)
9
10     FIND_LIBRARY(json NAMES json-c json)
11
12     ADD_EXECUTABLE(blobmsg-example blobmsg-example.c)
13     TARGET_LINK_LIBRARIES(blobmsg-example ubox blobmsg_json  ${json})
14
15     ADD_EXECUTABLE(ustream-example ustream-example.c)
16     TARGET_LINK_LIBRARIES(ustream-example ubox)
17
18     ADD_EXECUTABLE(runqueue-example runqueue-example.c)
19     TARGET_LINK_LIBRARIES(runqueue-example ubox)
20
21     ADD_EXECUTABLE(json_script-example json_script-example.c)
22     TARGET_LINK_LIBRARIES(json_script-example ubox blobmsg_json json_script ${json})
23 ENDIF()