diff options
author | Drew DeVault <sir@cmpwn.com> | 2016-12-02 15:56:36 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2016-12-02 15:56:36 -0500 |
commit | 25a4a85a59802d3e437129370945d4b4a662c7b2 (patch) | |
tree | b38201157a52dc222014ae2046461c2312f45db8 /sway | |
parent | Clarify lock permission consequences (diff) | |
download | sway-25a4a85a59802d3e437129370945d4b4a662c7b2.tar.gz sway-25a4a85a59802d3e437129370945d4b4a662c7b2.tar.zst sway-25a4a85a59802d3e437129370945d4b4a662c7b2.zip |
Run config files through sed and install to /etc
Diffstat (limited to 'sway')
-rw-r--r-- | sway/CMakeLists.txt | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/sway/CMakeLists.txt b/sway/CMakeLists.txt index 89388220..15fa1720 100644 --- a/sway/CMakeLists.txt +++ b/sway/CMakeLists.txt | |||
@@ -63,11 +63,31 @@ install( | |||
63 | DESTINATION bin | 63 | DESTINATION bin |
64 | COMPONENT runtime | 64 | COMPONENT runtime |
65 | ) | 65 | ) |
66 | install( | 66 | |
67 | FILES ${PROJECT_SOURCE_DIR}/config | 67 | add_custom_target(configs ALL) |
68 | DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/sway/ | 68 | |
69 | COMPONENT configuration | 69 | function(add_config name source destination) |
70 | ) | 70 | add_custom_command( |
71 | OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name} | ||
72 | COMMAND sed -r | ||
73 | 's?__PREFIX__?${CMAKE_INSTALL_PREFIX}?g\; s?__SYSCONFDIR__?${CMAKE_INSTALL_FULL_SYSCONFDIR}?g' | ||
74 | ${PROJECT_SOURCE_DIR}/${source}.in > ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name} | ||
75 | DEPENDS ${PROJECT_SOURCE_DIR}/${source}.in | ||
76 | COMMENT "Generating config file ${source}" | ||
77 | ) | ||
78 | |||
79 | install( | ||
80 | FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name} | ||
81 | DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/${destination} | ||
82 | COMPONENT configuration | ||
83 | ) | ||
84 | |||
85 | add_custom_target(config-${name} DEPENDS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}) | ||
86 | add_dependencies(configs config-${name}) | ||
87 | endfunction() | ||
88 | |||
89 | add_config(config config sway) | ||
90 | add_config(security config.d/security sway/config.d) | ||
71 | 91 | ||
72 | add_manpage(sway 1) | 92 | add_manpage(sway 1) |
73 | add_manpage(sway 5) | 93 | add_manpage(sway 5) |