From cc0607e8ceaddf289ba3537e91f3633da3f3ab91 Mon Sep 17 00:00:00 2001 From: mehulmathur001 <160306774+mehulmathur001@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:15:13 +0000 Subject: [PATCH] testing: findsentry --- CMakeLists.txt | 2 ++ cmake/Findsentry.cmake | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 cmake/Findsentry.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index e4cb0638f4f..097bb23aad5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -260,6 +260,8 @@ if(CCACHE_FOUND) endif(CCACHE_FOUND) set(SENTRY_BACKEND "crashpad") +set(SENTRY_INCLUDE_DIR "3rdparty/sentry-native/include") +set(SENTRY_LIBRARIES "3rdparty/sentry-native") add_subdirectory(3rdparty/edbee-lib/edbee-lib) add_subdirectory(3rdparty/communi) diff --git a/cmake/Findsentry.cmake b/cmake/Findsentry.cmake new file mode 100644 index 00000000000..7a2cba48975 --- /dev/null +++ b/cmake/Findsentry.cmake @@ -0,0 +1,39 @@ +# - Try to find Sentry +# Once done, this will define +# +# SENTRY_FOUND - system has Sentry +# SENTRY_INCLUDE_DIRS - the Sentry include directory +# SENTRY_LIBRARIES - Link these to use Sentry +# +# Imported Targets +# sentry::sentry + +if (SENTRY_INCLUDE_DIR) + # Already in cache, be silent + set(SENTRY_FIND_QUIETLY TRUE) +endif() + +find_path(SENTRY_INCLUDE_DIR sentry.h + HINTS ${SENTRY_DIR} + PATH_SUFFIXES include + PATHS /usr/local /usr /sw /opt/local /opt c:/libs + NO_DEFAULT_PATH +) + +find_library(SENTRY_LIBRARIES + NAMES sentry + HINTS ${SENTRY_DIR} + PATH_SUFFIXES lib64 lib + PATHS /usr/local /usr /sw /opt/local /opt c:/libs + NO_DEFAULT_PATH +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(sentry DEFAULT_MSG SENTRY_LIBRARIES SENTRY_INCLUDE_DIR) + +if(SENTRY_FOUND) + set(SENTRY_LIBRARIES ${SENTRY_LIBRARIES} CACHE STRING "Sentry libraries") + set(SENTRY_INCLUDE_DIR ${SENTRY_INCLUDE_DIR} CACHE STRING "Sentry include directory") +endif() + +mark_as_advanced(SENTRY_LIBRARIES SENTRY_INCLUDE_DIR)