From 468ddfb34dd16408ae068f0fb922c75c13df2ef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20=C4=8Cech?= Date: Thu, 28 Apr 2016 20:08:41 +0200 Subject: [PATCH 1/3] Fix missing include paths When headers were installed in more sofisticated places (but package config knows it right), it revealed missing paths in CMake configuration. Lets fix it. --- common/CMakeLists.txt | 1 + protocols/CMakeLists.txt | 1 + sway/CMakeLists.txt | 1 + swaybar/CMakeLists.txt | 3 ++- swaybg/CMakeLists.txt | 3 ++- swaygrab/CMakeLists.txt | 1 + swaylock/CMakeLists.txt | 3 ++- wayland/CMakeLists.txt | 1 + 8 files changed, 11 insertions(+), 3 deletions(-) diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index e5b8f2b915..901a47f980 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -1,5 +1,6 @@ include_directories( ${WLC_INCLUDE_DIRS} + ${XKBCOMMON_INCLUDE_DIRS} ) add_library(sway-common diff --git a/protocols/CMakeLists.txt b/protocols/CMakeLists.txt index d7516d0cd5..0ff7c704f3 100644 --- a/protocols/CMakeLists.txt +++ b/protocols/CMakeLists.txt @@ -31,3 +31,4 @@ add_library(sway-protocols ) set(PROTOCOLS_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/protocols PARENT_SCOPE) +INCLUDE_DIRECTORIES(${WAYLAND_INCLUDE_DIR} ${XKBCOMMON_INCLUDE_DIRS}) diff --git a/sway/CMakeLists.txt b/sway/CMakeLists.txt index 51f27a0573..73df3b1bc3 100644 --- a/sway/CMakeLists.txt +++ b/sway/CMakeLists.txt @@ -7,6 +7,7 @@ include_directories( ${LIBINPUT_INCLUDE_DIRS} ${CAIRO_INCLUDE_DIRS} ${PANGO_INCLUDE_DIRS} + ${WAYLAND_INCLUDE_DIR} ) add_executable(sway diff --git a/swaybar/CMakeLists.txt b/swaybar/CMakeLists.txt index 5b865083b1..f59a48fd1c 100644 --- a/swaybar/CMakeLists.txt +++ b/swaybar/CMakeLists.txt @@ -1,9 +1,10 @@ include_directories( ${PROTOCOLS_INCLUDE_DIRS} - ${WAYLAND_CLIENT_INCLUDE_DIR} + ${WAYLAND_INCLUDE_DIR} ${CAIRO_INCLUDE_DIRS} ${PANGO_INCLUDE_DIRS} ${JSONC_INCLUDE_DIRS} + ${XKBCOMMON_INCLUDE_DIRS} ) add_executable(swaybar diff --git a/swaybg/CMakeLists.txt b/swaybg/CMakeLists.txt index c5efae91e4..f8cad4049e 100644 --- a/swaybg/CMakeLists.txt +++ b/swaybg/CMakeLists.txt @@ -1,8 +1,9 @@ include_directories( ${PROTOCOLS_INCLUDE_DIRS} - ${WAYLAND_CLIENT_INCLUDE_DIR} + ${WAYLAND_INCLUDE_DIR} ${CAIRO_INCLUDE_DIRS} ${PANGO_INCLUDE_DIRS} + ${XKBCOMMON_INCLUDE_DIRS} ) add_executable(swaybg diff --git a/swaygrab/CMakeLists.txt b/swaygrab/CMakeLists.txt index 888a9aee54..b4aee35733 100644 --- a/swaygrab/CMakeLists.txt +++ b/swaygrab/CMakeLists.txt @@ -1,6 +1,7 @@ include_directories( ${JSONC_INCLUDE_DIRS} ${WLC_INCLUDE_DIRS} + ${XKBCOMMON_INCLUDE_DIRS} ) add_executable(swaygrab diff --git a/swaylock/CMakeLists.txt b/swaylock/CMakeLists.txt index b290cd2fb6..febbd1af04 100644 --- a/swaylock/CMakeLists.txt +++ b/swaylock/CMakeLists.txt @@ -1,10 +1,11 @@ include_directories( ${PROTOCOLS_INCLUDE_DIRS} - ${WAYLAND_CLIENT_INCLUDE_DIR} + ${WAYLAND_INCLUDE_DIR} ${CAIRO_INCLUDE_DIRS} ${PANGO_INCLUDE_DIRS} ${PAM_INCLUDE_DIRS} ${JSONC_INCLUDE_DIRS} + ${XKBCOMMON_INCLUDE_DIRS} ) add_executable(swaylock diff --git a/wayland/CMakeLists.txt b/wayland/CMakeLists.txt index 282ea1aa2b..df92db9ec3 100644 --- a/wayland/CMakeLists.txt +++ b/wayland/CMakeLists.txt @@ -2,6 +2,7 @@ include_directories( ${PROTOCOLS_INCLUDE_DIRS} ${PANGO_INCLUDE_DIRS} ${XKBCOMMON_INCLUDE_DIRS} + ${WAYLAND_INCLUDE_DIR} ) add_library(sway-wayland From bcdeb721893264d4c9c3471c3955ae20ce1b6e89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20=C4=8Cech?= Date: Thu, 28 Apr 2016 20:13:26 +0200 Subject: [PATCH 2/3] Explicitly mark static linking in CMake When no type is given, it depends on BUILD_SHARED_LIBS value which is not desired in this case. --- common/CMakeLists.txt | 2 +- protocols/CMakeLists.txt | 2 +- wayland/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 901a47f980..9c2c0a9981 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -3,7 +3,7 @@ include_directories( ${XKBCOMMON_INCLUDE_DIRS} ) -add_library(sway-common +add_library(sway-common STATIC ipc-client.c list.c log.c diff --git a/protocols/CMakeLists.txt b/protocols/CMakeLists.txt index 0ff7c704f3..ff0a2e4d05 100644 --- a/protocols/CMakeLists.txt +++ b/protocols/CMakeLists.txt @@ -22,7 +22,7 @@ WAYLAND_ADD_PROTOCOL_SERVER(proto-server-swaylock swaylock ) -add_library(sway-protocols +add_library(sway-protocols STATIC ${proto-client-xdg-shell} ${proto-client-desktop-shell} ${proto-server-desktop-shell} diff --git a/wayland/CMakeLists.txt b/wayland/CMakeLists.txt index df92db9ec3..54fe3e23cb 100644 --- a/wayland/CMakeLists.txt +++ b/wayland/CMakeLists.txt @@ -5,7 +5,7 @@ include_directories( ${WAYLAND_INCLUDE_DIR} ) -add_library(sway-wayland +add_library(sway-wayland STATIC buffers.c pango.c registry.c From 1124e78dda3e5c77fdd5ec5b8f6a45ce644aaa06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20=C4=8Cech?= Date: Thu, 28 Apr 2016 20:19:40 +0200 Subject: [PATCH 3/3] Respect supplied CMAKE_C_FLAGS --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bf4fe49b25..cf115b3d11 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.1.0) project(sway C) -set(CMAKE_C_FLAGS "-g") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g") set(CMAKE_C_STANDARD 99) set(CMAKE_C_EXTENSIONS OFF) set(CMAKE_POSITION_INDEPENDENT_CODE ON)