1
0
Fork 0
mirror of https://github.com/NickHu/sway synced 2025-01-30 08:34:14 +01:00

cmake: use tabs instead of spaces

This commit is contained in:
Christoph Gysin 2015-12-01 21:46:10 +02:00
parent 905966bcae
commit f7ec3d00a0
5 changed files with 121 additions and 121 deletions

View file

@ -13,21 +13,21 @@ set(CMAKE_CURRENT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/bin")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
add_definitions("-Wall -Wextra -Wno-unused-parameter -D_GNU_SOURCE") add_definitions("-Wall -Wextra -Wno-unused-parameter -D_GNU_SOURCE")
list(INSERT CMAKE_MODULE_PATH 0 list(INSERT CMAKE_MODULE_PATH 0
"${CMAKE_CURRENT_SOURCE_DIR}/CMake" "${CMAKE_CURRENT_SOURCE_DIR}/CMake"
) )
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git") if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
execute_process( execute_process(
COMMAND git describe --always COMMAND git describe --always
OUTPUT_VARIABLE GIT_COMMIT_HASH OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
) )
execute_process( execute_process(
COMMAND git rev-parse --abbrev-ref HEAD COMMAND git rev-parse --abbrev-ref HEAD
OUTPUT_VARIABLE GIT_BRANCH OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
) )
endif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git") endif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
add_definitions("-DSWAY_GIT_VERSION=\"g${GIT_COMMIT_HASH}\"") add_definitions("-DSWAY_GIT_VERSION=\"g${GIT_COMMIT_HASH}\"")
@ -55,72 +55,72 @@ file(GLOB common ${PROJECT_SOURCE_DIR}/common/*.c)
include(Wayland) include(Wayland)
WAYLAND_ADD_PROTOCOL_SERVER(proto-desktop-shell WAYLAND_ADD_PROTOCOL_SERVER(proto-desktop-shell
"${PROJECT_SOURCE_DIR}/protocols/desktop-shell.xml" "${PROJECT_SOURCE_DIR}/protocols/desktop-shell.xml"
desktop-shell desktop-shell
) )
include_directories( include_directories(
${WLC_INCLUDE_DIRS} ${WLC_INCLUDE_DIRS}
${PCRE_INCLUDE_DIRS} ${PCRE_INCLUDE_DIRS}
${JSONC_INCLUDE_DIRS} ${JSONC_INCLUDE_DIRS}
${XKBCOMMON_INCLUDE_DIRS} ${XKBCOMMON_INCLUDE_DIRS}
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
) )
add_executable(sway add_executable(sway
${sources} ${sources}
${common} ${common}
${proto-desktop-shell} ${proto-desktop-shell}
) )
target_link_libraries(sway target_link_libraries(sway
${WLC_LIBRARIES} ${WLC_LIBRARIES}
${XKBCOMMON_LIBRARIES} ${XKBCOMMON_LIBRARIES}
${PCRE_LIBRARIES} ${PCRE_LIBRARIES}
${JSONC_LIBRARIES} ${JSONC_LIBRARIES}
${WAYLAND_SERVER_LIBRARIES} ${WAYLAND_SERVER_LIBRARIES}
) )
install( install(
TARGETS sway TARGETS sway
RUNTIME RUNTIME
DESTINATION bin DESTINATION bin
COMPONENT runtime COMPONENT runtime
) )
install( install(
FILES "${CMAKE_CURRENT_SOURCE_DIR}/config" FILES "${CMAKE_CURRENT_SOURCE_DIR}/config"
DESTINATION "${FALLBACK_CONFIG_DIR}" DESTINATION "${FALLBACK_CONFIG_DIR}"
COMPONENT configuration COMPONENT configuration
) )
add_custom_target(man ALL) add_custom_target(man ALL)
function(add_manpage name section) function(add_manpage name section)
add_custom_command( add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${name}.${section}" OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${name}.${section}"
COMMAND "${A2X_COMMAND}" COMMAND "${A2X_COMMAND}"
--no-xmllint --no-xmllint
--doctype manpage --doctype manpage
--format manpage --format manpage
-D "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" -D "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
"${CMAKE_CURRENT_SOURCE_DIR}/${name}.${section}.txt" "${CMAKE_CURRENT_SOURCE_DIR}/${name}.${section}.txt"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${name}.${section}.txt" DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${name}.${section}.txt"
COMMENT "Generating manpage for ${name}.${section}" COMMENT "Generating manpage for ${name}.${section}"
) )
add_custom_target("man-${name}.${section}" add_custom_target("man-${name}.${section}"
DEPENDS DEPENDS
"${CMAKE_CURRENT_BINARY_DIR}/${name}.${section}" "${CMAKE_CURRENT_BINARY_DIR}/${name}.${section}"
) )
add_dependencies(man add_dependencies(man
"man-${name}.${section}" "man-${name}.${section}"
) )
install( install(
FILES "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}.${section}" FILES "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}.${section}"
DESTINATION "share/man/man${section}" DESTINATION "share/man/man${section}"
COMPONENT documentation COMPONENT documentation
) )
endfunction() endfunction()
add_manpage(sway 1) add_manpage(sway 1)
@ -129,12 +129,12 @@ add_manpage(swaymsg 1)
add_manpage(swaygrab 1) add_manpage(swaygrab 1)
install( install(
FILES "${CMAKE_CURRENT_SOURCE_DIR}/sway.desktop" FILES "${CMAKE_CURRENT_SOURCE_DIR}/sway.desktop"
DESTINATION share/wayland-sessions DESTINATION share/wayland-sessions
COMPONENT data COMPONENT data
) )
install( install(
FILES "${CMAKE_CURRENT_SOURCE_DIR}/sway-xorg.desktop" FILES "${CMAKE_CURRENT_SOURCE_DIR}/sway-xorg.desktop"
DESTINATION share/xsessions DESTINATION share/xsessions
COMPONENT data COMPONENT data
) )

View file

@ -7,19 +7,19 @@ find_package(Pango REQUIRED)
include(Wayland) include(Wayland)
set(CMAKE_CURRENT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../bin/) set(CMAKE_CURRENT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../bin/)
WAYLAND_ADD_PROTOCOL_CLIENT(proto-xdg-shell WAYLAND_ADD_PROTOCOL_CLIENT(proto-xdg-shell
"${PROJECT_SOURCE_DIR}/../protocols/xdg-shell.xml" "${PROJECT_SOURCE_DIR}/../protocols/xdg-shell.xml"
xdg-shell xdg-shell
) )
WAYLAND_ADD_PROTOCOL_CLIENT(proto-desktop-shell WAYLAND_ADD_PROTOCOL_CLIENT(proto-desktop-shell
"${PROJECT_SOURCE_DIR}/../protocols/desktop-shell.xml" "${PROJECT_SOURCE_DIR}/../protocols/desktop-shell.xml"
desktop-shell desktop-shell
) )
include_directories( include_directories(
${WAYLAND_CLIENT_INCLUDE_DIR} ${WAYLAND_CLIENT_INCLUDE_DIR}
${CAIRO_INCLUDE_DIRS} ${CAIRO_INCLUDE_DIRS}
${PANGO_INCLUDE_DIRS} ${PANGO_INCLUDE_DIRS}
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
) )
file(GLOB sources ${PROJECT_SOURCE_DIR}/*.c) file(GLOB sources ${PROJECT_SOURCE_DIR}/*.c)
@ -27,24 +27,24 @@ file(GLOB common ${PROJECT_SOURCE_DIR}/../common/*.c)
file(GLOB wl_sources ${PROJECT_SOURCE_DIR}/../wayland/*.c) file(GLOB wl_sources ${PROJECT_SOURCE_DIR}/../wayland/*.c)
add_executable(swaybar add_executable(swaybar
${sources} ${sources}
${wl_sources} ${wl_sources}
${common} ${common}
${proto-xdg-shell} ${proto-xdg-shell}
${proto-desktop-shell} ${proto-desktop-shell}
) )
target_link_libraries(swaybar target_link_libraries(swaybar
${WAYLAND_CLIENT_LIBRARIES} ${WAYLAND_CLIENT_LIBRARIES}
${WAYLAND_CURSOR_LIBRARIES} ${WAYLAND_CURSOR_LIBRARIES}
${CAIRO_LIBRARIES} ${CAIRO_LIBRARIES}
${PANGO_LIBRARIES} ${PANGO_LIBRARIES}
m m
) )
install( install(
TARGETS swaybar TARGETS swaybar
RUNTIME RUNTIME
DESTINATION bin DESTINATION bin
COMPONENT runtime COMPONENT runtime
) )

View file

@ -7,19 +7,19 @@ find_package(Pango REQUIRED)
include(Wayland) include(Wayland)
set(CMAKE_CURRENT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../bin/) set(CMAKE_CURRENT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../bin/)
WAYLAND_ADD_PROTOCOL_CLIENT(proto-xdg-shell WAYLAND_ADD_PROTOCOL_CLIENT(proto-xdg-shell
"${PROJECT_SOURCE_DIR}/../protocols/xdg-shell.xml" "${PROJECT_SOURCE_DIR}/../protocols/xdg-shell.xml"
xdg-shell xdg-shell
) )
WAYLAND_ADD_PROTOCOL_CLIENT(proto-desktop-shell WAYLAND_ADD_PROTOCOL_CLIENT(proto-desktop-shell
"${PROJECT_SOURCE_DIR}/../protocols/desktop-shell.xml" "${PROJECT_SOURCE_DIR}/../protocols/desktop-shell.xml"
desktop-shell desktop-shell
) )
include_directories( include_directories(
${WAYLAND_CLIENT_INCLUDE_DIR} ${WAYLAND_CLIENT_INCLUDE_DIR}
${CAIRO_INCLUDE_DIRS} ${CAIRO_INCLUDE_DIRS}
${PANGO_INCLUDE_DIRS} ${PANGO_INCLUDE_DIRS}
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
) )
file(GLOB sources ${PROJECT_SOURCE_DIR}/*.c) file(GLOB sources ${PROJECT_SOURCE_DIR}/*.c)
@ -27,24 +27,24 @@ file(GLOB common ${PROJECT_SOURCE_DIR}/../common/*.c)
file(GLOB wl_sources ${PROJECT_SOURCE_DIR}/../wayland/*.c) file(GLOB wl_sources ${PROJECT_SOURCE_DIR}/../wayland/*.c)
add_executable(swaybg add_executable(swaybg
${sources} ${sources}
${wl_sources} ${wl_sources}
${common} ${common}
${proto-xdg-shell} ${proto-xdg-shell}
${proto-desktop-shell} ${proto-desktop-shell}
) )
target_link_libraries(swaybg target_link_libraries(swaybg
${WAYLAND_CLIENT_LIBRARIES} ${WAYLAND_CLIENT_LIBRARIES}
${WAYLAND_CURSOR_LIBRARIES} ${WAYLAND_CURSOR_LIBRARIES}
${CAIRO_LIBRARIES} ${CAIRO_LIBRARIES}
${PANGO_LIBRARIES} ${PANGO_LIBRARIES}
m m
) )
install( install(
TARGETS swaybg TARGETS swaybg
RUNTIME RUNTIME
DESTINATION bin DESTINATION bin
COMPONENT runtime COMPONENT runtime
) )

View file

@ -6,17 +6,17 @@ file(GLOB sources ${PROJECT_SOURCE_DIR}/*.c)
file(GLOB common ${PROJECT_SOURCE_DIR}/../common/*.c) file(GLOB common ${PROJECT_SOURCE_DIR}/../common/*.c)
add_executable(swaygrab add_executable(swaygrab
${sources} ${sources}
${common} ${common}
) )
target_link_libraries(swaygrab target_link_libraries(swaygrab
rt rt
) )
install( install(
TARGETS swaygrab TARGETS swaygrab
RUNTIME RUNTIME
DESTINATION bin DESTINATION bin
COMPONENT runtime COMPONENT runtime
) )

View file

@ -6,13 +6,13 @@ file(GLOB sources ${PROJECT_SOURCE_DIR}/*.c)
file(GLOB common ${PROJECT_SOURCE_DIR}/../common/*.c) file(GLOB common ${PROJECT_SOURCE_DIR}/../common/*.c)
add_executable(swaymsg add_executable(swaymsg
${sources} ${sources}
${common} ${common}
) )
install( install(
TARGETS swaymsg TARGETS swaymsg
RUNTIME RUNTIME
DESTINATION bin DESTINATION bin
COMPONENT runtime COMPONENT runtime
) )