From d0ee5dae32ae69041166e36efba7bd7d21462e8c Mon Sep 17 00:00:00 2001 From: Pavol Sloboda Date: Wed, 16 Jul 2025 10:42:08 +0200 Subject: [PATCH] Added the support for pkgconf when finding system thrift as fedora uses pkgconf to help locate the thrift files during compilation instead of a Thrift.cmake file. I have added this logic in such a way that the existing logic should not be affected. Therefore enabling the use of system thrift even without pkgconf. --- cmake/thrift.cmake | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cmake/thrift.cmake b/cmake/thrift.cmake index 8a8088676..10763e8ac 100644 --- a/cmake/thrift.cmake +++ b/cmake/thrift.cmake @@ -12,7 +12,17 @@ if(WITH_THRIFT STREQUAL "system" OR WITH_THRIFT STREQUAL "auto") set(THRIFT_LIBRARY "${THRIFT_LIBRARIES}") return() elseif(WITH_THRIFT STREQUAL "system") - message(FATAL_ERROR "System Thrift requested but not found!") + FIND_PACKAGE(PkgConfig REQUIRED) + pkg_check_modules(THRIFT REQUIRED thrift) + + if(THRIFT_FOUND) + add_custom_target(external_thrift) + set(THRIFT_INCLUDE_DIR "${THRIFT_INCLUDE_DIR}") + set(THRIFT_LIBRARY "${THRIFT_LIBRARIES}") + return() + else() + message(FATAL_ERROR "System Thrift requested but not found!") + endif() endif() endif()