From a560386f384df90907150b436655098361ba6cef Mon Sep 17 00:00:00 2001 From: Baptiste DURAND Date: Wed, 5 Feb 2014 16:03:32 +0100 Subject: [PATCH] Add option to build with or without x Change-Id: Ie4fb4d998e1485a6cccf8fcd0c121bbe5804b40d Signed-off-by: Baptiste DURAND --- CMakeLists.txt | 6 ++++++ packaging/wrt-commons.spec | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 934f7dd..f865d5b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,6 +48,12 @@ ENDIF(DPL_LOG AND NOT CMAKE_BUILD_TYPE MATCHES "profiling") OPTION(WITH_TESTS "Build tests" OFF) OPTION(WITH_CHILD "Build additional test subdirectory. WITH_TEST must be ON" OFF) +OPTION(X11_SUPPORT "Enable X11" ON) +IF(X11_SUPPORT) + ADD_DEFINITIONS("-DX11") +ENDIF(X11_SUPPORT) + + # Compiler flags SET(CMAKE_C_FLAGS_PROFILING "-O2") SET(CMAKE_CXX_FLAGS_PROFILING "-O2 -std=c++0x") diff --git a/packaging/wrt-commons.spec b/packaging/wrt-commons.spec index b833d98..c6d2ca6 100644 --- a/packaging/wrt-commons.spec +++ b/packaging/wrt-commons.spec @@ -1,3 +1,4 @@ +%bcond_with x Name: wrt-commons Summary: Wrt common library Version: 0.2.160 @@ -62,6 +63,11 @@ export LDFLAGS+="-Wl,--rpath=%{_libdir} -Wl,--hash-style=both -Wl,--as-needed" -DDPL_LOG="OFF" \ -DCMAKE_BUILD_TYPE=%{?build_type:%build_type} \ %{?WITH_TESTS:-DWITH_TESTS=%WITH_TESTS} \ +%if %{with x} + -DX11_SUPPORT=On \ +%else + -DX11_SUPPORT=Off \ +%endif %{?WITH_CHILD:-DWITH_CHILD=%WITH_CHILD} make %{?jobs:-j%jobs} -- 2.34.1