summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2017-01-20 17:42:30 +0000
committeriphydf <iphydf@users.noreply.github.com>2017-01-22 11:56:02 +0000
commitce0bf232d1b2c01df056df9a030e10ba5252832f (patch)
tree394ff60b46856d63737f6431c199b6aa38c90f9c /cmake
parentb630121f2f659027e1c9f00cd97087ef34e95677 (diff)
Add appveyor build for native windows tests.
It doesn't compile, yet. A few changes (like VLA support) need to be made before we can enable appveyor as a required PR check.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Dependencies.cmake56
-rw-r--r--cmake/ModulePackage.cmake8
2 files changed, 61 insertions, 3 deletions
diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
new file mode 100644
index 00000000..338a4193
--- /dev/null
+++ b/cmake/Dependencies.cmake
@@ -0,0 +1,56 @@
1###############################################################################
2#
3# :: For UNIX-like systems that have pkg-config.
4#
5###############################################################################
6
7include(ModulePackage)
8
9find_package(Threads REQUIRED)
10
11find_library(NCURSES_LIBRARIES ncurses )
12find_library(UTIL_LIBRARIES util )
13find_library(RT_LIBRARIES rt )
14
15# For toxcore.
16pkg_use_module(LIBSODIUM libsodium )
17
18# For toxav.
19pkg_use_module(OPUS opus )
20pkg_use_module(VPX vpx )
21
22# For tox-bootstrapd.
23pkg_use_module(LIBCONFIG libconfig )
24
25# For auto tests.
26pkg_use_module(CHECK check )
27
28# For tox-spectest.
29pkg_use_module(MSGPACK msgpack )
30
31# For av_test.
32pkg_use_module(OPENCV opencv )
33pkg_use_module(PORTAUDIO portaudio-2.0)
34pkg_use_module(SNDFILE sndfile )
35
36###############################################################################
37#
38# :: For Windows and other systems lacking pkg-config.
39#
40###############################################################################
41
42if(NOT LIBSODIUM_FOUND)
43 include_directories(include)
44 find_library(LIBSODIUM_LIBRARIES
45 NAMES
46 sodium
47 libsodium
48 PATHS
49 Win32/Release/v140/static
50 x64/Release/v140/static
51 )
52 if(LIBSODIUM_LIBRARIES)
53 set(LIBSODIUM_FOUND TRUE)
54 endif()
55 message("libsodium: ${LIBSODIUM_LIBRARIES}")
56endif()
diff --git a/cmake/ModulePackage.cmake b/cmake/ModulePackage.cmake
index 38f841ba..3a4eb9b9 100644
--- a/cmake/ModulePackage.cmake
+++ b/cmake/ModulePackage.cmake
@@ -10,7 +10,7 @@ if(NOT ENABLE_SHARED AND NOT ENABLE_STATIC)
10 set(ENABLE_SHARED ON) 10 set(ENABLE_SHARED ON)
11endif() 11endif()
12 12
13find_package(PkgConfig REQUIRED) 13find_package(PkgConfig)
14 14
15if(COMPILE_AS_CXX) 15if(COMPILE_AS_CXX)
16 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_FORMAT_MACROS=1") 16 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_FORMAT_MACROS=1")
@@ -34,8 +34,10 @@ function(add_c_executable exec)
34 add_executable(${exec} ${ARGN}) 34 add_executable(${exec} ${ARGN})
35endfunction() 35endfunction()
36 36
37function(pkg_use_module mod) 37function(pkg_use_module mod pkg)
38 pkg_search_module(${mod} ${ARGN}) 38 if(PKG_CONFIG_FOUND)
39 pkg_search_module(${mod} ${pkg})
40 endif()
39 if(${mod}_FOUND) 41 if(${mod}_FOUND)
40 link_directories(${${mod}_LIBRARY_DIRS}) 42 link_directories(${${mod}_LIBRARY_DIRS})
41 include_directories(${${mod}_INCLUDE_DIRS}) 43 include_directories(${${mod}_INCLUDE_DIRS})