Fix default search path for configurations
Modified lookup of system configuration to accomodate the new XDG locations. Add an XDG_CONFIG_DIR variable to cmake to help find/set the system-wide configuration location. Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
8329d7e1c5
commit
84796930b7
|
@ -233,6 +233,14 @@ else()
|
|||
set(SYSCONFDIR ${PREFIX}/etc CACHE PATH "config directory")
|
||||
endif()
|
||||
|
||||
#If an XDG Config Dir is specificed, use it instead
|
||||
#of the default XDG configuration dir.
|
||||
if(DEFINED XDG_CONFIG_DIR)
|
||||
set(XDG_CONFIG_DIR ${XDG_CONFIG_SYS} CACHE PATH "xdg config directory")
|
||||
else()
|
||||
set(XDG_CONFIG_DIR ${SYSCONFDIR}/xdg CACHE PATH "xdg config directory")
|
||||
endif()
|
||||
|
||||
# Hide to avoid confusion
|
||||
mark_as_advanced(CMAKE_INSTALL_PREFIX)
|
||||
|
||||
|
@ -241,7 +249,7 @@ set(AWESOME_COMPILE_MACHINE ${CMAKE_SYSTEM_PROCESSOR})
|
|||
set(AWESOME_COMPILE_HOSTNAME ${BUILDHOSTNAME})
|
||||
set(AWESOME_COMPILE_BY $ENV{USER})
|
||||
set(AWESOME_RELEASE ${CODENAME})
|
||||
set(AWESOME_SYSCONFDIR ${SYSCONFDIR}/xdg/${PROJECT_AWE_NAME})
|
||||
set(AWESOME_SYSCONFDIR ${XDG_CONFIG_DIR}/${PROJECT_AWE_NAME})
|
||||
set(AWESOME_DATA_PATH ${PREFIX}/share/${PROJECT_AWE_NAME})
|
||||
set(AWESOME_DOC_PATH ${PREFIX}/share/doc/${PROJECT_AWE_NAME})
|
||||
set(AWESOME_MAN_PATH ${PREFIX}/share/man)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define _CONFIG_H_
|
||||
|
||||
#define AWESOME_LUA_LIB_PATH "@AWESOME_LUA_LIB_PATH@"
|
||||
#define SYSCONFDIR "@SYSCONFDIR@"
|
||||
#define XDG_CONFIG_DIR "@XDG_CONFIG_DIR@"
|
||||
|
||||
#cmakedefine WITH_DBUS
|
||||
#cmakedefine WITH_IMLIB2
|
||||
|
|
Loading…
Reference in New Issue