2017-01-21 01:42:30 +08:00
|
|
|
###############################################################################
|
|
|
|
#
|
|
|
|
# :: For UNIX-like systems that have pkg-config.
|
|
|
|
#
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
include(ModulePackage)
|
2018-09-20 16:01:40 +08:00
|
|
|
include(SimpleFindPackage)
|
|
|
|
|
|
|
|
if (MSVC)
|
|
|
|
set(THREADS_USE_PTHREADS_WIN32 1)
|
|
|
|
endif()
|
2017-01-21 01:42:30 +08:00
|
|
|
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
|
2018-09-20 16:01:40 +08:00
|
|
|
if (MSVC)
|
|
|
|
set_property(TARGET Threads::Threads APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS "HAVE_STRUCT_TIMESPEC")
|
|
|
|
endif()
|
|
|
|
|
2018-07-19 22:56:34 +08:00
|
|
|
find_library(NSL_LIBRARIES nsl )
|
2017-04-16 17:57:21 +08:00
|
|
|
find_library(RT_LIBRARIES rt )
|
2018-07-19 22:56:34 +08:00
|
|
|
find_library(SOCKET_LIBRARIES socket )
|
2017-01-21 01:42:30 +08:00
|
|
|
|
|
|
|
# For toxcore.
|
2018-09-20 16:01:40 +08:00
|
|
|
|
|
|
|
# Try to find both static and shared variants of sodium
|
|
|
|
set(sodium_USE_STATIC_LIBS OFF)
|
|
|
|
find_package(sodium)
|
|
|
|
if (NOT TARGET sodium)
|
|
|
|
set(sodium_USE_STATIC_LIBS ON)
|
|
|
|
find_package(sodium REQUIRED)
|
|
|
|
endif()
|
2017-01-21 01:42:30 +08:00
|
|
|
|
|
|
|
# For toxav.
|
2018-09-20 16:01:40 +08:00
|
|
|
simple_find_package(Opus
|
|
|
|
PKGCFG_NAME opus
|
|
|
|
INCLUDE_NAMES opus.h
|
|
|
|
PATH_SUFFIXES opus
|
|
|
|
LIB_NAMES opus)
|
|
|
|
|
|
|
|
simple_find_package(Vpx
|
|
|
|
PKGCFG_NAME vpx
|
|
|
|
INCLUDE_NAMES vpx_codec.h
|
|
|
|
PATH_SUFFIXES vpx
|
|
|
|
LIB_NAMES vpx vpxmd)
|
2017-01-21 01:42:30 +08:00
|
|
|
|
|
|
|
# For tox-bootstrapd.
|
2017-04-16 17:57:21 +08:00
|
|
|
pkg_use_module(LIBCONFIG libconfig )
|
2017-01-21 01:42:30 +08:00
|
|
|
|
|
|
|
# For tox-spectest.
|
2017-04-16 17:57:21 +08:00
|
|
|
pkg_use_module(MSGPACK msgpack )
|
2017-01-21 01:42:30 +08:00
|
|
|
|
|
|
|
# For av_test.
|
2017-04-16 17:57:21 +08:00
|
|
|
pkg_use_module(OPENCV opencv )
|
|
|
|
pkg_use_module(PORTAUDIO portaudio-2.0)
|
|
|
|
pkg_use_module(SNDFILE sndfile )
|