diff --git a/external/glib/CMakeLists.txt b/external/glib/CMakeLists.txt index 2966200a..d0f3c400 100644 --- a/external/glib/CMakeLists.txt +++ b/external/glib/CMakeLists.txt @@ -13,9 +13,11 @@ function(add_cppgir) # isolate scope set(BUILD_EXAMPLES OFF) add_subdirectory(cppgir EXCLUDE_FROM_ALL) endfunction() -add_cppgir() include(generate_cppgir.cmake) +if (NOT CppGir_FOUND) + add_cppgir() +endif() generate_cppgir(external_glib Gio-2.0) find_package(PkgConfig REQUIRED) diff --git a/external/glib/generate_cppgir.cmake b/external/glib/generate_cppgir.cmake index a3cdfe70..f14447d3 100644 --- a/external/glib/generate_cppgir.cmake +++ b/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) + 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)