aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2021-04-29 10:24:35 +0200
committerRobert Tari <robert@tari.in>2021-04-29 10:24:35 +0200
commit0d153a37a753b9486a06d79332ea00a8f8f983c7 (patch)
treed4400816e363cfc40d3882edaa51f1bf5b392d83 /CMakeLists.txt
parent9929648bbbcd4449a5ac3962535031da8c62fb0e (diff)
parent298f4b37043e0921761c8242cabd762d1014c771 (diff)
downloadlibayatana-common-0d153a37a753b9486a06d79332ea00a8f8f983c7.tar.gz
libayatana-common-0d153a37a753b9486a06d79332ea00a8f8f983c7.tar.bz2
libayatana-common-0d153a37a753b9486a06d79332ea00a8f8f983c7.zip
Merge branch 'sunweaver-pr/travis-ci'
Attributes GH PR #12: https://github.com/AyatanaIndicators/libayatana-common/pull/12
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt19
1 files changed, 14 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c1bffc3..aaeb591 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
project (libayatana-common C CXX)
-cmake_minimum_required(VERSION 3.16)
+cmake_minimum_required(VERSION 3.13)
set(PROJECT_VERSION "0.9.1")
set(PACKAGE ${CMAKE_PROJECT_NAME})
@@ -8,7 +8,16 @@ set(API_VERSION 0)
set(ABI_VERSION 0)
# Options
-option(DISABLE_TESTS "Disable tests" off)
+option (ENABLE_TESTS "Build the package's automatic tests." OFF)
+option (ENABLE_COVERAGE "Generate lcov code coverage reports." OFF)
+
+if(ENABLE_COVERAGE)
+ set(ENABLE_TESTS ON)
+ set(CMAKE_BUILD_TYPE "Coverage")
+else()
+ set(CMAKE_BUILD_TYPE "Release")
+endif()
+
# GNU standard installation directories
include (GNUInstallDirs)
@@ -34,10 +43,10 @@ set(CC_WARNING_ARGS " -Wall -pedantic -Wextra -Wno-missing-field-initializers")
add_subdirectory(src)
-if (DISABLE_TESTS)
- message(STATUS "Tests disabled")
-else()
+if (ENABLE_TESTS)
include(CTest)
enable_testing()
add_subdirectory(tests)
+else()
+ message(STATUS "Tests disabled")
endif()