vcpkg/ports/sentry-native/fix-config-cmake.patch
Gleb Ignatev aacceff7c5
[sentry-native] Add missing CMakeFindDependencyMacro for find_dependency (#20597)
* ports: sentry-native: Add CMakeFindDependencyMacro for find_dependency

find_dependency requires CMakeFindDependencyMacro to be included,
otherwise there is a CMake error when using find_package(sentry).

* versions: update sentry-native port-version to 2
2021-10-11 20:29:57 -07:00

28 lines
877 B
Diff

diff --git a/sentry-config.cmake.in b/sentry-config.cmake.in
index 89ea345..c14b31c 100644
--- a/sentry-config.cmake.in
+++ b/sentry-config.cmake.in
@@ -3,9 +3,11 @@
set(SENTRY_BACKEND @SENTRY_BACKEND@)
set(SENTRY_TRANSPORT @SENTRY_TRANSPORT@)
+include(CMakeFindDependencyMacro)
+
if(SENTRY_BACKEND STREQUAL "crashpad")
if(@SENTRY_CRASHPAD_SYSTEM@)
- find_package(crashpad REQUIRED)
+ find_dependency(crashpad)
else()
include("${CMAKE_CURRENT_LIST_DIR}/sentry_crashpad-targets.cmake")
endif()
@@ -14,7 +16,7 @@ endif()
include("${CMAKE_CURRENT_LIST_DIR}/sentry-targets.cmake")
if(SENTRY_TRANSPORT STREQUAL "curl" AND NOT @BUILD_SHARED_LIBS@)
- find_package(CURL REQUIRED)
+ find_dependency(CURL)
set_property(TARGET sentry::sentry APPEND
- PROPERTY INTERFACE_LINK_LIBRARIES ${CURL_LIBRARIES})
+ PROPERTY INTERFACE_LINK_LIBRARIES CURL::libcurl)
endif()