summaryrefslogtreecommitdiff
path: root/cmake/Dependencies.cmake
blob: 338a41938f5257a1c2d7b664d3a5b6546d2a5a51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
###############################################################################
#
# :: For UNIX-like systems that have pkg-config.
#
###############################################################################

include(ModulePackage)

find_package(Threads REQUIRED)

find_library(NCURSES_LIBRARIES      ncurses      )
find_library(UTIL_LIBRARIES         util         )
find_library(RT_LIBRARIES           rt           )

# For toxcore.
pkg_use_module(LIBSODIUM            libsodium    )

# For toxav.
pkg_use_module(OPUS                 opus         )
pkg_use_module(VPX                  vpx          )

# For tox-bootstrapd.
pkg_use_module(LIBCONFIG            libconfig    )

# For auto tests.
pkg_use_module(CHECK                check        )

# For tox-spectest.
pkg_use_module(MSGPACK              msgpack      )

# For av_test.
pkg_use_module(OPENCV               opencv       )
pkg_use_module(PORTAUDIO            portaudio-2.0)
pkg_use_module(SNDFILE              sndfile      )

###############################################################################
#
# :: For Windows and other systems lacking pkg-config.
#
###############################################################################

if(NOT LIBSODIUM_FOUND)
  include_directories(include)
  find_library(LIBSODIUM_LIBRARIES
    NAMES
      sodium
      libsodium
    PATHS
      Win32/Release/v140/static
      x64/Release/v140/static
  )
  if(LIBSODIUM_LIBRARIES)
    set(LIBSODIUM_FOUND TRUE)
  endif()
  message("libsodium: ${LIBSODIUM_LIBRARIES}")
endif()