Stop configuring if wxUSE_SECRETSTORE=ON but libsecret not found

This is similar to dd745f1e37 (Error in configure if wxSecretStore
requested but not available, 2025-05-27) but for CMake: allow requesting
wxSecretStore to be available by setting wxUSE_SECRETSTORE=ON explicitly
and failing in this case if libsecret is not found.
This commit is contained in:
Vadim Zeitlin
2025-07-31 19:52:03 +02:00
parent 09fb3af763
commit 36c15805cc
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -400,6 +400,11 @@ if(UNIX)
# have GNOME libsecret under Unix to be able to compile this class.
find_package(LIBSECRET)
if(NOT LIBSECRET_FOUND)
if(wxUSE_SECRETSTORE STREQUAL ON)
message(FATAL_ERROR "wxSecretStore support requested, but libsecret was not found: either install it or don't set wxUSE_SECRETSTORE to ON")
endif()
# wxUSE_SECRETSTORE must be AUTO, continue with a warning.
message(WARNING "libsecret not found, wxSecretStore won't be available")
wx_option_force_value(wxUSE_SECRETSTORE OFF)
endif()
+1 -1
View File
@@ -221,7 +221,7 @@ wx_option(wxUSE_GEOMETRY "use geometry class")
wx_option(wxUSE_LOG "use logging system")
wx_option(wxUSE_MIMETYPE "use wxMimeTypesManager")
wx_option(wxUSE_PRINTF_POS_PARAMS "use wxVsnprintf() which supports positional parameters")
wx_option(wxUSE_SECRETSTORE "use wxSecretStore class")
wx_option_auto(wxUSE_SECRETSTORE "use wxSecretStore class")
wx_option(wxUSE_SNGLINST_CHECKER "use wxSingleInstanceChecker class")
wx_option(wxUSE_SOUND "use wxSound class")
wx_option(wxUSE_SPELLCHECK "enable spell checking in wxTextCtrl")