Ubuntu Pastebin

Paste from mzanetti at Tue, 17 Mar 2015 14:17:57 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
mzanetti@noneyet ~/Develop/reviews/halide-filters-tests/builddir  $  bzr diff
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt      2015-03-17 12:46:19 +0000
+++ CMakeLists.txt      2015-03-17 14:11:22 +0000
@@ -38,6 +38,27 @@
 
 set(EXEC "qmlscene $@ ${FILTERS_DIR}/${MAIN_QML}")
 
+string(TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_lower) # Build types should always be lowercase but sometimes they are not.
+include(EnableCoverageReport)
+#####################################################################
+# Enable code coverage calculation with gcov/gcovr/lcov
+# Usage:
+#  * Switch build type to coverage (use ccmake or cmake-gui)
+#  * Invoke make, make test, make coverage (or ninja if you use that backend)
+#  * Find html report in subdir coveragereport
+#  * Find xml report feasible for jenkins in coverage.xml
+#####################################################################
+message("---- ${cmake_build_type_lower}")
+if(cmake_build_type_lower MATCHES coverage)
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage" )
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage" )
+  set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} --coverage" )
+  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --coverage" )
+  ENABLE_COVERAGE_REPORT(TARGETS ${SHELL_APP} FILTER /usr/include ${CMAKE_SOURCE_DIR}/tests/* ${CMAKE_BINARY_DIR}/*)
+  message("******************************* building coverage report")
+endif()
+
+
 # This command figures out the target architecture for use in the manifest file
 execute_process(
   COMMAND dpkg-architecture -qDEB_HOST_ARCH
@@ -69,22 +90,5 @@
                     DEPENDS filtersbackend filtersbackend-qmldir
                     WORKING_DIRECTORY ./app)
 
-include(EnableCoverageReport)
-#####################################################################
-# Enable code coverage calculation with gcov/gcovr/lcov
-# Usage:
-#  * Switch build type to coverage (use ccmake or cmake-gui)
-#  * Invoke make, make test, make coverage (or ninja if you use that backend)
-#  * Find html report in subdir coveragereport
-#  * Find xml report feasible for jenkins in coverage.xml
-#####################################################################
-if(cmake_build_type_lower MATCHES coverage)
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage" )
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage" )
-  set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} --coverage" )
-  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --coverage" )
-  ENABLE_COVERAGE_REPORT(TARGETS ${SHELL_APP} FILTER /usr/include ${CMAKE_SOURCE_DIR}/tests/* ${CMAKE_BINARY_DIR}/*)
-endif()
-
 # No op custom target for all not compiled files, so they show up in the QtCreator project tree
 add_custom_target("filters_ClickFiles" ALL SOURCES "filters.apparmor" "manifest.json.in")
Download as text