swayfx/sway/CMakeLists.txt

115 lines
2.4 KiB
CMake
Raw Normal View History

2015-12-02 07:25:22 +11:00
include_directories(
${PROTOCOLS_INCLUDE_DIRS}
2015-12-02 07:25:22 +11:00
${WLC_INCLUDE_DIRS}
2017-10-12 12:04:56 +11:00
${WLR_INCLUDE_DIRS}
2015-12-02 07:25:22 +11:00
${PCRE_INCLUDE_DIRS}
${JSONC_INCLUDE_DIRS}
${XKBCOMMON_INCLUDE_DIRS}
2016-01-22 15:17:33 +11:00
${LIBINPUT_INCLUDE_DIRS}
${CAIRO_INCLUDE_DIRS}
${PANGO_INCLUDE_DIRS}
${WAYLAND_INCLUDE_DIR}
2015-12-02 07:25:22 +11:00
)
2016-09-02 12:39:08 +10:00
file(GLOB cmds
"commands/*.c"
"commands/bar/*.c"
"commands/input/*.c"
)
2015-12-02 07:25:22 +11:00
add_executable(sway
desktop/output.c
desktop/xdg_shell_v6.c
tree/container.c
tree/criteria.c
tree/focus.c
tree/output.c
tree/workspace.c
tree/layout.c
input/input.c
commands.c
${cmds}
2017-07-08 05:51:34 +10:00
base64.c
config.c
debug_log.c
input_state.c
2016-07-05 04:34:44 +10:00
ipc-json.c
ipc-server.c
main.c
border.c
2017-07-08 05:51:34 +10:00
security.c
server.c
2015-12-02 07:25:22 +11:00
)
add_definitions(
-DSYSCONFDIR="${CMAKE_INSTALL_FULL_SYSCONFDIR}"
)
2015-12-02 07:25:22 +11:00
target_link_libraries(sway
sway-common
sway-protocols
sway-wayland
2015-12-02 07:25:22 +11:00
${WLC_LIBRARIES}
2017-10-12 12:04:56 +11:00
${WLR_LIBRARIES}
2015-12-02 07:25:22 +11:00
${XKBCOMMON_LIBRARIES}
${PCRE_LIBRARIES}
${JSONC_LIBRARIES}
${WAYLAND_SERVER_LIBRARIES}
2016-01-17 21:53:37 +11:00
${LIBINPUT_LIBRARIES}
${PANGO_LIBRARIES}
${JSONC_LIBRARIES}
m
2015-12-02 07:25:22 +11:00
)
if (CMAKE_SYSTEM_NAME STREQUAL Linux)
target_link_libraries(sway cap)
endif (CMAKE_SYSTEM_NAME STREQUAL Linux)
2015-12-02 07:25:22 +11:00
install(
TARGETS sway
RUNTIME
DESTINATION bin
COMPONENT runtime
)
add_custom_target(configs ALL)
function(add_config name source destination)
add_custom_command(
OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}
COMMAND sed -r
's?__PREFIX__?${CMAKE_INSTALL_PREFIX}?g\; s?__SYSCONFDIR__?${CMAKE_INSTALL_FULL_SYSCONFDIR}?g\; s?__DATADIR__?${CMAKE_INSTALL_FULL_DATADIR}?g'
${PROJECT_SOURCE_DIR}/${source}.in > ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}
DEPENDS ${PROJECT_SOURCE_DIR}/${source}.in
COMMENT "Generating config file ${source}"
)
install(
FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}
DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/${destination}
COMPONENT configuration
)
add_custom_target(config-${name} DEPENDS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name})
add_dependencies(configs config-${name})
endfunction()
add_config(config config sway)
2017-02-19 18:36:36 +11:00
add_config(00-defaults security.d/00-defaults sway/security.d)
2015-12-02 21:47:34 +11:00
2017-07-11 18:56:07 +10:00
if (CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
add_config(10-freebsd security.d/10-freebsd sway/security.d)
endif (CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
if (A2X_FOUND)
add_manpage(sway 1)
add_manpage(sway 5)
add_manpage(sway-input 5)
add_manpage(sway-bar 5)
add_manpage(sway-security 7)
endif()