summaryrefslogtreecommitdiff
path: root/cmake/Dependencies.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/Dependencies.cmake')
-rw-r--r--cmake/Dependencies.cmake37
1 files changed, 22 insertions, 15 deletions
diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
index 8361e8e1..37eb40bd 100644
--- a/cmake/Dependencies.cmake
+++ b/cmake/Dependencies.cmake
@@ -16,8 +16,8 @@ find_library(SOCKET_LIBRARIES socket )
16pkg_use_module(LIBSODIUM libsodium ) 16pkg_use_module(LIBSODIUM libsodium )
17 17
18# For toxav. 18# For toxav.
19pkg_use_module(OPUS opus ) 19pkg_use_module(OPUS "opus;Opus" )
20pkg_use_module(VPX vpx ) 20pkg_use_module(VPX "vpx;libvpx" )
21 21
22# For tox-bootstrapd. 22# For tox-bootstrapd.
23pkg_use_module(LIBCONFIG libconfig ) 23pkg_use_module(LIBCONFIG libconfig )
@@ -38,18 +38,20 @@ pkg_use_module(MSGPACK msgpack )
38if(MSVC) 38if(MSVC)
39 # libsodium 39 # libsodium
40 # --------- 40 # ---------
41 find_library(LIBSODIUM_LIBRARIES 41 if(NOT LIBSODIUM_FOUND)
42 NAMES sodium libsodium 42 find_library(LIBSODIUM_LIBRARIES
43 PATHS 43 NAMES sodium libsodium
44 "third_party/libsodium/Win32/Release/v140/dynamic" 44 PATHS
45 "third_party/libsodium/x64/Release/v140/dynamic" 45 "third_party/libsodium/Win32/Release/v140/dynamic"
46 ) 46 "third_party/libsodium/x64/Release/v140/dynamic"
47 if(LIBSODIUM_LIBRARIES) 47 )
48 include_directories("third_party/libsodium/include") 48 if(LIBSODIUM_LIBRARIES)
49 set(LIBSODIUM_FOUND TRUE) 49 include_directories("third_party/libsodium/include")
50 message("libsodium: ${LIBSODIUM_LIBRARIES}") 50 set(LIBSODIUM_FOUND TRUE)
51 else() 51 message("libsodium: ${LIBSODIUM_LIBRARIES}")
52 message(FATAL_ERROR "libsodium libraries not found") 52 else()
53 message(FATAL_ERROR "libsodium libraries not found")
54 endif()
53 endif() 55 endif()
54 56
55 # pthreads 57 # pthreads
@@ -66,7 +68,12 @@ if(MSVC)
66 add_definitions(-DHAVE_STRUCT_TIMESPEC) 68 add_definitions(-DHAVE_STRUCT_TIMESPEC)
67 message("libpthreads: ${CMAKE_THREAD_LIBS_INIT}") 69 message("libpthreads: ${CMAKE_THREAD_LIBS_INIT}")
68 else() 70 else()
69 message(FATAL_ERROR "libpthreads libraries not found") 71 find_package(pthreads4w)
72 if(NOT pthreads4w_FOUND)
73 message(FATAL_ERROR "libpthreads libraries not found")
74 endif()
75 include_directories(${pthreads4w_INCLUDE_DIR})
76 link_libraries(${pthreads4w_LIBRARIES})
70 endif() 77 endif()
71 endif() 78 endif()
72endif() 79endif()