summaryrefslogtreecommitdiffstats
path: root/cmake/modules/FindGTHREAD2.cmake
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:34:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:34:10 +0000
commite4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc (patch)
tree68cb5ef9081156392f1dd62a00c6ccc1451b93df /cmake/modules/FindGTHREAD2.cmake
parentInitial commit. (diff)
downloadwireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.tar.xz
wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.zip
Adding upstream version 4.2.2.upstream/4.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cmake/modules/FindGTHREAD2.cmake')
-rw-r--r--cmake/modules/FindGTHREAD2.cmake48
1 files changed, 48 insertions, 0 deletions
diff --git a/cmake/modules/FindGTHREAD2.cmake b/cmake/modules/FindGTHREAD2.cmake
new file mode 100644
index 0000000..172ee55
--- /dev/null
+++ b/cmake/modules/FindGTHREAD2.cmake
@@ -0,0 +1,48 @@
+#
+# - Try to find GThread2
+# Find GThread headers, libraries and the answer to all questions.
+#
+# GTHREAD2_FOUND True if GTHREAD2 was found
+# GTHREAD2_INCLUDE_DIRS Location of GTHREAD2 headers
+# GTHREAD2_LIBRARIES List of libraries to use GTHREAD2
+#
+
+include(FindWSWinLibs)
+FindWSWinLibs("vcpkg-export-*" "GTHREAD2_HINTS")
+
+if(NOT USE_REPOSITORY)
+ find_package(PkgConfig QUIET)
+ pkg_check_modules(PC_GTHREAD2 gthread-2.0)
+endif()
+
+find_path(GTHREAD2_INCLUDE_DIR
+ NAMES
+ glib/gthread.h
+ PATH_SUFFIXES
+ glib-2.0
+ HINTS
+ ${PC_GTHREAD2_INCLUDE_DIRS}
+ "${GTHREAD2_HINTS}/include"
+)
+include(FindWSLibrary)
+FindWSLibrary(GTHREAD2_LIBRARY
+ NAMES
+ gthread-2.0 gthread
+ HINTS
+ ${PC_GTHREAD2_LIBRARY_DIRS}
+ WIN32_HINTS
+ ${GTHREAD2_HINTS}
+)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(GTHREAD2 DEFAULT_MSG GTHREAD2_LIBRARY GTHREAD2_INCLUDE_DIR)
+
+if(GTHREAD2_FOUND)
+ set(GTHREAD2_INCLUDE_DIRS ${GTHREAD2_INCLUDE_DIR})
+ set(GTHREAD2_LIBRARIES ${GTHREAD2_LIBRARY})
+else()
+ set(GTHREAD2_INCLUDE_DIRS)
+ set(GTHREAD2_LIBRARIES)
+endif()
+
+mark_as_advanced(GTHREAD2_LIBRARIES GTHREAD2_INCLUDE_DIRS)