From da6f7ec9123a7cceb1b68d3426d7f15e45c622f6 Mon Sep 17 00:00:00 2001
From: Stephane Del Pino <stephane.delpino44@gmail.com>
Date: Tue, 29 Oct 2019 11:09:04 +0100
Subject: [PATCH] Fix temporary file directory for lcov

Previously it was set to build coverage files into the sources. These files are
now produced in the build directory.
---
 CMakeLists.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 15d7b2ecc..b1475eb55 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -287,14 +287,14 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Coverage")
   add_custom_target(coverage
     ALL # in coverage mode we do coverage!
     # Cleanup previously generated profiling data
-    COMMAND ${LCOV} -q --gcov "${GCOV_BIN}" --base-directory "${PUGS_SOURCE_DIR}/src" --directory "${PUGS_BINARY_DIR}" --zerocounters
+    COMMAND ${LCOV} -q --gcov "${GCOV_BIN}" --base-directory "${PUGS_BINARY_DIR}/src" --directory "${PUGS_BINARY_DIR}" --zerocounters
     # Initialize profiling data with zero coverage for every instrumented line of the project
     # This way the percentage of total lines covered will always be correct, even when not all source code files were loaded during the test(s)
-    COMMAND ${LCOV} -q --gcov "${GCOV_BIN}" --base-directory "${PUGS_SOURCE_DIR}/src" --directory "${PUGS_BINARY_DIR}" --capture --initial --output-file coverage_base.info
+    COMMAND ${LCOV} -q --gcov "${GCOV_BIN}" --base-directory "${PUGS_BINARY_DIR}/src" --directory "${PUGS_BINARY_DIR}" --capture --initial --output-file coverage_base.info
     # Run tests
     COMMAND ${CMAKE_CTEST_COMMAND} -j ${PROCESSOR_COUNT}
     # Collect data from executions
-    COMMAND ${LCOV} --gcov "${GCOV_BIN}" --base-directory "${PUGS_SOURCE_DIR}/src" --directory "${PUGS_BINARY_DIR}" --capture --output-file coverage_ctest.info
+    COMMAND ${LCOV} --gcov "${GCOV_BIN}" --base-directory "${PUGS_BINARY_DIR}/src" --directory "${PUGS_BINARY_DIR}" --capture --output-file coverage_ctest.info
     # Combine base and ctest results
     COMMAND ${LCOV} --gcov "${GCOV_BIN}" -q --add-tracefile coverage_base.info --add-tracefile coverage_ctest.info --output-file coverage_full.info
     # Extract only project data (--no-capture or --remove options may be used to select collected data)
-- 
GitLab