From 80d64827e9238a883c9d5b8c7fc404accf3f743a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20Gst=C3=A4dtner?= Date: Sun, 3 Mar 2013 03:06:19 +0100 Subject: [PATCH] make building examples an option --- CMakeLists.txt | 1 + examples/CMakeLists.txt | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e6b8b86..1634b9b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 "") diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 5a11a9f..df7350c 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -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() -- 2.30.2