diff options
author | Yacine Hmito <yacine.hmito@gmail.com> | 2015-12-01 00:38:23 +0100 |
---|---|---|
committer | Yacine Hmito <yacine.hmito@gmail.com> | 2015-12-01 01:07:48 +0100 |
commit | 09feef89eea03527c9c81b8d15fe8c1474942209 (patch) | |
tree | 4a9ecf5416f6e109f60aa6834eec43cba5267d5d /CMakeLists.txt | |
parent | Add framework for switching command sets (diff) | |
download | sway-09feef89eea03527c9c81b8d15fe8c1474942209.tar.gz sway-09feef89eea03527c9c81b8d15fe8c1474942209.tar.zst sway-09feef89eea03527c9c81b8d15fe8c1474942209.zip |
Can customize config fallback directory
CMake takes a `FALLBACK_CONFIG_DIR` flag which is the directory where the
standard configuration file `config` is copied at installation.
If loading from typical configuration directories fails, sway loads
FALLBACK_CONFIG_DIR/config (/etc/sway/config by default).
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 1298a2ce..9e1e1dde 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -2,6 +2,9 @@ cmake_minimum_required(VERSION 3.1.0) | |||
2 | 2 | ||
3 | project(sway C) | 3 | project(sway C) |
4 | 4 | ||
5 | set(FALLBACK_CONFIG_DIR "/etc/sway/") | ||
6 | add_definitions('-DFALLBACK_CONFIG_DIR=\"${FALLBACK_CONFIG_DIR}\"') | ||
7 | |||
5 | set(CMAKE_C_FLAGS "-g") | 8 | set(CMAKE_C_FLAGS "-g") |
6 | set(CMAKE_C_STANDARD 99) | 9 | set(CMAKE_C_STANDARD 99) |
7 | SET(CMAKE_C_EXTENSIONS OFF) | 10 | SET(CMAKE_C_EXTENSIONS OFF) |
@@ -80,7 +83,7 @@ install( | |||
80 | COMPONENT runtime) | 83 | COMPONENT runtime) |
81 | install( | 84 | install( |
82 | FILES "${CMAKE_CURRENT_SOURCE_DIR}/config" | 85 | FILES "${CMAKE_CURRENT_SOURCE_DIR}/config" |
83 | DESTINATION /etc/sway/ | 86 | DESTINATION "${FALLBACK_CONFIG_DIR}" |
84 | COMPONENT configuration) | 87 | COMPONENT configuration) |
85 | 88 | ||
86 | add_custom_target(man ALL) | 89 | add_custom_target(man ALL) |