aboutsummaryrefslogtreecommitdiff
path: root/ports/crashpad/crashpadConfig.cmake.in
blob: 1c95bf1b77eef76e6109b1547d7e8c2e68db8872 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# 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)

set(CRASHPAD_LIBRARIES client util base)

if(WIN32)
	target_compile_definitions(crashpad INTERFACE NOMINMAX)
elseif(APPLE)
	list(APPEND CRASHPAD_LIBRARIES ApplicationServices
        CoreFoundation Foundation IOKit Security bsm)
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)