diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 6cff765..c80a7e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ -project(ayatana-indicator-display LANGUAGES C CXX) cmake_minimum_required(VERSION 3.13) +project(ayatana-indicator-display VERSION 24.4.0 LANGUAGES C CXX) if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) SET(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "..." FORCE) @@ -10,7 +10,6 @@ endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) ## include(GNUInstallDirs) -set(PROJECT_VERSION "0.2") set(PACKAGE ${CMAKE_PROJECT_NAME}) set(SERVICE_LIB ${PACKAGE}) set(SERVICE_EXEC "${PACKAGE}-service") @@ -20,6 +19,7 @@ set(SERVICE_EXEC "${PACKAGE}-service") option(ENABLE_TESTS "Enable all tests and checks" OFF) option(ENABLE_COVERAGE "Enable coverage reports (includes enabling all tests and checks)" OFF) option(ENABLE_WERROR "Treat all build warnings as errors" OFF) +option(ENABLE_COLOR_TEMP "Include colour temperature specific code in the build" ON) if(ENABLE_COVERAGE) set(ENABLE_TESTS ON) @@ -29,12 +29,14 @@ else() endif() if(ENABLE_WERROR) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") + add_definitions("-Werror") endif() -set(CMAKE_INSTALL_PKGLIBEXECDIR "${CMAKE_INSTALL_LIBEXECDIR}/${CMAKE_PROJECT_NAME}") -set(CMAKE_INSTALL_FULL_PKGLIBEXECDIR "${CMAKE_INSTALL_FULL_LIBEXECDIR}/${CMAKE_PROJECT_NAME}") +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + add_definitions("-Weverything") +elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + add_definitions("-Wall") +endif() ## ## Gettext @@ -63,12 +65,15 @@ find_package(PkgConfig REQUIRED) # glib... set(GLIB_MINIMUM 2.36) -pkg_check_modules(SERVICE_DEPS REQUIRED - libayatana-common>=0.9.3 - gio-unix-2.0>=${GLIB_MINIMUM} - glib-2.0>=${GLIB_MINIMUM} - gudev-1.0 -) +set (SERVICE_DEPS libayatana-common>=0.9.3 gio-unix-2.0>=${GLIB_MINIMUM} glib-2.0>=${GLIB_MINIMUM} properties-cpp>=0.0.1) + +if (ENABLE_COLOR_TEMP) + list (APPEND SERVICE_DEPS libgeoclue-2.0 accountsservice) + add_definitions (-DCOLOR_TEMP_ENABLED) +endif () + +pkg_check_modules (SERVICE_DEPS REQUIRED ${SERVICE_DEPS}) + include_directories (SYSTEM ${SERVICE_DEPS_INCLUDE_DIRS} ) @@ -78,15 +83,7 @@ include_directories (SYSTEM ## include_directories(${CMAKE_CURRENT_SOURCE_DIR}) - -# set the compiler warnings -if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - list(APPEND CXX_WARNING_ARGS -Weverything -Wno-c++98-compat -Wno-padded) -elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - list(APPEND CXX_WARNING_ARGS -Wall -Wextra -Wpedantic) -endif() - -add_compile_options(-std=c++14 -fPIC) +add_compile_options(-fPIC) add_subdirectory(src) add_subdirectory(data) @@ -119,3 +116,4 @@ endif() message(STATUS "Install prefix: ${CMAKE_INSTALL_PREFIX}") message(STATUS "Unit tests: ${ENABLE_TESTS}") message(STATUS "Build with -Werror: ${ENABLE_WERROR}") +message(STATUS "Build with colour temperature code: ${ENABLE_COLOR_TEMP}") |