2023-07-25 11:53:09 +02:00
|
|
|
###############################################################################
|
|
|
|
#
|
2024-01-09 16:39:05 +01:00
|
|
|
# :: For systems that have pkg-config.
|
2023-07-25 11:53:09 +02:00
|
|
|
#
|
|
|
|
###############################################################################
|
|
|
|
|
2024-01-09 16:39:05 +01:00
|
|
|
find_package(PkgConfig REQUIRED)
|
2023-07-25 11:53:09 +02:00
|
|
|
|
2023-12-27 12:37:22 +01:00
|
|
|
find_library(NSL_LIBRARIES nsl )
|
|
|
|
find_library(RT_LIBRARIES rt )
|
|
|
|
find_library(SOCKET_LIBRARIES socket)
|
2023-07-25 11:53:09 +02:00
|
|
|
|
2024-01-09 16:39:05 +01:00
|
|
|
find_package(pthreads QUIET)
|
|
|
|
if(NOT TARGET PThreads4W::PThreads4W)
|
2024-12-04 11:41:10 +01:00
|
|
|
find_package(pthreads4w QUIET)
|
|
|
|
endif()
|
|
|
|
if(NOT TARGET pthreads4w::pthreads4w)
|
2024-01-09 16:39:05 +01:00
|
|
|
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
endif()
|
|
|
|
|
2023-07-25 11:53:09 +02:00
|
|
|
# For toxcore.
|
2024-12-04 11:41:10 +01:00
|
|
|
pkg_search_module(LIBSODIUM libsodium IMPORTED_TARGET)
|
2024-01-09 16:39:05 +01:00
|
|
|
if(MSVC)
|
2024-12-04 11:41:10 +01:00
|
|
|
find_package(libsodium)
|
|
|
|
if(NOT TARGET libsodium::libsodium)
|
|
|
|
find_package(unofficial-sodium REQUIRED)
|
|
|
|
endif()
|
2024-01-09 16:39:05 +01:00
|
|
|
endif()
|
2023-07-25 11:53:09 +02:00
|
|
|
|
|
|
|
# For toxav.
|
2023-12-27 12:37:22 +01:00
|
|
|
pkg_search_module(OPUS opus IMPORTED_TARGET)
|
|
|
|
if(NOT OPUS_FOUND)
|
|
|
|
pkg_search_module(OPUS Opus IMPORTED_TARGET)
|
|
|
|
endif()
|
2024-12-04 11:41:10 +01:00
|
|
|
if(NOT OPUS_FOUND)
|
|
|
|
find_package(Opus)
|
|
|
|
if(TARGET Opus::opus)
|
|
|
|
set(OPUS_FOUND TRUE)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2023-12-27 12:37:22 +01:00
|
|
|
pkg_search_module(VPX vpx IMPORTED_TARGET)
|
|
|
|
if(NOT VPX_FOUND)
|
|
|
|
pkg_search_module(VPX libvpx IMPORTED_TARGET)
|
|
|
|
endif()
|
2024-12-04 11:41:10 +01:00
|
|
|
if(NOT VPX_FOUND)
|
|
|
|
find_package(libvpx)
|
|
|
|
if(TARGET libvpx::libvpx)
|
|
|
|
set(VPX_FOUND TRUE)
|
|
|
|
endif()
|
|
|
|
endif()
|
2023-07-25 11:53:09 +02:00
|
|
|
|
|
|
|
# For tox-bootstrapd.
|
2023-12-27 12:37:22 +01:00
|
|
|
pkg_search_module(LIBCONFIG libconfig IMPORTED_TARGET)
|