File: FindInstallConfigPath.cmake

package info (click to toggle)
lxqt-build-tools-qt5 0.13.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 348 kB
  • sloc: sh: 203; perl: 42; makefile: 6
file content (26 lines) | stat: -rw-r--r-- 1,118 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# XDG standards expects system-wide configuration files in the /etc/xdg/lxqt location.
# Unfortunately QSettings we are using internally can be overriden in the Qt compilation
# time to use different path for system-wide configs. (for example configure ... -sysconfdir /etc/settings ...)
# This path can be found calling Qt4's qmake:
#   qmake -query QT_INSTALL_CONFIGURATION
#

find_package(Qt5Core REQUIRED)

if(NOT DEFINED LXQT_ETC_XDG_DIR)
    get_target_property(QT_QMAKE_EXECUTABLE ${Qt5Core_QMAKE_EXECUTABLE} IMPORTED_LOCATION)
    message(STATUS "${QT_QMAKE_EXECUTABLE}")

    if(NOT QT_QMAKE_EXECUTABLE)
        message(FATAL_ERROR "LXQT_ETC_XDG_DIR: qmake executable not found (included before qt was configured?)")
    endif()

    execute_process(COMMAND ${QT_QMAKE_EXECUTABLE} -query QT_INSTALL_CONFIGURATION
                    OUTPUT_VARIABLE LXQT_ETC_XDG_DIR
                    OUTPUT_STRIP_TRAILING_WHITESPACE)

    message(STATUS "LXQT_ETC_XDG_DIR autodetected as '${LXQT_ETC_XDG_DIR}'")
    message(STATUS "You can set it manually with -DLXQT_ETC_XDG_DIR=<value>")
    message(STATUS "")
endif ()