aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-04-20 14:48:00 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-04-21 20:57:03 +0200
commitab041b778f0a559e75f6d9a8b10ba899e7576616 (patch)
treef08400433b200eac2d099ba09c450a19837d4ff6 /CMakeLists.txt
parent94e20a898ecffa0a5766e6e2d7daabbda312a4fc (diff)
downloadayatana-ido-ab041b778f0a559e75f6d9a8b10ba899e7576616.tar.gz
ayatana-ido-ab041b778f0a559e75f6d9a8b10ba899e7576616.tar.bz2
ayatana-ido-ab041b778f0a559e75f6d9a8b10ba899e7576616.zip
CMakeLists.txt: Don't use variable name MAINTAINER_MODE (it is misleading), use ENABLE_TESTS and ENABLE_COVERAGE as options instead.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt20
1 files changed, 13 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7fee81b..cb0cce1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,18 +7,15 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
SET(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "..." FORCE)
endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
-option(MAINTAINER_MODE "Enable all tests and checks" OFF)
+option(ENABLE_TESTS "Enable all tests and checks" OFF)
# Check for prerequisites
set(DEPS glib-2.0>=2.64 gtk+-3.0>=3.24)
-if(MAINTAINER_MODE)
+if(NOT DISABLE_TESTS)
# We also need gcovr and lcov
set(DEPS ${DEPS} gtest>=1.10)
- set(CMAKE_BUILD_TYPE "Coverage")
-else()
- set(CMAKE_BUILD_TYPE "Release")
endif()
find_package (PkgConfig REQUIRED)
@@ -46,13 +43,22 @@ endif()
add_subdirectory(src)
add_subdirectory(data)
-if(MAINTAINER_MODE)
+if (NOT ENABLE_TESTS)
+ message(STATUS "Unit tests disabled")
+else()
+ message(STATUS "Unit tests enabled")
+ include(CTest)
enable_testing()
add_subdirectory(example)
add_subdirectory(tests)
+ ENABLE_COVERAGE_REPORT(
+ TARGETS ${COVERAGE_TARGETS}
+ TESTS ${COVERAGE_TEST_TARGETS}
+ FILTER /usr/include ${CMAKE_BINARY_DIR}/*
+ )
endif()
# Display config info
message(STATUS "Install prefix: ${CMAKE_INSTALL_PREFIX}")
-message(STATUS "Maintainer mode: ${MAINTAINER_MODE}")
+message(STATUS "Unit tests:: ${ENABLE_TESTS}")