aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt132
1 files changed, 66 insertions, 66 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 09cc4091..8d8c3c6a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,21 +13,21 @@ set(CMAKE_CURRENT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/bin")
13set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") 13set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
14add_definitions("-Wall -Wextra -Wno-unused-parameter -D_GNU_SOURCE") 14add_definitions("-Wall -Wextra -Wno-unused-parameter -D_GNU_SOURCE")
15list(INSERT CMAKE_MODULE_PATH 0 15list(INSERT CMAKE_MODULE_PATH 0
16 "${CMAKE_CURRENT_SOURCE_DIR}/CMake" 16 "${CMAKE_CURRENT_SOURCE_DIR}/CMake"
17) 17)
18if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git") 18if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
19 execute_process( 19 execute_process(
20 COMMAND git describe --always 20 COMMAND git describe --always
21 OUTPUT_VARIABLE GIT_COMMIT_HASH 21 OUTPUT_VARIABLE GIT_COMMIT_HASH
22 OUTPUT_STRIP_TRAILING_WHITESPACE 22 OUTPUT_STRIP_TRAILING_WHITESPACE
23 WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" 23 WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
24 ) 24 )
25 execute_process( 25 execute_process(
26 COMMAND git rev-parse --abbrev-ref HEAD 26 COMMAND git rev-parse --abbrev-ref HEAD
27 OUTPUT_VARIABLE GIT_BRANCH 27 OUTPUT_VARIABLE GIT_BRANCH
28 OUTPUT_STRIP_TRAILING_WHITESPACE 28 OUTPUT_STRIP_TRAILING_WHITESPACE
29 WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" 29 WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
30 ) 30 )
31endif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git") 31endif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
32 32
33add_definitions("-DSWAY_GIT_VERSION=\"g${GIT_COMMIT_HASH}\"") 33add_definitions("-DSWAY_GIT_VERSION=\"g${GIT_COMMIT_HASH}\"")
@@ -55,72 +55,72 @@ file(GLOB common ${PROJECT_SOURCE_DIR}/common/*.c)
55 55
56include(Wayland) 56include(Wayland)
57WAYLAND_ADD_PROTOCOL_SERVER(proto-desktop-shell 57WAYLAND_ADD_PROTOCOL_SERVER(proto-desktop-shell
58 "${PROJECT_SOURCE_DIR}/protocols/desktop-shell.xml" 58 "${PROJECT_SOURCE_DIR}/protocols/desktop-shell.xml"
59 desktop-shell 59 desktop-shell
60) 60)
61 61
62include_directories( 62include_directories(
63 ${WLC_INCLUDE_DIRS} 63 ${WLC_INCLUDE_DIRS}
64 ${PCRE_INCLUDE_DIRS} 64 ${PCRE_INCLUDE_DIRS}
65 ${JSONC_INCLUDE_DIRS} 65 ${JSONC_INCLUDE_DIRS}
66 ${XKBCOMMON_INCLUDE_DIRS} 66 ${XKBCOMMON_INCLUDE_DIRS}
67 ${CMAKE_CURRENT_BINARY_DIR} 67 ${CMAKE_CURRENT_BINARY_DIR}
68) 68)
69 69
70add_executable(sway 70add_executable(sway
71 ${sources} 71 ${sources}
72 ${common} 72 ${common}
73 ${proto-desktop-shell} 73 ${proto-desktop-shell}
74) 74)
75 75
76target_link_libraries(sway 76target_link_libraries(sway
77 ${WLC_LIBRARIES} 77 ${WLC_LIBRARIES}
78 ${XKBCOMMON_LIBRARIES} 78 ${XKBCOMMON_LIBRARIES}
79 ${PCRE_LIBRARIES} 79 ${PCRE_LIBRARIES}
80 ${JSONC_LIBRARIES} 80 ${JSONC_LIBRARIES}
81 ${WAYLAND_SERVER_LIBRARIES} 81 ${WAYLAND_SERVER_LIBRARIES}
82) 82)
83 83
84install( 84install(
85 TARGETS sway 85 TARGETS sway
86 RUNTIME 86 RUNTIME
87 DESTINATION bin 87 DESTINATION bin
88 COMPONENT runtime 88 COMPONENT runtime
89) 89)
90install( 90install(
91 FILES "${CMAKE_CURRENT_SOURCE_DIR}/config" 91 FILES "${CMAKE_CURRENT_SOURCE_DIR}/config"
92 DESTINATION "${FALLBACK_CONFIG_DIR}" 92 DESTINATION "${FALLBACK_CONFIG_DIR}"
93 COMPONENT configuration 93 COMPONENT configuration
94) 94)
95 95
96add_custom_target(man ALL) 96add_custom_target(man ALL)
97 97
98function(add_manpage name section) 98function(add_manpage name section)
99 add_custom_command( 99 add_custom_command(
100 OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${name}.${section}" 100 OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${name}.${section}"
101 COMMAND "${A2X_COMMAND}" 101 COMMAND "${A2X_COMMAND}"
102 --no-xmllint 102 --no-xmllint
103 --doctype manpage 103 --doctype manpage
104 --format manpage 104 --format manpage
105 -D "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" 105 -D "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
106 "${CMAKE_CURRENT_SOURCE_DIR}/${name}.${section}.txt" 106 "${CMAKE_CURRENT_SOURCE_DIR}/${name}.${section}.txt"
107 DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${name}.${section}.txt" 107 DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${name}.${section}.txt"
108 COMMENT "Generating manpage for ${name}.${section}" 108 COMMENT "Generating manpage for ${name}.${section}"
109 ) 109 )
110 110
111 add_custom_target("man-${name}.${section}" 111 add_custom_target("man-${name}.${section}"
112 DEPENDS 112 DEPENDS
113 "${CMAKE_CURRENT_BINARY_DIR}/${name}.${section}" 113 "${CMAKE_CURRENT_BINARY_DIR}/${name}.${section}"
114 ) 114 )
115 add_dependencies(man 115 add_dependencies(man
116 "man-${name}.${section}" 116 "man-${name}.${section}"
117 ) 117 )
118 118
119 install( 119 install(
120 FILES "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}.${section}" 120 FILES "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}.${section}"
121 DESTINATION "share/man/man${section}" 121 DESTINATION "share/man/man${section}"
122 COMPONENT documentation 122 COMPONENT documentation
123 ) 123 )
124endfunction() 124endfunction()
125 125
126add_manpage(sway 1) 126add_manpage(sway 1)
@@ -129,12 +129,12 @@ add_manpage(swaymsg 1)
129add_manpage(swaygrab 1) 129add_manpage(swaygrab 1)
130 130
131install( 131install(
132 FILES "${CMAKE_CURRENT_SOURCE_DIR}/sway.desktop" 132 FILES "${CMAKE_CURRENT_SOURCE_DIR}/sway.desktop"
133 DESTINATION share/wayland-sessions 133 DESTINATION share/wayland-sessions
134 COMPONENT data 134 COMPONENT data
135) 135)
136install( 136install(
137 FILES "${CMAKE_CURRENT_SOURCE_DIR}/sway-xorg.desktop" 137 FILES "${CMAKE_CURRENT_SOURCE_DIR}/sway-xorg.desktop"
138 DESTINATION share/xsessions 138 DESTINATION share/xsessions
139 COMPONENT data 139 COMPONENT data
140) 140)