Use system cppgir

--- tdesktop-4.8.3-full.orig/cmake/external/glib/CMakeLists.txt
+++ tdesktop-4.8.3-full/cmake/external/glib/CMakeLists.txt
@@ -7,14 +7,6 @@
 add_library(external_glib INTERFACE IMPORTED GLOBAL)
 add_library(desktop-app::external_glib ALIAS external_glib)
 
-function(add_cppgir) # isolate scope
-    set(BUILD_TESTING OFF)
-    set(BUILD_DOC OFF)
-    set(CMAKE_DISABLE_FIND_PACKAGE_Qt5Core ON)
-    add_subdirectory(cppgir)
-endfunction()
-add_cppgir()
-
 include(generate_cppgir.cmake)
 generate_cppgir(external_glib Gio-2.0)
 
--- tdesktop-4.8.3-full.orig/cmake/external/glib/generate_cppgir.cmake
+++ tdesktop-4.8.3-full/cmake/external/glib/generate_cppgir.cmake
@@ -4,6 +4,8 @@
 # For license and copyright information please follow this link:
 # https://github.com/desktop-app/legal/blob/master/LEGAL
 
+find_package(CppGir REQUIRED)
+
 function(generate_cppgir target_name gir)
     # cppgir generates all the dependent headers everytime, better to have a global folder
     set(gen_dst ${CMAKE_BINARY_DIR}/gen)
@@ -32,17 +34,16 @@
         echo 1> ${gen_timestamp}
     COMMENT "Generating C++ wrapper for ${gir} (${target_name})"
     DEPENDS
-        cppgir
         ${gir_path}
     )
     generate_target(${target_name} cppgir ${gen_timestamp} "" ${gen_dst})
 
     get_target_property(target_type ${target_name} TYPE)
     if (${target_type} STREQUAL "INTERFACE_LIBRARY")
-        target_link_libraries(${target_name} INTERFACE gi)
+        target_link_libraries(${target_name} INTERFACE CppGir::gi)
         target_compile_definitions(${target_name} INTERFACE GI_INLINE GI_OBJECT_NEWV)
     else()
-        target_link_libraries(${target_name} PUBLIC gi)
+        target_link_libraries(${target_name} PUBLIC CppGir::gi)
         target_compile_definitions(${target_name} PUBLIC GI_INLINE GI_OBJECT_NEWV)
     endif()
 endfunction()
