aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-06-10 21:54:53 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-06-10 21:54:53 +0200
commita2aac2de9402709a0eeea16fb893d261a61624e6 (patch)
tree5a664e125a6f7d9f21528944792b8877f45c9a06 /CMakeLists.txt
parent7c2b87986b489f472ffcd395036d9449b1c1ebad (diff)
parentdc1081e7a4cf9b017a4076f0bc028dd82e3b8cc8 (diff)
downloadayatana-indicator-session-a2aac2de9402709a0eeea16fb893d261a61624e6.tar.gz
ayatana-indicator-session-a2aac2de9402709a0eeea16fb893d261a61624e6.tar.bz2
ayatana-indicator-session-a2aac2de9402709a0eeea16fb893d261a61624e6.zip
Merge branch 'tari01-pr/ayatana-standard-cmake'
Attributes GH PR #40: https://github.com/AyatanaIndicators/ayatana-indicator-session/pull/40
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt25
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}")