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()
|
|
|
|
|
|
|
|
add_library(crashpad INTERFACE)
|
|
|
|
add_library(crashpad::crashpad ALIAS crashpad)
|
|
|
|
|
2024-04-29 21:10:58 +08:00
|
|
|
set(CRASHPAD_LIBRARIES common client util base)
|
2020-05-12 05:58:12 +08:00
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
target_compile_definitions(crashpad INTERFACE NOMINMAX)
|
|
|
|
elseif(APPLE)
|
|
|
|
list(APPEND CRASHPAD_LIBRARIES ApplicationServices
|
2022-09-07 05:54:31 +08:00
|
|
|
CoreFoundation Foundation IOKit Security bsm mig_output)
|
2020-05-12 05:58:12 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
foreach(LIB_NAME ${CRASHPAD_LIBRARIES})
|
|
|
|
find_library(_LIB ${LIB_NAME})
|
|
|
|
target_link_libraries(crashpad INTERFACE ${_LIB})
|
|
|
|
unset(_LIB CACHE)
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
find_package(ZLIB REQUIRED)
|
|
|
|
target_link_libraries(crashpad INTERFACE ZLIB::ZLIB)
|
|
|
|
|
|
|
|
target_include_directories(crashpad
|
|
|
|
INTERFACE ${_IMPORT_PREFIX}/include/crashpad)
|