diff options
author | Kevin Rocard <kevin.rocard@intel.com> | 2015-03-11 11:46:32 +0100 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2015-04-24 13:32:47 -0700 |
commit | 747bb84d27518ba1ab0c49d619a812b43222fdcf (patch) | |
tree | c3761b748c87883d4fbd77fefd69177dee58c9c5 | |
parent | 7fe36eead17ee1afb9ba26e1e4eb8613b559f71d (diff) | |
download | external_parameter-framework-747bb84d27518ba1ab0c49d619a812b43222fdcf.zip external_parameter-framework-747bb84d27518ba1ab0c49d619a812b43222fdcf.tar.gz external_parameter-framework-747bb84d27518ba1ab0c49d619a812b43222fdcf.tar.bz2 |
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 <FEATURE>=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 <kevin.rocard@intel.com>
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | CMakeLists.txt | 12 | ||||
-rw-r--r-- | bindings/CMakeLists.txt | 5 |
3 files changed, 16 insertions, 3 deletions
diff --git a/.travis.yml b/.travis.yml index 92def31..0e954f4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,7 +28,7 @@ script: make && sudo make install ) - ( cd build && - cmake -DCMAKE_BUILD_TYPE=Debug .. && + cmake -DCMAKE_BUILD_TYPE=Debug -DCOVERAGE=ON .. && make -j && sudo make install && CTEST_OUTPUT_ON_FAILURE=1 make ExperimentalTest ExperimentalCoverage ExperimentalMemCheck ) 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) diff --git a/bindings/CMakeLists.txt b/bindings/CMakeLists.txt index 3208d54..ba59221 100644 --- a/bindings/CMakeLists.txt +++ b/bindings/CMakeLists.txt @@ -26,4 +26,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -add_subdirectory(python) +option(PYTHON_BINDINGS "Python library to use the pfw from python" ON) +if(PYTHON_BINDINGS) + add_subdirectory(python) +endif() |