Skip to content

Commit

Permalink
Add ALLOW_MISSING_GCONF build option
Browse files Browse the repository at this point in the history
  • Loading branch information
tatokis committed Nov 22, 2022
1 parent 0a3a923 commit a7f2c0e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ add_custom_target(uninstall
)

option(ENABLE_GCONF_MIGRATION "Enables GConf to GSettings migration for existing alarms (and adds a dependency to GConf)." ON)
option(ALLOW_MISSING_GCONF "Allows the project to build with GConf missing. Useful for existing installations (AUR) that already had GConf." OFF)
if(ENABLE_GCONF_MIGRATION)
add_subdirectory("gconf-migration")
endif()
Expand Down
10 changes: 9 additions & 1 deletion gconf-migration/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# SPDX-License-Identifier: GPL-2.0-or-later
pkg_check_modules(GCONF2 REQUIRED gconf-2.0)
pkg_check_modules(GIO REQUIRED gio-2.0)
pkg_check_modules(GCONF2 gconf-2.0)
if(NOT GCONF2_FOUND)
if(ALLOW_MISSING_GCONF)
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.")
return()
else()
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.")
endif()
endif()

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

0 comments on commit a7f2c0e

Please sign in to comment.