[winpr] fallback to pkg-config for uriparser

older versions do not ship a CMake configuration, fall back to
pkg-config based detection in that case.
This commit is contained in:
Armin Novak 2023-10-11 10:11:21 +02:00 committed by akallabeth
parent eefe052690
commit a7e8a72396
1 changed files with 10 additions and 2 deletions

View File

@ -106,9 +106,17 @@ set(CMAKE_REQUIRED_LIBRARIES rt)
find_package(uriparser)
option(WITH_URIPARSER "use uriparser library to handle URIs" ${uriparser_FOUND})
if (WITH_URIPARSER)
find_package(uriparser CONFIG REQUIRED char)
find_package(uriparser CONFIG COMPONENTS char)
if (uriparser_FOUND)
winpr_library_add_private(uriparser::uriparser)
else()
find_package(PkgConfig REQUIRED)
pkg_check_modules(uriparser REQUIRED liburiparser)
winpr_include_directory_add(${uriparser_INCLUDEDIR})
winpr_include_directory_add(${uriparser_INCLUDE_DIRS})
winpr_library_add_private(${uriparser_LIBRARIES})
endif()
add_definitions("-DWITH_URIPARSER")
winpr_library_add_private(uriparser::uriparser)
endif()
if(NOT IOS)