Skip to content

Commit e0e4939

Browse files
committed
Move gcov setup to before declaring a new project
1 parent dfd4528 commit e0e4939

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

tests/auto/utils/CMakeLists.txt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,21 @@
88
# Contact KDAB at <info@kdab.com> for commercial licensing options.
99
#
1010

11+
if(KDUTILS_CODE_COVERAGE)
12+
include(${PROJECT_SOURCE_DIR}/cmake/CodeCoverage.cmake)
13+
setup_target_for_coverage_gcovr_html(
14+
NAME
15+
KDUtils_coverage
16+
EXECUTABLE
17+
ctest
18+
-L
19+
"KDUtils"
20+
EXCLUDE
21+
"${CMAKE_BINARY_DIR}/_deps/*"
22+
"${CMAKE_BINARY_DIR}/src/*"
23+
)
24+
endif()
25+
1126
project(KDUtils-Tests)
1227

1328
# Create a test executable linking to the KDUtils library
@@ -36,18 +51,3 @@ add_subdirectory(uri)
3651
add_subdirectory(url)
3752

3853
add_feature_info(KDUtils-Test ON "Build KDUtils Tests")
39-
40-
if(KDUTILS_CODE_COVERAGE)
41-
include(${PROJECT_SOURCE_DIR}/cmake/CodeCoverage.cmake)
42-
setup_target_for_coverage_gcovr_html(
43-
NAME
44-
KDUtils_coverage
45-
EXECUTABLE
46-
ctest
47-
-L
48-
"KDUtils"
49-
EXCLUDE
50-
"${CMAKE_BINARY_DIR}/_deps/*"
51-
"${CMAKE_BINARY_DIR}/src/*"
52-
)
53-
endif()

0 commit comments

Comments
 (0)