From 0f80976750f485bc28ad2b00ccab28c34c3f565a Mon Sep 17 00:00:00 2001 From: gr0vity Date: Fri, 6 Dec 2024 00:54:59 +0100 Subject: [PATCH] different apporach --- CMakeLists.txt | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e9fb5d8f6..d4fc4dd6a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -129,13 +129,9 @@ if(NANO_STACKTRACE_BACKTRACE) add_definitions(-DNANO_STACKTRACE_BACKTRACE) add_definitions(-DBOOST_STACKTRACE_USE_BACKTRACE) - find_library(BACKTRACE_LIB backtrace) - if(NOT BACKTRACE_LIB) - file(GLOB_RECURSE BACKTRACE_GLOB_RESULTS - "/usr/lib*/libbacktrace.a" - "/usr/local/lib*/libbacktrace.a") - get_filename_component(BACKTRACE_HINT_DIRS "${BACKTRACE_GLOB_RESULTS}" DIRECTORY) - find_library(BACKTRACE_LIB backtrace HINTS ${BACKTRACE_HINT_DIRS}) + find_package(PkgConfig QUIET) + if(PKG_CONFIG_FOUND) + pkg_check_modules(BACKTRACE libbacktrace) endif() endif()