make building examples an option
authorThomas Gstädtner <thomas@gstaedtner.net>
Sun, 3 Mar 2013 02:06:19 +0000 (03:06 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 3 Mar 2013 02:43:06 +0000 (03:43 +0100)
CMakeLists.txt
examples/CMakeLists.txt

index e6b8b86ee3ea12942b0f9ee65bba9a9b4a14fe6a..1634b9b74122a0800c27cca6aa1d2485b43b7d35 100644 (file)
@@ -4,6 +4,7 @@ PROJECT(ubus C)
 ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -Wmissing-declarations)
 
 OPTION(BUILD_LUA "build Lua plugin" ON)
+OPTION(BUILD_EXAMPLES "build examples" ON)
 
 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
 
index 5a11a9f2e0a6d3cf380a26258cd0d0ad59f2802f..df7350c08515ea0c92c9a150817f40b07113a600 100644 (file)
@@ -2,9 +2,10 @@ cmake_minimum_required(VERSION 2.6)
 
 ADD_DEFINITIONS(-I..)
 
-ADD_EXECUTABLE(server server.c)
-TARGET_LINK_LIBRARIES(server ubus ubox blobmsg_json)
-
-ADD_EXECUTABLE(client client.c)
-TARGET_LINK_LIBRARIES(client ubus ubox)
+IF (BUILD_EXAMPLES)
+       ADD_EXECUTABLE(server server.c)
+       TARGET_LINK_LIBRARIES(server ubus ubox blobmsg_json)
 
+       ADD_EXECUTABLE(client client.c)
+       TARGET_LINK_LIBRARIES(client ubus ubox)
+ENDIF()