2023-11-29 10:34:00 +01:00
|
|
|
if(NOT COMMAND z_vcpkg_@PORT@_get_link_libraries)
|
|
|
|
function(z_vcpkg_@PORT@_get_link_libraries out_var type libraries)
|
2022-12-21 04:29:21 +01:00
|
|
|
set(libs "")
|
2023-11-29 10:34:00 +01:00
|
|
|
if(type STREQUAL "DEBUG")
|
2024-04-04 01:14:05 +02:00
|
|
|
set(vcpkg_link_directories "${z_vcpkg_@PORT@_root}/debug/lib" "${z_vcpkg_@PORT@_root}/lib")
|
2023-11-29 10:34:00 +01:00
|
|
|
else()
|
2024-04-04 01:14:05 +02:00
|
|
|
set(vcpkg_link_directories "${z_vcpkg_@PORT@_root}/lib" "${z_vcpkg_@PORT@_root}/debug/lib")
|
2023-11-29 10:34:00 +01:00
|
|
|
endif()
|
2022-12-21 04:29:21 +01:00
|
|
|
foreach(lib IN LISTS libraries)
|
2023-01-18 22:38:56 +01:00
|
|
|
if(lib MATCHES [[^/|^(dl|m|pthread)$|^-framework ]])
|
2022-12-21 04:29:21 +01:00
|
|
|
list(APPEND libs "${lib}")
|
2024-04-04 01:14:05 +02:00
|
|
|
elseif(EXISTS "${lib}")
|
|
|
|
list(APPEND libs "${lib}")
|
2022-12-21 04:29:21 +01:00
|
|
|
else()
|
2023-11-29 10:34:00 +01:00
|
|
|
string(MAKE_C_IDENTIFIER "${out_var}_${lib}_${type}" lib_var)
|
2024-04-04 01:14:05 +02:00
|
|
|
find_library("${lib_var}" NAMES "${lib}" NAMES_PER_DIR PATHS ${vcpkg_link_directories})
|
2022-12-21 04:29:21 +01:00
|
|
|
mark_as_advanced("${lib_var}")
|
|
|
|
if(${lib_var})
|
|
|
|
list(APPEND libs "${${lib_var}}")
|
|
|
|
else()
|
2024-04-04 01:14:05 +02:00
|
|
|
find_library("${lib_var}" NAMES "${lib}" NAMES_PER_DIR PATHS ${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES} NO_DEFAULT_PATH)
|
|
|
|
if(${lib_var})
|
|
|
|
list(APPEND libs "${lib}")
|
|
|
|
else()
|
|
|
|
message(WARNING "Omitting '${lib}' from link libraries.")
|
|
|
|
endif()
|
2022-12-21 04:29:21 +01:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
set("${out_var}" "${libs}" PARENT_SCOPE)
|
|
|
|
endfunction()
|
2023-11-29 10:34:00 +01:00
|
|
|
endif()
|
2022-12-21 04:29:21 +01:00
|
|
|
|
2023-11-29 10:34:00 +01:00
|
|
|
get_filename_component(z_vcpkg_@PORT@_root "${CMAKE_CURRENT_LIST_DIR}" PATH)
|
|
|
|
get_filename_component(z_vcpkg_@PORT@_root "${z_vcpkg_@PORT@_root}" PATH)
|
2022-12-21 04:29:21 +01:00
|
|
|
|
2023-11-29 10:34:00 +01:00
|
|
|
file(GLOB z_vcpkg_@PORT@_config_files "${CMAKE_CURRENT_LIST_DIR}/unofficial-@PORT@-*-targets.cmake")
|
|
|
|
foreach(z_vcpkg_@PORT@_config_file IN LISTS z_vcpkg_@PORT@_config_files)
|
|
|
|
include("${z_vcpkg_@PORT@_config_file}")
|
|
|
|
endforeach()
|
2022-12-21 04:29:21 +01:00
|
|
|
|
2023-11-29 10:34:00 +01:00
|
|
|
unset(z_vcpkg_@PORT@_config_file)
|
|
|
|
unset(z_vcpkg_@PORT@_config_files)
|
|
|
|
unset(z_vcpkg_@PORT@_root)
|