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()