From 747bb84d27518ba1ab0c49d619a812b43222fdcf Mon Sep 17 00:00:00 2001 From: Kevin Rocard Date: Wed, 11 Mar 2015 11:46:32 +0100 Subject: Modularise build using cmake options The parameter framework can build lots of components including but not limited to core c++ lib, c api, python api, bash completion... All those modules are not always wanted, especially if they have external dependencies as it force the builder to install them. Conditionally define non core build modules. The builder can disable feature by providing -D =OFF to deactivate them. The following options are available: - PYTHON_BINDINGS: Break swig dependencies - BASH_COMPLETION: If the target does not have bash - COVERAGE: Default to off, set to on to build c/c++ with coverage flags. Signed-off-by: Kevin Rocard --- CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index fcef282..0cddfd3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,6 +38,12 @@ project(parameter-framework) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra") +option(COVERAGE "Build with coverage support" OFF) +if(COVERAGE) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage") +endif() + add_subdirectory(xmlserializer) add_subdirectory(parameter) add_subdirectory(utility) @@ -52,7 +58,11 @@ configure_file(CTestCustom.cmake ${CMAKE_BINARY_DIR} COPYONLY) add_subdirectory(test/test-platform) add_subdirectory(test/test-fixed-point-parameter) -add_subdirectory(tools/bash_completion) +option(BASH_COMPLETION "Install bash completion configuration" ON) +if (BASH_COMPLETION) + add_subdirectory(tools/bash_completion) +endif() + add_subdirectory(tools/xmlGenerator) add_subdirectory(tools/xmlValidator) -- cgit v1.1