From 65cc31ab16236c545b54f1b42d017485194099d0 Mon Sep 17 00:00:00 2001 From: Sergiu Deitsch Date: Thu, 21 Dec 2023 20:40:43 +0100 Subject: [PATCH] cmake: use threads import target (#1000) --- CMakeLists.txt | 4 +++- glog-config.cmake.in | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1311b9e41..4712a156e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -531,7 +531,9 @@ if (HAVE_DBGHELP) endif (HAVE_DBGHELP) if (HAVE_PTHREAD) - target_link_libraries (glog PRIVATE ${CMAKE_THREAD_LIBS_INIT}) + target_link_libraries (glog PRIVATE Threads::Threads) + + set (Threads_DEPENDENCY "find_dependency (Threads)") if (CMAKE_THREAD_LIBS_INIT) set (glog_libraries_options_for_static_linking "${glog_libraries_options_for_static_linking} ${CMAKE_THREAD_LIBS_INIT}") diff --git a/glog-config.cmake.in b/glog-config.cmake.in index 5c5c9c0da..36e38c4c8 100644 --- a/glog-config.cmake.in +++ b/glog-config.cmake.in @@ -8,6 +8,7 @@ include (CMakeFindDependencyMacro) include (${CMAKE_CURRENT_LIST_DIR}/glog-modules.cmake) @gflags_DEPENDENCY@ +@Threads_DEPENDENCY@ @Unwind_DEPENDENCY@ include (${CMAKE_CURRENT_LIST_DIR}/glog-targets.cmake)