Skip to content

Commit a171a26

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

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

CMakeLists.txt

+1
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

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
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+
add_custom_target(alarm-clock-applet-gconf-migration)
8+
return()
9+
else()
10+
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.")
11+
endif()
12+
endif()
413

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

0 commit comments

Comments
 (0)