Skip to content

Commit a7f2c0e

Browse files
committed
Add ALLOW_MISSING_GCONF build option
1 parent 0a3a923 commit a7f2c0e

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ add_custom_target(uninstall
1515
)
1616

1717
option(ENABLE_GCONF_MIGRATION "Enables GConf to GSettings migration for existing alarms (and adds a dependency to GConf)." ON)
18+
option(ALLOW_MISSING_GCONF "Allows the project to build with GConf missing. Useful for existing installations (AUR) that already had GConf." OFF)
1819
if(ENABLE_GCONF_MIGRATION)
1920
add_subdirectory("gconf-migration")
2021
endif()

gconf-migration/CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# SPDX-License-Identifier: GPL-2.0-or-later
2-
pkg_check_modules(GCONF2 REQUIRED gconf-2.0)
32
pkg_check_modules(GIO REQUIRED gio-2.0)
3+
pkg_check_modules(GCONF2 gconf-2.0)
4+
if(NOT GCONF2_FOUND)
5+
if(ALLOW_MISSING_GCONF)
6+
message(WARNING "GConf was not found but the package will still be built.\nIf you want to migrate old alarms created by alarm-clock-applet < 0.4.0, please install GConf and re-run CMake/rebuild the package.")
7+
return()
8+
else()
9+
message(FATAL_ERROR "GConf not found.\nPlease install it or pass `-DENABLE_GCONF_MIGRATION=OFF` if you do not want to migrate alarms created by alarm-clock-applet < 0.4.0.")
10+
endif()
11+
endif()
412

513
add_executable(alarm-clock-applet-gconf-migration alarm-clock-gconf-migration.c)
614
set_property(TARGET alarm-clock-applet-gconf-migration PROPERTY C_STANDARD 11)

0 commit comments

Comments
 (0)