diff options
author | Robert Tari <robert@tari.in> | 2021-06-10 15:12:35 +0200 |
---|---|---|
committer | Robert Tari <robert@tari.in> | 2021-06-10 15:12:35 +0200 |
commit | dc1081e7a4cf9b017a4076f0bc028dd82e3b8cc8 (patch) | |
tree | 5a664e125a6f7d9f21528944792b8877f45c9a06 | |
parent | 7c2b87986b489f472ffcd395036d9449b1c1ebad (diff) | |
download | ayatana-indicator-session-dc1081e7a4cf9b017a4076f0bc028dd82e3b8cc8.tar.gz ayatana-indicator-session-dc1081e7a4cf9b017a4076f0bc028dd82e3b8cc8.tar.bz2 ayatana-indicator-session-dc1081e7a4cf9b017a4076f0bc028dd82e3b8cc8.zip |
CMakeLists.txt: Add Ayatana standard bits
fixes https://github.com/AyatanaIndicators/ayatana-indicator-session/issues/38
-rw-r--r-- | CMakeLists.txt | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 53ff26e..51e6c0a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,14 +1,18 @@ project (ayatana-indicator-session C CXX) cmake_minimum_required (VERSION 3.13) +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + SET(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "..." FORCE) +endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) set (PROJECT_VERSION "0.8.2") set (PACKAGE ${CMAKE_PROJECT_NAME}) set (GETTEXT_PACKAGE "ayatana-indicator-session") -option (ENABLE_TESTS "Build the package's automatic tests." OFF) -option (ENABLE_COVERAGE "Generate lcov code coverage reports." OFF) +option(ENABLE_TESTS "Enable all tests and checks" OFF) +option(ENABLE_COVERAGE "Enable coverage reports (includes enabling all tests and checks)" OFF) if(ENABLE_COVERAGE) set(ENABLE_TESTS ON) @@ -36,7 +40,17 @@ pkg_check_modules (SERVICE REQUIRED gio-unix-2.0>=2.36) include_directories (${SERVICE_INCLUDE_DIRS}) -set (CC_WARNING_ARGS " -Wall -pedantic -Wextra -Wno-missing-field-initializers") +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + + set(COMPILE_FLAGS "${COMPILE_FLAGS} -Weverything") + set(COMPILE_FLAGS "${COMPILE_FLAGS} -Wno-c++98-compat -Wno-padded") + set(COMPILE_FLAGS "${COMPILE_FLAGS} -Wno-documentation") + +else() + + set(COMPILE_FLAGS "${COMPILE_FLAGS} -Wall") + +endif() set (ARCHIVE_NAME ${CMAKE_PROJECT_NAME}-${PROJECT_VERSION}) add_custom_target (dist @@ -75,3 +89,8 @@ add_subdirectory (po) if (${ENABLE_TESTS}) add_subdirectory (tests) endif () + +# Display config info + +message(STATUS "Install prefix: ${CMAKE_INSTALL_PREFIX}") +message(STATUS "Unit tests: ${ENABLE_TESTS}") |