diff options
author | iphydf <iphydf@users.noreply.github.com> | 2017-01-20 17:42:30 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2017-01-22 11:56:02 +0000 |
commit | ce0bf232d1b2c01df056df9a030e10ba5252832f (patch) | |
tree | 394ff60b46856d63737f6431c199b6aa38c90f9c /cmake | |
parent | b630121f2f659027e1c9f00cd97087ef34e95677 (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.cmake | 56 | ||||
-rw-r--r-- | cmake/ModulePackage.cmake | 8 |
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 | |||
7 | include(ModulePackage) | ||
8 | |||
9 | find_package(Threads REQUIRED) | ||
10 | |||
11 | find_library(NCURSES_LIBRARIES ncurses ) | ||
12 | find_library(UTIL_LIBRARIES util ) | ||
13 | find_library(RT_LIBRARIES rt ) | ||
14 | |||
15 | # For toxcore. | ||
16 | pkg_use_module(LIBSODIUM libsodium ) | ||
17 | |||
18 | # For toxav. | ||
19 | pkg_use_module(OPUS opus ) | ||
20 | pkg_use_module(VPX vpx ) | ||
21 | |||
22 | # For tox-bootstrapd. | ||
23 | pkg_use_module(LIBCONFIG libconfig ) | ||
24 | |||
25 | # For auto tests. | ||
26 | pkg_use_module(CHECK check ) | ||
27 | |||
28 | # For tox-spectest. | ||
29 | pkg_use_module(MSGPACK msgpack ) | ||
30 | |||
31 | # For av_test. | ||
32 | pkg_use_module(OPENCV opencv ) | ||
33 | pkg_use_module(PORTAUDIO portaudio-2.0) | ||
34 | pkg_use_module(SNDFILE sndfile ) | ||
35 | |||
36 | ############################################################################### | ||
37 | # | ||
38 | # :: For Windows and other systems lacking pkg-config. | ||
39 | # | ||
40 | ############################################################################### | ||
41 | |||
42 | if(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}") | ||
56 | endif() | ||
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) |
11 | endif() | 11 | endif() |
12 | 12 | ||
13 | find_package(PkgConfig REQUIRED) | 13 | find_package(PkgConfig) |
14 | 14 | ||
15 | if(COMPILE_AS_CXX) | 15 | if(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}) |
35 | endfunction() | 35 | endfunction() |
36 | 36 | ||
37 | function(pkg_use_module mod) | 37 | function(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}) |