2020-05-12 05:58:12 +08:00
|
|
|
# Compute the installation prefix relative to this file.
|
|
|
|
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
|
|
|
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
|
|
|
|
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
|
|
|
|
if(_IMPORT_PREFIX STREQUAL "/")
|
|
|
|
set(_IMPORT_PREFIX "")
|
|
|
|
endif()
|
|
|
|
|
2024-08-20 00:47:33 +08:00
|
|
|
include(CMakeFindDependencyMacro)
|
|
|
|
find_dependency(ZLIB)
|
2020-05-12 05:58:12 +08:00
|
|
|
|
2024-08-20 00:47:33 +08:00
|
|
|
if(NOT TARGET crashpad::crashpad)
|
|
|
|
add_library(crashpad::crashpad INTERFACE IMPORTED)
|
|
|
|
target_include_directories(crashpad::crashpad INTERFACE "${_IMPORT_PREFIX}/include/crashpad")
|
2020-05-12 05:58:12 +08:00
|
|
|
|
2024-09-18 05:10:28 +08:00
|
|
|
set(_libs vcpkg_crashpad_client vcpkg_crashpad_client_common vcpkg_crashpad_util vcpkg_crashpad_base)
|
2024-08-20 00:47:33 +08:00
|
|
|
if(APPLE)
|
|
|
|
list(APPEND _libs mig_output)
|
|
|
|
endif()
|
|
|
|
include(SelectLibraryConfigurations)
|
|
|
|
foreach(_lib IN LISTS _libs)
|
|
|
|
find_library(CRASHPAD_${_lib}_LIBRARY_RELEASE NAMES ${_lib} PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib" NO_DEFAULT_PATH)
|
|
|
|
find_library(CRASHPAD_${_lib}_LIBRARY_DEBUG NAMES ${_lib} PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib" NO_DEFAULT_PATH)
|
|
|
|
select_library_configurations(CRASHPAD_${_lib})
|
|
|
|
target_link_libraries(crashpad::crashpad INTERFACE ${CRASHPAD_${_lib}_LIBRARIES})
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
target_compile_definitions(crashpad::crashpad INTERFACE NOMINMAX)
|
|
|
|
elseif(APPLE)
|
|
|
|
foreach(_lib IN ITEMS ApplicationServices CoreFoundation Foundation IOKit Security bsm)
|
|
|
|
find_library(CRASHPAD_${_lib}_LIBRARY NAMES ${_lib})
|
|
|
|
target_link_libraries(crashpad::crashpad INTERFACE ${CRASHPAD_${_lib}_LIBRARY})
|
|
|
|
endforeach()
|
|
|
|
elseif(ANDROID)
|
|
|
|
target_link_libraries(crashpad::crashpad INTERFACE log)
|
|
|
|
endif()
|
2020-05-12 05:58:12 +08:00
|
|
|
|
2024-08-20 00:47:33 +08:00
|
|
|
target_link_libraries(crashpad::crashpad INTERFACE ZLIB::ZLIB)
|
2020-05-12 05:58:12 +08:00
|
|
|
|
2024-08-20 00:47:33 +08:00
|
|
|
if(NOT TARGET crashpad)
|
|
|
|
add_library(crashpad ALIAS crashpad::crashpad)
|
|
|
|
endif()
|
2020-05-12 05:58:12 +08:00
|
|
|
|
2024-08-20 00:47:33 +08:00
|
|
|
unset(_lib)
|
|
|
|
unset(_libs)
|
|
|
|
endif()
|