summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmake/QtBuild.cmake27
-rw-r--r--src/corelib/global/qconfig.cpp.in2
2 files changed, 18 insertions, 11 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index 28bf5533d6..0ab5dc2ff4 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -26,10 +26,16 @@ function(qt_configure_process_path name default docstring)
# file(RELATIVE_PATH) returns an empty string if the given absolute paths are equal
set(rel_path ".")
elseif(rel_path MATCHES "^\.\./")
- message(FATAL_ERROR
- "Path component '${name}' is outside computed install prefix: ${rel_path} ")
+ # INSTALL_SYSCONFDIR is allowed to be outside the prefix.
+ if(NOT name STREQUAL "INSTALL_SYSCONFDIR")
+ message(FATAL_ERROR
+ "Path component '${name}' is outside computed install prefix: ${rel_path} ")
+ return()
+ endif()
+ set("${name}" "${${name}}" CACHE STRING "${docstring}" FORCE)
+ else()
+ set("${name}" "${rel_path}" CACHE STRING "${docstring}" FORCE)
endif()
- set("${name}" "${rel_path}" CACHE STRING "${docstring}" FORCE)
endif()
endfunction()
@@ -116,9 +122,14 @@ qt_configure_process_path(INSTALL_DATADIR "." "Arch-independent data [PREFIX]")
qt_configure_process_path(INSTALL_DOCDIR "${INSTALL_DATADIR}/doc" "Documentation [DATADIR/doc]")
qt_configure_process_path(INSTALL_TRANSLATIONSDIR "${INSTALL_DATADIR}/translations"
"Translations [DATADIR/translations]")
+if(APPLE)
+ set(QT_DEFAULT_SYS_CONF_DIR "/Library/Preferences/Qt")
+else()
+ set(QT_DEFAULT_SYS_CONF_DIR "etc/xdg")
+endif()
qt_configure_process_path(INSTALL_SYSCONFDIR
- "etc/xdg"
- "Settings used by Qt programs [PREFIX/etc/xdg]")
+ "${QT_DEFAULT_SYS_CONF_DIR}"
+ "Settings used by Qt programs [PREFIX/etc/xdg]/[/Library/Preferences/Qt]")
qt_configure_process_path(INSTALL_EXAMPLESDIR "examples" "Examples [PREFIX/examples]")
qt_configure_process_path(INSTALL_TESTSDIR "tests" "Tests [PREFIX/tests]")
qt_configure_process_path(INSTALL_DESCRIPTIONSDIR
@@ -5830,11 +5841,7 @@ function(qt_generate_qconfig_cpp)
set(QT_CONFIG_STRS_SECOND "${QT_CONFIG_STRS}")
# Settings path / sysconf dir.
- if(APPLE)
- set(QT_DEFAULT_SYS_CONF_DIR "/Library/Preferences/Qt")
- else()
- set(QT_DEFAULT_SYS_CONF_DIR "etc/xdg")
- endif()
+ set(QT_SYS_CONF_DIR "${INSTALL_SYSCONFDIR}")
# Compute and set relocation prefixes.
# TODO: Clean this up, there's a bunch of unrealistic assumptions here.
diff --git a/src/corelib/global/qconfig.cpp.in b/src/corelib/global/qconfig.cpp.in
index 5c6ecf2485..664924abec 100644
--- a/src/corelib/global/qconfig.cpp.in
+++ b/src/corelib/global/qconfig.cpp.in
@@ -18,7 +18,7 @@ static const char qt_configure_strs[] =
@QT_CONFIG_STRS_SECOND@
#endif
;
-#define QT_CONFIGURE_SETTINGS_PATH "@QT_DEFAULT_SYS_CONF_DIR@"
+#define QT_CONFIGURE_SETTINGS_PATH "@QT_SYS_CONF_DIR@"
#define QT_CONFIGURE_LIBLOCATION_TO_PREFIX_PATH "@QT_CONFIGURE_LIBLOCATION_TO_PREFIX_PATH@"
#define QT_CONFIGURE_HOSTBINDIR_TO_EXTPREFIX_PATH "@QT_CONFIGURE_HOSTBINDIR_TO_EXTPREFIX_PATH@"
#define QT_CONFIGURE_HOSTBINDIR_TO_HOSTPREFIX_PATH "@QT_CONFIGURE_HOSTBINDIR_TO_HOSTPREFIX_PATH@"