From 7f4575b9d266115d4b2242658dc80bdbd11173dc Mon Sep 17 00:00:00 2001 From: Louise Poubel Date: Sat, 13 Feb 2021 16:38:49 -0800 Subject: [PATCH 1/3] GTS fix for Windows Signed-off-by: Louise Poubel --- cmake/FindGTS.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmake/FindGTS.cmake b/cmake/FindGTS.cmake index ad00a971..24fd2a41 100644 --- a/cmake/FindGTS.cmake +++ b/cmake/FindGTS.cmake @@ -65,7 +65,14 @@ else() endif() # 2.1 Need glib library + find_path(GLIB_INCLUDE_DIR + NAMES glib.h + PATH_SUFFIXES glib-2.0) + find_path(GLIBCONFIG_INCLUDE_DIR + NAMES glibconfig.h + PATH_SUFFIXES lib/glib-2.0/include) find_library(GLIB_LIBRARY glib-2.0) + list(APPEND GTS_INCLUDE_DIRS "${GLIB_INCLUDE_DIR}" "${GLIBCONFIG_INCLUDE_DIR}") list(APPEND GTS_LIBRARIES "${GLIB_LIBRARY}") if (GTS_FOUND) From 4c9a899cf96e291bda560eb385d2f47a1d2c8e73 Mon Sep 17 00:00:00 2001 From: Louise Poubel Date: Thu, 11 Mar 2021 11:18:16 -0800 Subject: [PATCH 2/3] Check if paths are valid before appending Signed-off-by: Louise Poubel --- cmake/FindGTS.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake/FindGTS.cmake b/cmake/FindGTS.cmake index 24fd2a41..3eaaf85b 100644 --- a/cmake/FindGTS.cmake +++ b/cmake/FindGTS.cmake @@ -72,7 +72,12 @@ else() NAMES glibconfig.h PATH_SUFFIXES lib/glib-2.0/include) find_library(GLIB_LIBRARY glib-2.0) - list(APPEND GTS_INCLUDE_DIRS "${GLIB_INCLUDE_DIR}" "${GLIBCONFIG_INCLUDE_DIR}") + if (GLIB_INCLUDE_DIR) + list(APPEND GTS_INCLUDE_DIRS "${GLIB_INCLUDE_DIR}") + endif() + if (GLIBCONFIG_INCLUDE_DIR) + list(APPEND GTS_INCLUDE_DIRS "${GLIBCONFIG_INCLUDE_DIR}") + endif() list(APPEND GTS_LIBRARIES "${GLIB_LIBRARY}") if (GTS_FOUND) From 2d90059ec2a51c3e8e98653a8d80d11098f08a3a Mon Sep 17 00:00:00 2001 From: Louise Poubel Date: Thu, 11 Mar 2021 21:32:13 -0800 Subject: [PATCH 3/3] Reorder and print message Signed-off-by: Louise Poubel --- cmake/FindGTS.cmake | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/cmake/FindGTS.cmake b/cmake/FindGTS.cmake index 3eaaf85b..ea319203 100644 --- a/cmake/FindGTS.cmake +++ b/cmake/FindGTS.cmake @@ -65,16 +65,25 @@ else() endif() # 2.1 Need glib library + find_library(GLIB_LIBRARY glib-2.0) + if (NOT GLIB_LIBRARY) + if(NOT GTS_FIND_QUIETLY) + message(STATUS "Looking for glib library - not found") + endif() + else() + if(NOT GTS_FIND_QUIETLY) + message(STATUS "Looking for glib library - found") + endif() + endif() find_path(GLIB_INCLUDE_DIR NAMES glib.h PATH_SUFFIXES glib-2.0) - find_path(GLIBCONFIG_INCLUDE_DIR - NAMES glibconfig.h - PATH_SUFFIXES lib/glib-2.0/include) - find_library(GLIB_LIBRARY glib-2.0) if (GLIB_INCLUDE_DIR) list(APPEND GTS_INCLUDE_DIRS "${GLIB_INCLUDE_DIR}") endif() + find_path(GLIBCONFIG_INCLUDE_DIR + NAMES glibconfig.h + PATH_SUFFIXES lib/glib-2.0/include) if (GLIBCONFIG_INCLUDE_DIR) list(APPEND GTS_INCLUDE_DIRS "${GLIBCONFIG_INCLUDE_DIR}") endif()