summaryrefslogtreecommitdiffstats
path: root/sway/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'sway/CMakeLists.txt')
-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)