From a00057a45e5df8994fa89aba7fc22a8f32e1dd7f Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Sun, 28 Feb 2021 11:25:42 +0400 Subject: [PATCH] Add external_glibmm module --- external/CMakeLists.txt | 1 + external/glibmm/CMakeLists.txt | 40 ++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 external/glibmm/CMakeLists.txt diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index e1a3f1b..f004227 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -26,6 +26,7 @@ endif() add_checked_subdirectory(ffmpeg) if (LINUX) add_checked_subdirectory(glib) + add_checked_subdirectory(glibmm) endif() add_checked_subdirectory(gsl) if (LINUX AND NOT DESKTOP_APP_DISABLE_DBUS_INTEGRATION) diff --git a/external/glibmm/CMakeLists.txt b/external/glibmm/CMakeLists.txt new file mode 100644 index 0000000..8c53c5e --- /dev/null +++ b/external/glibmm/CMakeLists.txt @@ -0,0 +1,40 @@ +# This file is part of Desktop App Toolkit, +# a set of libraries for developing nice desktop applications. +# +# For license and copyright information please follow this link: +# https://github.com/desktop-app/legal/blob/master/LEGAL + +add_library(external_glibmm INTERFACE IMPORTED GLOBAL) +add_library(desktop-app::external_glibmm ALIAS external_glibmm) + +find_package(PkgConfig REQUIRED) +pkg_check_modules(GLIBMM REQUIRED IMPORTED_TARGET glibmm-2.4) +pkg_check_modules(GIOMM REQUIRED IMPORTED_TARGET giomm-2.4) + +if (DESKTOP_APP_USE_PACKAGED) + target_link_libraries(external_glibmm + INTERFACE + PkgConfig::GIOMM + PkgConfig::GLIBMM + ) +else() + target_include_directories(external_glibmm + INTERFACE + ${GIOMM_INCLUDE_DIRS} + ${GLIBMM_INCLUDE_DIRS} + ) + + target_link_static_libraries(external_glibmm + INTERFACE + giomm-2.4 + glibmm-2.4 + sigc-2.0 + ) + + target_link_libraries(external_glibmm + INTERFACE + gio-2.0 + gobject-2.0 + glib-2.0 + ) +endif()