2017-01-21 01:42:30 +08:00
|
|
|
###############################################################################
|
|
|
|
#
|
|
|
|
# :: For UNIX-like systems that have pkg-config.
|
|
|
|
#
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
include(ModulePackage)
|
|
|
|
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
|
2017-04-16 17:57:21 +08:00
|
|
|
find_library(NCURSES_LIBRARIES ncurses )
|
|
|
|
find_library(UTIL_LIBRARIES util )
|
|
|
|
find_library(RT_LIBRARIES rt )
|
2017-01-21 01:42:30 +08:00
|
|
|
|
|
|
|
# For toxcore.
|
2017-04-16 17:57:21 +08:00
|
|
|
pkg_use_module(LIBSODIUM libsodium )
|
2017-01-21 01:42:30 +08:00
|
|
|
|
|
|
|
# For toxav.
|
2017-04-16 17:57:21 +08:00
|
|
|
pkg_use_module(OPUS opus )
|
|
|
|
pkg_use_module(VPX vpx )
|
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 auto tests.
|
2017-04-16 17:57:21 +08:00
|
|
|
pkg_use_module(CHECK check )
|
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 )
|
2017-01-21 01:42:30 +08:00
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
#
|
|
|
|
# :: For Windows and other systems lacking pkg-config.
|
|
|
|
#
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
if(NOT LIBSODIUM_FOUND)
|
2017-02-20 08:54:49 +08:00
|
|
|
include_directories(libsodium/include)
|
2017-01-21 01:42:30 +08:00
|
|
|
find_library(LIBSODIUM_LIBRARIES
|
|
|
|
NAMES
|
|
|
|
sodium
|
|
|
|
libsodium
|
|
|
|
PATHS
|
2017-02-20 08:54:49 +08:00
|
|
|
libsodium/Win32/Release/v140/static
|
|
|
|
libsodium/x64/Release/v140/static
|
2017-01-21 01:42:30 +08:00
|
|
|
)
|
|
|
|
if(LIBSODIUM_LIBRARIES)
|
|
|
|
set(LIBSODIUM_FOUND TRUE)
|
|
|
|
endif()
|
2017-02-20 11:21:34 +08:00
|
|
|
add_definitions(-DSODIUM_STATIC)
|
2017-01-21 01:42:30 +08:00
|
|
|
message("libsodium: ${LIBSODIUM_LIBRARIES}")
|
|
|
|
endif()
|
2017-02-20 08:54:49 +08:00
|
|
|
|
|
|
|
if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") AND CMAKE_USE_WIN32_THREADS_INIT)
|
|
|
|
include_directories(pthreads-win32/Pre-built.2/include)
|
|
|
|
find_library(CMAKE_THREAD_LIBS_INIT
|
|
|
|
NAMES
|
|
|
|
pthreadVC2
|
|
|
|
PATHS
|
|
|
|
pthreads-win32/Pre-built.2/lib/x86
|
|
|
|
pthreads-win32/Pre-built.2/lib/x64
|
|
|
|
)
|
|
|
|
add_definitions(-DHAVE_STRUCT_TIMESPEC)
|
|
|
|
message("libpthreads: ${CMAKE_THREAD_LIBS_INIT}")
|
|
|
|
endif()
|