build: fix includes, add glib and gio to CMakeLists.txt

First I added glib to cmake this fixed the glib.h not found error.
Then I got build errors from the missing GIO include as seen in the linked issue.
After adding the #include <gio/gio.h> the linker failed to find the gio library.
After adding the gio check to cmake all build issues were solved.

GitLab: #504
Change-Id: Iac537e10261f2e9dfa61029c4591e000851a378c
This commit is contained in:
FuchtelJockel
2021-08-24 12:15:54 +02:00
committed by Sébastien Blin
parent dff474700c
commit 8871db4986
2 changed files with 16 additions and 2 deletions

View File

@@ -242,6 +242,16 @@ else()
find_package(PkgConfig REQUIRED)
pkg_check_modules(GLIB REQUIRED glib-2.0)
if(GLIB_FOUND)
add_definitions(${GLIB_CFLAGS_OTHER})
endif()
pkg_check_modules(GIO REQUIRED gio-2.0)
if(GIO_FOUND)
add_definitions(${GIO_CFLAGS})
endif()
pkg_check_modules(LIBNM libnm)
if(LIBNM_FOUND)
add_definitions(-DUSE_LIBNM)
@@ -294,7 +304,8 @@ else()
include_directories(${LRC_SRC_PATH}
${LIBNM_INCLUDE_DIRS}
${LIBNOTIFY_INCLUDE_DIRS}
${LIBGDKPIXBUF_INCLUDE_DIRS})
${LIBGDKPIXBUF_INCLUDE_DIRS}
${GLIB_INCLUDE_DIRS})
set(JAMI_DATA_PREFIX "${CMAKE_INSTALL_PREFIX}/share")
@@ -419,7 +430,9 @@ else()
${X11}
${LIBNM_LIBRARIES}
${LIBNOTIFY_LIBRARIES}
${LIBGDKPIXBUF_LIBRARIES})
${LIBGDKPIXBUF_LIBRARIES}
${GLIB_LIBRARIES}
${GIO_LIBRARIES})
# Installation rules
install(TARGETS jami-qt