aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2022-02-18 03:33:25 +0100
committerRobert Tari <robert@tari.in>2022-02-18 08:21:59 +0100
commit627d6852c6511c5f9498d77df57010435f2cd518 (patch)
tree581273e8d06a28f3a8fa51e291d0b429ce3ed1e6 /CMakeLists.txt
parentb12fb0e3278c13ea79a4e4354a492f9cfb80ae4f (diff)
downloadayatana-indicator-power-627d6852c6511c5f9498d77df57010435f2cd518.tar.gz
ayatana-indicator-power-627d6852c6511c5f9498d77df57010435f2cd518.tar.bz2
ayatana-indicator-power-627d6852c6511c5f9498d77df57010435f2cd518.zip
Make Lomiri features configurable at build time
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt32
1 files changed, 20 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4a25fb5..5762fb8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,6 +14,7 @@ set(PACKAGE ${CMAKE_PROJECT_NAME})
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_LOMIRI_FEATURES "Build with Lomiri-specific libraries, schemas and media" OFF)
if(ENABLE_COVERAGE)
set(ENABLE_TESTS ON)
@@ -64,20 +65,26 @@ find_package (PkgConfig REQUIRED)
include (CheckIncludeFile)
include (FindPkgConfig)
-pkg_check_modules(SERVICE_DEPS REQUIRED
- glib-2.0>=2.36
- gio-2.0>=2.36
- gio-unix-2.0>=2.36
- libnotify>=0.7.6
- libayatana-common>=0.9.1)
-
-include_directories (SYSTEM ${SERVICE_DEPS_INCLUDE_DIRS})
+set(
+ SERVICE_DEPS REQUIRED
+ glib-2.0>=2.36
+ gio-2.0>=2.36
+ gio-unix-2.0>=2.36
+ libnotify>=0.7.6
+ libayatana-common>=0.9.1
+)
-pkg_check_modules(LOMIRI_SCHEMAS lomiri-schemas)
+if (ENABLE_LOMIRI_FEATURES)
+ list (
+ APPEND
+ SERVICE_DEPS
+ lomiri-schemas
+ )
+ add_definitions (-DLOMIRI_FEATURES_ENABLED)
+endif ()
-if(LOMIRI_SCHEMAS_FOUND)
- add_definitions ( -DHAS_LOMIRI_SCHEMAS )
-endif()
+pkg_check_modules (SERVICE_DEPS REQUIRED ${SERVICE_DEPS})
+include_directories (SYSTEM ${SERVICE_DEPS_INCLUDE_DIRS})
##
## custom targets
@@ -119,3 +126,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 Lomiri features: ${ENABLE_LOMIRI_FEATURES}")