~private-ps-quality-team/pbuilderjenkins/trunk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
set -ex

{add_cmake_dh_auto_configure_option}
{add_autotools_dh_auto_configure_option}
{add_qmake_dh_auto_configure_option}

#TODO: this is just for cmake based projects; We need a branch for 
# autotools/qmake as well
if [ -f CMakeLists.txt ]; then
    #if the project is using an option instead of CMAKE_BUILD_TYPE then
    # change the option
    if grep 'OPTION.*ENABLE_COVERAGE.*OFF' CMakeLists.txt; then
        sed -i '/^OPTION.*ENABLE_COVERAGE.*OFF/s/OFF/ON/' CMakeLists.txt
    # add CMAKE_BUILD_TYPE=coverage in all other cases
    else
        add_cmake_dh_auto_configure_option "-DCMAKE_BUILD_TYPE=coverage"
    fi
elif [ -f autogen.sh ]; then
    add_autotools_dh_auto_configure_option "--enable-gcov"
elif [ -f *.pro ]; then
    add_qmake_dh_auto_configure_option "CONFIG+=coverage"
fi