]>
Commit | Line | Data |
---|---|---|
1e59de90 TL |
1 | # Compute the installation prefix relative to this file. |
2 | get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) | |
3 | get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) | |
4 | get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) | |
5 | if(_IMPORT_PREFIX STREQUAL "/") | |
6 | set(_IMPORT_PREFIX "") | |
7 | endif() | |
8 | ||
9 | add_library(crashpad INTERFACE) | |
10 | add_library(crashpad::crashpad ALIAS crashpad) | |
11 | ||
12 | set(CRASHPAD_LIBRARIES client util base) | |
13 | ||
14 | if(WIN32) | |
15 | target_compile_definitions(crashpad INTERFACE NOMINMAX) | |
16 | elseif(APPLE) | |
17 | list(APPEND CRASHPAD_LIBRARIES ApplicationServices | |
18 | CoreFoundation Foundation IOKit Security bsm) | |
19 | endif() | |
20 | ||
21 | foreach(LIB_NAME ${CRASHPAD_LIBRARIES}) | |
22 | find_library(_LIB ${LIB_NAME}) | |
23 | target_link_libraries(crashpad INTERFACE ${_LIB}) | |
24 | unset(_LIB CACHE) | |
25 | endforeach() | |
26 | ||
27 | find_package(ZLIB REQUIRED) | |
28 | target_link_libraries(crashpad INTERFACE ZLIB::ZLIB) | |
29 | ||
30 | target_include_directories(crashpad | |
31 | INTERFACE ${_IMPORT_PREFIX}/include/crashpad) |