From 214a5114e324700e2c854cff675e0a86f74e42f1 Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Tue, 8 Nov 2022 00:15:36 +0100 Subject: CMakeLists.txt: Skip test dependencies when testing is off --- CMakeLists.txt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9605ff1..34fda26 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,13 +65,14 @@ 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 - properties-cpp>=0.0.1 -) +set (SERVICE_DEPS libayatana-common>=0.9.3 gio-unix-2.0>=${GLIB_MINIMUM} glib-2.0>=${GLIB_MINIMUM} gudev-1.0) + +if (ENABLE_TESTS) + list (APPEND SERVICE_DEPS properties-cpp>=0.0.1) +endif () + +pkg_check_modules (SERVICE_DEPS REQUIRED ${SERVICE_DEPS}) + include_directories (SYSTEM ${SERVICE_DEPS_INCLUDE_DIRS} ) -- cgit v1.2.3