diff options
author | Robert Tari <robert@tari.in> | 2020-08-15 15:02:50 +0200 |
---|---|---|
committer | Robert Tari <robert@tari.in> | 2020-08-15 15:02:50 +0200 |
commit | 9d41d52c3d4d922e2fd9681997902405d256979e (patch) | |
tree | eb20dbc1b25eb163e3ad92bf7ee3d8dad69df3be /CMakeLists.txt | |
parent | d90760cd39a2c8a4af1abb90ff72f58a53c18f98 (diff) | |
parent | efcda4b07e5d543cd448fd0340ca1ffe288f3a10 (diff) | |
download | ayatana-indicator-display-9d41d52c3d4d922e2fd9681997902405d256979e.tar.gz ayatana-indicator-display-9d41d52c3d4d922e2fd9681997902405d256979e.tar.bz2 ayatana-indicator-display-9d41d52c3d4d922e2fd9681997902405d256979e.zip |
Merge branch 'sunweaver-pr/cmakelists-rework-and-optional-unit-tests'
Attributes GH PR #10: https://github.com/AyatanaIndicators/ayatana-indicator-display/pull/10
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 886b529..bb4b531 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,19 +3,22 @@ cmake_minimum_required(VERSION 2.8.9) list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) +## +## GNU standard paths +## +include(GNUInstallDirs) + +set(PROJECT_VERSION "0.2") set(PACKAGE ${CMAKE_PROJECT_NAME}) set(SERVICE_LIB ${PACKAGE}) set(SERVICE_EXEC "${PACKAGE}-service") -## -## GNU standard paths -## +option(enable_tests "Build the package's automatic tests." ON) +option(enable_coverage "Generate code coverage reports." OFF) -include(GNUInstallDirs) set(CMAKE_INSTALL_PKGLIBEXECDIR "${CMAKE_INSTALL_LIBEXECDIR}/${CMAKE_PROJECT_NAME}") set(CMAKE_INSTALL_FULL_PKGLIBEXECDIR "${CMAKE_INSTALL_FULL_LIBEXECDIR}/${CMAKE_PROJECT_NAME}") - ## ## Gettext ## @@ -75,11 +78,15 @@ add_subdirectory(po) ## Testing & Coverage ## -enable_testing() -add_subdirectory(tests) -find_package(CoverageReport) -ENABLE_COVERAGE_REPORT( - TARGETS ${SERVICE_LIB} ${SERVICE_EXEC} - TESTS ${COVERAGE_TEST_TARGETS} - FILTER /usr/include ${CMAKE_BINARY_DIR}/* -) +if(${enable_tests}) + enable_testing() + add_subdirectory(tests) + if (${enable_coverage}) + find_package(CoverageReport) + ENABLE_COVERAGE_REPORT( + TARGETS ${SERVICE_LIB} ${SERVICE_EXEC} + TESTS ${COVERAGE_TEST_TARGETS} + FILTER /usr/include ${CMAKE_BINARY_DIR}/* + ) + endif() +endif() |