make building examples an option
[project/ubus.git] / examples / CMakeLists.txt
index 5a11a9f..df7350c 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()