If I'm using "-DCMAKE_BUILD_TYPE=coverage" then I'm getting the following linking errors:
------------------snip----------------
Linking CXX executable test-runner
cd /home/ubuntu/jenkins/workspace/xpathselect-ci/distribution/quantal/flavor/amd64/pbuilder_setup/work/trunk/obj-x86_64-linux-gnu/test && /usr/bin/cmake -E cmake_link_script CMakeFiles/test-runner.dir/link.txt --verbose=1
/usr/bin/c++ -std=c++11 -ggdb -O0 -Wall CMakeFiles/test-runner.dir/test_main.cpp.o CMakeFiles/test-runner.dir/test_node.cpp.o CMakeFiles/test-runner.dir/test_xpath_simple.cpp.o CMakeFiles/test-runner.dir/test_xpath_tree.cpp.o CMakeFiles/test-runner.dir/test_utils.cpp.o -o test-runner -rdynamic gtest/libgtest.a ../lib/libxpathselect.a -lpthread
../lib/libxpathselect.a(xpathselect.cpp.o): In function `_GLOBAL__sub_I_65535_0_xpathselect.cpp':
xpathselect.cpp:(.text+0x8474): undefined reference to `__gcov_init'
../lib/libxpathselect.a(xpathselect.cpp.o):(.data.rel+0x20): undefined reference to `__gcov_merge_add'
../lib/libxpathselect.a(utils.cpp.o): In function `_GLOBAL__sub_I_65535_0_utils.cpp':
utils.cpp:(.text+0x1d1): undefined reference to `__gcov_init'
../lib/libxpathselect.a(utils.cpp.o):(.data.rel+0x20): undefined reference to `__gcov_merge_add'
debuild: fatal error at line 1357:
dpkg-buildpackage -rfakeroot -d -us -uc failed
------------------snip----------------
--coverage is missing from linking and I believe that is the reason why it fails.
The CMakeLists.txt file in lib/ needs to inherit somehow the settings from the root file.
The full build log is here:
https://jenkins.qa.ubuntu.com/job/xpathselect-ci/distribution=quantal,flavor=i386/7/console
This only happens with "static" patch. Not sure why it doesn't happen when linking dynamically.