summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorMaxim Biro <nurupo.contributions@gmail.com>2017-04-16 05:57:21 -0400
committerMaxim Biro <nurupo.contributions@gmail.com>2017-04-22 15:31:25 -0400
commitc7f63737ebfff2d1948ec9d6d92295a75d75cae5 (patch)
treeffaa46d8aecb53041ed61f6be73a4743fae6d4b1 /cmake
parent5ed37e543825c023163adba95b99ea81d3337196 (diff)
Revert "Implement tox_loop"
This reverts commit 5ff099763b1f56414572e1c12eb2f003117db5a0.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Dependencies.cmake32
-rw-r--r--cmake/ModulePackage.cmake27
2 files changed, 12 insertions, 47 deletions
diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
index 4cb96594..5ad332bd 100644
--- a/cmake/Dependencies.cmake
+++ b/cmake/Dependencies.cmake
@@ -8,38 +8,30 @@ include(ModulePackage)
8 8
9find_package(Threads REQUIRED) 9find_package(Threads REQUIRED)
10 10
11find_library(NCURSES_LIBRARIES ncurses ) 11find_library(NCURSES_LIBRARIES ncurses )
12find_library(UTIL_LIBRARIES util ) 12find_library(UTIL_LIBRARIES util )
13find_library(RT_LIBRARIES rt ) 13find_library(RT_LIBRARIES rt )
14 14
15# For toxcore. 15# For toxcore.
16pkg_use_module(LIBSODIUM libsodium ) 16pkg_use_module(LIBSODIUM libsodium )
17pkg_use_module(LIBEV ev )
18if(NOT LIBEV_FOUND)
19 if(NOT WIN32)
20 pkg_use_module(LIBEVENT libevent_pthreads )
21 else()
22 pkg_use_module(LIBEVENT libevent )
23 endif()
24endif()
25 17
26# For toxav. 18# For toxav.
27pkg_use_module(OPUS opus ) 19pkg_use_module(OPUS opus )
28pkg_use_module(VPX vpx ) 20pkg_use_module(VPX vpx )
29 21
30# For tox-bootstrapd. 22# For tox-bootstrapd.
31pkg_use_module(LIBCONFIG libconfig ) 23pkg_use_module(LIBCONFIG libconfig )
32 24
33# For auto tests. 25# For auto tests.
34pkg_use_module(CHECK check ) 26pkg_use_module(CHECK check )
35 27
36# For tox-spectest. 28# For tox-spectest.
37pkg_use_module(MSGPACK msgpack ) 29pkg_use_module(MSGPACK msgpack )
38 30
39# For av_test. 31# For av_test.
40pkg_use_module(OPENCV opencv ) 32pkg_use_module(OPENCV opencv )
41pkg_use_module(PORTAUDIO portaudio-2.0 ) 33pkg_use_module(PORTAUDIO portaudio-2.0)
42pkg_use_module(SNDFILE sndfile ) 34pkg_use_module(SNDFILE sndfile )
43 35
44############################################################################### 36###############################################################################
45# 37#
diff --git a/cmake/ModulePackage.cmake b/cmake/ModulePackage.cmake
index 4d22ee41..3a4eb9b9 100644
--- a/cmake/ModulePackage.cmake
+++ b/cmake/ModulePackage.cmake
@@ -2,8 +2,6 @@ option(ENABLE_SHARED "Build shared (dynamic) libraries for all modules" ON)
2option(ENABLE_STATIC "Build static libraries for all modules" ON) 2option(ENABLE_STATIC "Build static libraries for all modules" ON)
3option(COMPILE_AS_CXX "Compile all C code as C++ code" OFF) 3option(COMPILE_AS_CXX "Compile all C code as C++ code" OFF)
4 4
5include(FindPackageHandleStandardArgs)
6
7if(NOT ENABLE_SHARED AND NOT ENABLE_STATIC) 5if(NOT ENABLE_SHARED AND NOT ENABLE_STATIC)
8 message(WARNING 6 message(WARNING
9 "Both static and shared libraries are disabled; " 7 "Both static and shared libraries are disabled; "
@@ -50,31 +48,6 @@ function(pkg_use_module mod pkg)
50 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -isystem ${dir}" PARENT_SCOPE) 48 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -isystem ${dir}" PARENT_SCOPE)
51 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem ${dir}" PARENT_SCOPE) 49 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem ${dir}" PARENT_SCOPE)
52 endforeach() 50 endforeach()
53 else()
54 set(${mod}_DEFINITIONS ${${mod}_CFLAGS_OTHER})
55 find_path(${mod}_INCLUDE_DIR NAMES ${ARGV1}.h
56 HINTS ${${mod}_INCLUDEDIR} ${${mod}_INCLUDE_DIRS}
57 PATH_SUFFIXES ${ARGV1})
58 find_library(${mod}_LIBRARY NAMES ${ARGV1} lib${ARGV1}
59 HINTS ${${mod}_LIBDIR} ${${mod}_LIBRARY_DIRS})
60 find_package_handle_standard_args(${mod} DEFAULT_MSG
61 ${mod}_LIBRARY ${mod}_INCLUDE_DIR)
62
63 if(${mod}_FOUND)
64 mark_as_advanced(${mod}_INCLUDE_DIR ${mod}_LIBRARY)
65 set(${mod}_LIBRARIES ${${mod}_LIBRARY} PARENT_SCOPE)
66 set(${mod}_INCLUDE_DIRS ${${mod}_INCLUDE_DIR} PARENT_SCOPE)
67 set(${mod}_FOUND TRUE PARENT_SCOPE)
68 link_directories(${${mod}_LIBRARY_DIRS})
69 include_directories(${${mod}_INCLUDE_DIRS})
70 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${${mod}_CFLAGS_OTHER}" PARENT_SCOPE)
71 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${${mod}_CFLAGS_OTHER}" PARENT_SCOPE)
72
73 foreach(dir ${${mod}_INCLUDE_DIRS})
74 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -isystem ${dir}" PARENT_SCOPE)
75 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem ${dir}" PARENT_SCOPE)
76 endforeach()
77 endif()
78 endif() 51 endif()
79endfunction() 52endfunction()
80 53