summaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2016-12-02 15:56:36 -0500
committerLibravatar Drew DeVault <sir@cmpwn.com>2016-12-02 15:56:36 -0500
commit25a4a85a59802d3e437129370945d4b4a662c7b2 (patch)
treeb38201157a52dc222014ae2046461c2312f45db8 /sway
parentClarify lock permission consequences (diff)
downloadsway-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.txt30
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)
66install( 66
67 FILES ${PROJECT_SOURCE_DIR}/config 67add_custom_target(configs ALL)
68 DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/sway/ 68
69 COMPONENT configuration 69function(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})
87endfunction()
88
89add_config(config config sway)
90add_config(security config.d/security sway/config.d)
71 91
72add_manpage(sway 1) 92add_manpage(sway 1)
73add_manpage(sway 5) 93add_manpage(sway 5)