diff options
-rw-r--r-- | CMakeLists.txt | 62 | ||||
-rw-r--r-- | swaybar/CMakeLists.txt | 26 | ||||
-rw-r--r-- | swaybg/CMakeLists.txt | 26 | ||||
-rw-r--r-- | swaygrab/CMakeLists.txt | 12 | ||||
-rw-r--r-- | swaymsg/CMakeLists.txt | 8 |
5 files changed, 90 insertions, 44 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c022d87d..09cc4091 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -13,8 +13,8 @@ set(CMAKE_CURRENT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/bin") | |||
13 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") | 13 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") |
14 | add_definitions("-Wall -Wextra -Wno-unused-parameter -D_GNU_SOURCE") | 14 | add_definitions("-Wall -Wextra -Wno-unused-parameter -D_GNU_SOURCE") |
15 | list(INSERT CMAKE_MODULE_PATH 0 | 15 | list(INSERT CMAKE_MODULE_PATH 0 |
16 | "${CMAKE_CURRENT_SOURCE_DIR}/CMake") | 16 | "${CMAKE_CURRENT_SOURCE_DIR}/CMake" |
17 | 17 | ) | |
18 | if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git") | 18 | if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git") |
19 | execute_process( | 19 | execute_process( |
20 | COMMAND git describe --always | 20 | COMMAND git describe --always |
@@ -54,14 +54,17 @@ file(GLOB sources ${PROJECT_SOURCE_DIR}/sway/*.c) | |||
54 | file(GLOB common ${PROJECT_SOURCE_DIR}/common/*.c) | 54 | file(GLOB common ${PROJECT_SOURCE_DIR}/common/*.c) |
55 | 55 | ||
56 | include(Wayland) | 56 | include(Wayland) |
57 | WAYLAND_ADD_PROTOCOL_SERVER(proto-desktop-shell "${PROJECT_SOURCE_DIR}/protocols/desktop-shell.xml" desktop-shell) | 57 | WAYLAND_ADD_PROTOCOL_SERVER(proto-desktop-shell |
58 | "${PROJECT_SOURCE_DIR}/protocols/desktop-shell.xml" | ||
59 | desktop-shell | ||
60 | ) | ||
58 | 61 | ||
59 | include_directories( | 62 | include_directories( |
60 | ${WLC_INCLUDE_DIRS} | 63 | ${WLC_INCLUDE_DIRS} |
61 | ${PCRE_INCLUDE_DIRS} | 64 | ${PCRE_INCLUDE_DIRS} |
62 | ${JSONC_INCLUDE_DIRS} | 65 | ${JSONC_INCLUDE_DIRS} |
63 | ${XKBCOMMON_INCLUDE_DIRS} | 66 | ${XKBCOMMON_INCLUDE_DIRS} |
64 | ${CMAKE_CURRENT_BINARY_DIR} | 67 | ${CMAKE_CURRENT_BINARY_DIR} |
65 | ) | 68 | ) |
66 | 69 | ||
67 | add_executable(sway | 70 | add_executable(sway |
@@ -71,25 +74,28 @@ add_executable(sway | |||
71 | ) | 74 | ) |
72 | 75 | ||
73 | target_link_libraries(sway | 76 | target_link_libraries(sway |
74 | ${WLC_LIBRARIES} | 77 | ${WLC_LIBRARIES} |
75 | ${XKBCOMMON_LIBRARIES} | 78 | ${XKBCOMMON_LIBRARIES} |
76 | ${PCRE_LIBRARIES} | 79 | ${PCRE_LIBRARIES} |
77 | ${JSONC_LIBRARIES} | 80 | ${JSONC_LIBRARIES} |
78 | ${WAYLAND_SERVER_LIBRARIES} | 81 | ${WAYLAND_SERVER_LIBRARIES} |
79 | ) | 82 | ) |
80 | 83 | ||
81 | install( | 84 | install( |
82 | TARGETS sway | 85 | TARGETS sway |
83 | RUNTIME DESTINATION bin | 86 | RUNTIME |
84 | COMPONENT runtime) | 87 | DESTINATION bin |
88 | COMPONENT runtime | ||
89 | ) | ||
85 | install( | 90 | install( |
86 | FILES "${CMAKE_CURRENT_SOURCE_DIR}/config" | 91 | FILES "${CMAKE_CURRENT_SOURCE_DIR}/config" |
87 | DESTINATION "${FALLBACK_CONFIG_DIR}" | 92 | DESTINATION "${FALLBACK_CONFIG_DIR}" |
88 | COMPONENT configuration) | 93 | COMPONENT configuration |
94 | ) | ||
89 | 95 | ||
90 | add_custom_target(man ALL) | 96 | add_custom_target(man ALL) |
91 | 97 | ||
92 | function (add_manpage name section) | 98 | function(add_manpage name section) |
93 | add_custom_command( | 99 | add_custom_command( |
94 | OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${name}.${section}" | 100 | OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${name}.${section}" |
95 | COMMAND "${A2X_COMMAND}" | 101 | COMMAND "${A2X_COMMAND}" |
@@ -99,19 +105,23 @@ function (add_manpage name section) | |||
99 | -D "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" | 105 | -D "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" |
100 | "${CMAKE_CURRENT_SOURCE_DIR}/${name}.${section}.txt" | 106 | "${CMAKE_CURRENT_SOURCE_DIR}/${name}.${section}.txt" |
101 | DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${name}.${section}.txt" | 107 | DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${name}.${section}.txt" |
102 | COMMENT "Generating manpage for ${name}.${section}") | 108 | COMMENT "Generating manpage for ${name}.${section}" |
109 | ) | ||
103 | 110 | ||
104 | add_custom_target("man-${name}.${section}" | 111 | add_custom_target("man-${name}.${section}" |
105 | DEPENDS | 112 | DEPENDS |
106 | "${CMAKE_CURRENT_BINARY_DIR}/${name}.${section}") | 113 | "${CMAKE_CURRENT_BINARY_DIR}/${name}.${section}" |
114 | ) | ||
107 | add_dependencies(man | 115 | add_dependencies(man |
108 | "man-${name}.${section}") | 116 | "man-${name}.${section}" |
117 | ) | ||
109 | 118 | ||
110 | install( | 119 | install( |
111 | FILES "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}.${section}" | 120 | FILES "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}.${section}" |
112 | DESTINATION "share/man/man${section}" | 121 | DESTINATION "share/man/man${section}" |
113 | COMPONENT documentation) | 122 | COMPONENT documentation |
114 | endfunction () | 123 | ) |
124 | endfunction() | ||
115 | 125 | ||
116 | add_manpage(sway 1) | 126 | add_manpage(sway 1) |
117 | add_manpage(sway 5) | 127 | add_manpage(sway 5) |
@@ -121,8 +131,10 @@ add_manpage(swaygrab 1) | |||
121 | install( | 131 | install( |
122 | FILES "${CMAKE_CURRENT_SOURCE_DIR}/sway.desktop" | 132 | FILES "${CMAKE_CURRENT_SOURCE_DIR}/sway.desktop" |
123 | DESTINATION share/wayland-sessions | 133 | DESTINATION share/wayland-sessions |
124 | COMPONENT data) | 134 | COMPONENT data |
135 | ) | ||
125 | install( | 136 | install( |
126 | FILES "${CMAKE_CURRENT_SOURCE_DIR}/sway-xorg.desktop" | 137 | FILES "${CMAKE_CURRENT_SOURCE_DIR}/sway-xorg.desktop" |
127 | DESTINATION share/xsessions | 138 | DESTINATION share/xsessions |
128 | COMPONENT data) | 139 | COMPONENT data |
140 | ) | ||
diff --git a/swaybar/CMakeLists.txt b/swaybar/CMakeLists.txt index 80b8876d..b4ce9e7b 100644 --- a/swaybar/CMakeLists.txt +++ b/swaybar/CMakeLists.txt | |||
@@ -6,8 +6,14 @@ find_package(Pango REQUIRED) | |||
6 | 6 | ||
7 | include(Wayland) | 7 | include(Wayland) |
8 | set(CMAKE_CURRENT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../bin/) | 8 | set(CMAKE_CURRENT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../bin/) |
9 | WAYLAND_ADD_PROTOCOL_CLIENT(proto-xdg-shell "${PROJECT_SOURCE_DIR}/../protocols/xdg-shell.xml" xdg-shell) | 9 | WAYLAND_ADD_PROTOCOL_CLIENT(proto-xdg-shell |
10 | WAYLAND_ADD_PROTOCOL_CLIENT(proto-desktop-shell "${PROJECT_SOURCE_DIR}/../protocols/desktop-shell.xml" desktop-shell) | 10 | "${PROJECT_SOURCE_DIR}/../protocols/xdg-shell.xml" |
11 | xdg-shell | ||
12 | ) | ||
13 | WAYLAND_ADD_PROTOCOL_CLIENT(proto-desktop-shell | ||
14 | "${PROJECT_SOURCE_DIR}/../protocols/desktop-shell.xml" | ||
15 | desktop-shell | ||
16 | ) | ||
11 | 17 | ||
12 | include_directories( | 18 | include_directories( |
13 | ${WAYLAND_CLIENT_INCLUDE_DIR} | 19 | ${WAYLAND_CLIENT_INCLUDE_DIR} |
@@ -28,9 +34,17 @@ add_executable(swaybar | |||
28 | ${proto-desktop-shell} | 34 | ${proto-desktop-shell} |
29 | ) | 35 | ) |
30 | 36 | ||
31 | target_link_libraries(swaybar ${WAYLAND_CLIENT_LIBRARIES} ${WAYLAND_CURSOR_LIBRARIES} ${CAIRO_LIBRARIES} ${PANGO_LIBRARIES} m) | 37 | target_link_libraries(swaybar |
38 | ${WAYLAND_CLIENT_LIBRARIES} | ||
39 | ${WAYLAND_CURSOR_LIBRARIES} | ||
40 | ${CAIRO_LIBRARIES} | ||
41 | ${PANGO_LIBRARIES} | ||
42 | m | ||
43 | ) | ||
32 | 44 | ||
33 | install( | 45 | install( |
34 | TARGETS swaybar | 46 | TARGETS swaybar |
35 | RUNTIME DESTINATION bin | 47 | RUNTIME |
36 | COMPONENT runtime) | 48 | DESTINATION bin |
49 | COMPONENT runtime | ||
50 | ) | ||
diff --git a/swaybg/CMakeLists.txt b/swaybg/CMakeLists.txt index 6a6c3efa..ae376419 100644 --- a/swaybg/CMakeLists.txt +++ b/swaybg/CMakeLists.txt | |||
@@ -6,8 +6,14 @@ find_package(Pango REQUIRED) | |||
6 | 6 | ||
7 | include(Wayland) | 7 | include(Wayland) |
8 | set(CMAKE_CURRENT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../bin/) | 8 | set(CMAKE_CURRENT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../bin/) |
9 | WAYLAND_ADD_PROTOCOL_CLIENT(proto-xdg-shell "${PROJECT_SOURCE_DIR}/../protocols/xdg-shell.xml" xdg-shell) | 9 | WAYLAND_ADD_PROTOCOL_CLIENT(proto-xdg-shell |
10 | WAYLAND_ADD_PROTOCOL_CLIENT(proto-desktop-shell "${PROJECT_SOURCE_DIR}/../protocols/desktop-shell.xml" desktop-shell) | 10 | "${PROJECT_SOURCE_DIR}/../protocols/xdg-shell.xml" |
11 | xdg-shell | ||
12 | ) | ||
13 | WAYLAND_ADD_PROTOCOL_CLIENT(proto-desktop-shell | ||
14 | "${PROJECT_SOURCE_DIR}/../protocols/desktop-shell.xml" | ||
15 | desktop-shell | ||
16 | ) | ||
11 | 17 | ||
12 | include_directories( | 18 | include_directories( |
13 | ${WAYLAND_CLIENT_INCLUDE_DIR} | 19 | ${WAYLAND_CLIENT_INCLUDE_DIR} |
@@ -28,9 +34,17 @@ add_executable(swaybg | |||
28 | ${proto-desktop-shell} | 34 | ${proto-desktop-shell} |
29 | ) | 35 | ) |
30 | 36 | ||
31 | target_link_libraries(swaybg ${WAYLAND_CLIENT_LIBRARIES} ${WAYLAND_CURSOR_LIBRARIES} ${CAIRO_LIBRARIES} ${PANGO_LIBRARIES} m) | 37 | target_link_libraries(swaybg |
38 | ${WAYLAND_CLIENT_LIBRARIES} | ||
39 | ${WAYLAND_CURSOR_LIBRARIES} | ||
40 | ${CAIRO_LIBRARIES} | ||
41 | ${PANGO_LIBRARIES} | ||
42 | m | ||
43 | ) | ||
32 | 44 | ||
33 | install( | 45 | install( |
34 | TARGETS swaybg | 46 | TARGETS swaybg |
35 | RUNTIME DESTINATION bin | 47 | RUNTIME |
36 | COMPONENT runtime) | 48 | DESTINATION bin |
49 | COMPONENT runtime | ||
50 | ) | ||
diff --git a/swaygrab/CMakeLists.txt b/swaygrab/CMakeLists.txt index 3901d91c..4f480d55 100644 --- a/swaygrab/CMakeLists.txt +++ b/swaygrab/CMakeLists.txt | |||
@@ -10,9 +10,13 @@ add_executable(swaygrab | |||
10 | ${common} | 10 | ${common} |
11 | ) | 11 | ) |
12 | 12 | ||
13 | target_link_libraries(swaygrab rt) | 13 | target_link_libraries(swaygrab |
14 | rt | ||
15 | ) | ||
14 | 16 | ||
15 | install( | 17 | install( |
16 | TARGETS swaygrab | 18 | TARGETS swaygrab |
17 | RUNTIME DESTINATION bin | 19 | RUNTIME |
18 | COMPONENT runtime) | 20 | DESTINATION bin |
21 | COMPONENT runtime | ||
22 | ) | ||
diff --git a/swaymsg/CMakeLists.txt b/swaymsg/CMakeLists.txt index 2dcdfede..9cb93e52 100644 --- a/swaymsg/CMakeLists.txt +++ b/swaymsg/CMakeLists.txt | |||
@@ -11,6 +11,8 @@ add_executable(swaymsg | |||
11 | ) | 11 | ) |
12 | 12 | ||
13 | install( | 13 | install( |
14 | TARGETS swaymsg | 14 | TARGETS swaymsg |
15 | RUNTIME DESTINATION bin | 15 | RUNTIME |
16 | COMPONENT runtime) | 16 | DESTINATION bin |
17 | COMPONENT runtime | ||
18 | ) | ||