From 52c4e15c762843b2772384bb2ef4639dbb54ee4c Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Thu, 28 Mar 2019 12:42:41 +1100 Subject: [PATCH] [client] project restructure part 2/2 --- VERSION | 2 +- client/CMakeLists.txt | 12 +++++------- client/clipboard/CMakeLists.txt | 25 +++++++++++++++++++++++++ client/clipboard/{ => src}/x11.c | 0 client/decoders/CMakeLists.txt | 24 ++++++++++++++++++++++++ client/decoders/{ => src}/h264.c | 0 client/decoders/{ => src}/null.c | 0 client/decoders/{ => src}/yuv420.c | 0 client/fonts/CMakeLists.txt | 25 +++++++++++++++++++++++++ client/fonts/{ => src}/sdl.c | 0 client/renderers/opengl/CMakeLists.txt | 1 + 11 files changed, 81 insertions(+), 8 deletions(-) create mode 100644 client/clipboard/CMakeLists.txt rename client/clipboard/{ => src}/x11.c (100%) create mode 100644 client/decoders/CMakeLists.txt rename client/decoders/{ => src}/h264.c (100%) rename client/decoders/{ => src}/null.c (100%) rename client/decoders/{ => src}/yuv420.c (100%) create mode 100644 client/fonts/CMakeLists.txt rename client/fonts/{ => src}/sdl.c (100%) diff --git a/VERSION b/VERSION index 8f07b576..44dfbb38 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -a12-112-g3d136a28a0+1 \ No newline at end of file +a12-113-gfdba14691c+1 \ No newline at end of file diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index 1ad50dbe..39ffd37a 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -29,10 +29,7 @@ set(CMAKE_C_STANDARD 11) find_package(PkgConfig) pkg_check_modules(PKGCONFIG REQUIRED sdl2 - SDL2_ttf - fontconfig x11 - xfixes libconfig ) @@ -68,18 +65,19 @@ set(SOURCES src/lg-fonts.c src/ll.c src/utils.c - clipboard/x11.c - decoders/null.c - decoders/yuv420.c - fonts/sdl.c ) add_subdirectory(spice) add_subdirectory(renderers) +add_subdirectory(clipboard) +add_subdirectory(fonts) +add_subdirectory(decoders) add_executable(looking-glass-client ${SOURCES}) target_compile_options(looking-glass-client PUBLIC ${PKGCONFIG_CFLAGS_OTHER}) target_link_libraries(looking-glass-client spice renderers + clipboard + fonts ) diff --git a/client/clipboard/CMakeLists.txt b/client/clipboard/CMakeLists.txt new file mode 100644 index 00000000..b784fb05 --- /dev/null +++ b/client/clipboard/CMakeLists.txt @@ -0,0 +1,25 @@ +cmake_minimum_required(VERSION 3.6) +project(clipboard LANGUAGES C) + +find_package(PkgConfig) +pkg_check_modules(CLIPBOARD_PKGCONFIG REQUIRED + x11 + xfixes +) + +add_library(clipboard STATIC + src/x11.c +) + +target_link_libraries(clipboard + ${CLIPBOARD_PKGCONFIG_LIBRARIES} +) + +target_include_directories(clipboard + PUBLIC + $ + $ + PRIVATE + src + ${CLIPBOARD_PKGCONFIG_INCLUDE_DIRS} +) diff --git a/client/clipboard/x11.c b/client/clipboard/src/x11.c similarity index 100% rename from client/clipboard/x11.c rename to client/clipboard/src/x11.c diff --git a/client/decoders/CMakeLists.txt b/client/decoders/CMakeLists.txt new file mode 100644 index 00000000..8b860541 --- /dev/null +++ b/client/decoders/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.6) +project(decoders LANGUAGES C) + +#find_package(PkgConfig) +#pkg_check_modules(DECODERS_PKGCONFIG REQUIRED +#) + +add_library(decoders STATIC + src/null.c + src/yuv420.c +) + +target_link_libraries(decoders + ${DECODERS_PKGCONFIG_LIBRARIES} +) + +target_include_directories(decoders + PUBLIC + $ + $ + PRIVATE + src + ${DECODERS_PKGCONFIG_INCLUDE_DIRS} +) diff --git a/client/decoders/h264.c b/client/decoders/src/h264.c similarity index 100% rename from client/decoders/h264.c rename to client/decoders/src/h264.c diff --git a/client/decoders/null.c b/client/decoders/src/null.c similarity index 100% rename from client/decoders/null.c rename to client/decoders/src/null.c diff --git a/client/decoders/yuv420.c b/client/decoders/src/yuv420.c similarity index 100% rename from client/decoders/yuv420.c rename to client/decoders/src/yuv420.c diff --git a/client/fonts/CMakeLists.txt b/client/fonts/CMakeLists.txt new file mode 100644 index 00000000..9231a6a0 --- /dev/null +++ b/client/fonts/CMakeLists.txt @@ -0,0 +1,25 @@ +cmake_minimum_required(VERSION 3.6) +project(fonts LANGUAGES C) + +find_package(PkgConfig) +pkg_check_modules(FONTS_PKGCONFIG REQUIRED + SDL2_ttf + fontconfig +) + +add_library(fonts STATIC + src/sdl.c +) + +target_link_libraries(fonts + ${FONTS_PKGCONFIG_LIBRARIES} +) + +target_include_directories(fonts + PUBLIC + $ + $ + PRIVATE + src + ${FONTS_PKGCONFIG_INCLUDE_DIRS} +) diff --git a/client/fonts/sdl.c b/client/fonts/src/sdl.c similarity index 100% rename from client/fonts/sdl.c rename to client/fonts/src/sdl.c diff --git a/client/renderers/opengl/CMakeLists.txt b/client/renderers/opengl/CMakeLists.txt index aba571d4..5398164c 100644 --- a/client/renderers/opengl/CMakeLists.txt +++ b/client/renderers/opengl/CMakeLists.txt @@ -13,6 +13,7 @@ add_library(renderer_opengl STATIC target_link_libraries(renderer_opengl ${RENDERER_OPENGL_PKGCONFIG_LIBRARIES} + decoders ) target_include_directories(renderer_opengl