| 1 |
# PjDeps.cmake - Generated by pjproject CMake build |
| 2 |
# |
| 3 |
# Recreates Pj::Dep::* targets that map to either bundled (exported in |
| 4 |
# PjTargets) or system (via find_dependency) third-party libraries. |
| 5 |
|
| 6 |
include(CMakeFindDependencyMacro) |
| 7 |
|
| 8 |
# Temporarily add our Find modules for system dependency discovery |
| 9 |
set(_pj_saved_module_path "${CMAKE_MODULE_PATH}") |
| 10 |
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") |
| 11 |
|
| 12 |
# Bundled dependencies: real targets are exported as Pj::<subdir> in PjTargets. |
| 13 |
# Create INTERFACE IMPORTED targets that forward to them. |
| 14 |
set(_pj_bundled_deps "@PJ_BUNDLED_DEPS_STR@") |
| 15 |
|
| 16 |
set(_pj_bundled_target_G7221 "Pj::g7221") |
| 17 |
set(_pj_bundled_target_GSM "Pj::gsm") |
| 18 |
set(_pj_bundled_target_iLBC "Pj::ilbc") |
| 19 |
set(_pj_bundled_target_Resample "Pj::resample") |
| 20 |
set(_pj_bundled_target_Speex "Pj::speex") |
| 21 |
set(_pj_bundled_target_SRTP "Pj::srtp") |
| 22 |
set(_pj_bundled_target_YUV "Pj::yuv") |
| 23 |
set(_pj_bundled_target_WebRTC "Pj::webrtc") |
| 24 |
set(_pj_bundled_target_WebRTC_AEC3 "Pj::webrtc_aec3") |
| 25 |
|
| 26 |
foreach(_dep IN LISTS _pj_bundled_deps) |
| 27 |
if(NOT TARGET Pj::Dep::${_dep} AND DEFINED _pj_bundled_target_${_dep}) |
| 28 |
if(TARGET ${_pj_bundled_target_${_dep}}) |
| 29 |
add_library(Pj::Dep::${_dep} INTERFACE IMPORTED) |
| 30 |
set_target_properties(Pj::Dep::${_dep} PROPERTIES |
| 31 |
INTERFACE_LINK_LIBRARIES "${_pj_bundled_target_${_dep}}" |
| 32 |
) |
| 33 |
else() |
| 34 |
message(WARNING "pjproject: bundled target ${_pj_bundled_target_${_dep}} " |
| 35 |
"not found for Pj::Dep::${_dep}") |
| 36 |
endif() |
| 37 |
endif() |
| 38 |
endforeach() |
| 39 |
|
| 40 |
# System dependencies: locate via find_dependency, then create forwarding |
| 41 |
# targets. |
| 42 |
set(_pj_system_deps "@PJ_SYSTEM_DEPS_STR@") |
| 43 |
|
| 44 |
set(_pj_system_package_G7221 "G7221") |
| 45 |
set(_pj_system_package_GSM "GSM") |
| 46 |
set(_pj_system_package_Resample "Resample") |
| 47 |
set(_pj_system_package_Speex "Speex") |
| 48 |
set(_pj_system_package_SRTP "SRTP") |
| 49 |
set(_pj_system_package_YUV "YUV") |
| 50 |
|
| 51 |
foreach(_dep IN LISTS _pj_system_deps) |
| 52 |
if(NOT TARGET Pj::Dep::${_dep} AND DEFINED _pj_system_package_${_dep}) |
| 53 |
find_dependency(${_pj_system_package_${_dep}}) |
| 54 |
set(_sys_target "${_pj_system_package_${_dep}}::${_pj_system_package_${_dep}}") |
| 55 |
if(TARGET ${_sys_target}) |
| 56 |
add_library(Pj::Dep::${_dep} INTERFACE IMPORTED) |
| 57 |
set_target_properties(Pj::Dep::${_dep} PROPERTIES |
| 58 |
INTERFACE_LINK_LIBRARIES "${_sys_target}" |
| 59 |
) |
| 60 |
else() |
| 61 |
message(WARNING "pjproject: system target ${_sys_target} " |
| 62 |
"not found for Pj::Dep::${_dep}") |
| 63 |
endif() |
| 64 |
unset(_sys_target) |
| 65 |
endif() |
| 66 |
endforeach() |
| 67 |
|
| 68 |
# Restore module path and cleanup |
| 69 |
set(CMAKE_MODULE_PATH "${_pj_saved_module_path}") |
| 70 |
unset(_pj_saved_module_path) |
| 71 |
unset(_pj_bundled_deps) |
| 72 |
unset(_pj_system_deps) |