summaryrefslogtreecommitdiff
blob: 956d6299d45739c51ad0f7727a0d491943f548ae (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 52fec6e..d068db1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,6 +11,11 @@ option(BUILD_TESTS "Build tests (run tests with make test)" ON)
 option(BUILD_SERVER "Build Snapserver" ON)
 option(BUILD_CLIENT "Build Snapclient" ON)
 
+option(BUILD_WITH_FLAC "Build with FLAC support" ON)
+option(BUILD_WITH_VORBIS "Build with VORBIS support" ON)
+option(BUILD_WITH_TREMOR "Build with vorbis using TREMOR" ON)
+option(BUILD_WITH_AVAHI "Build with AVAHI support" ON)
+
 
 if (NOT BUILD_SHARED_LIBS AND NOT BUILD_STATIC_LIBS)
     message(FATAL_ERROR "One or both of BUILD_SHARED_LIBS or BUILD_STATIC_LIBS must be set to ON to build")
@@ -109,10 +114,12 @@ else()
         endif (ALSA_FOUND)
     endif()
 
-    pkg_search_module(AVAHI avahi-client)
-    if (AVAHI_FOUND)
-        add_definitions(-DHAS_AVAHI)
-    endif (AVAHI_FOUND)
+    if(BUILD_WITH_AVAHI)
+        pkg_search_module(AVAHI avahi-client)
+        if (AVAHI_FOUND)
+            add_definitions(-DHAS_AVAHI)
+        endif (AVAHI_FOUND)
+    endif(BUILD_WITH_AVAHI)
 
     add_definitions(-DHAS_DAEMON)
 
@@ -154,29 +161,39 @@ if(NOT HAS_CXX11_STRING_SUPPORT)
     add_definitions("-DNO_CPP11_STRING")
 endif()
 
-pkg_search_module(FLAC flac)
-if (FLAC_FOUND)
-    add_definitions("-DHAS_FLAC")
-endif (FLAC_FOUND)
+if(BUILD_WITH_FLAC)
+    pkg_search_module(FLAC flac)
+    if (FLAC_FOUND)
+        add_definitions("-DHAS_FLAC")
+    endif (FLAC_FOUND)
+endif()
 
-pkg_search_module(OGG ogg)
-if (OGG_FOUND)
-    add_definitions("-DHAS_OGG")
-endif (OGG_FOUND)
+if(BUILD_WITH_VORBIS OR BUILD_WITH_TREMOR)
+    pkg_search_module(OGG ogg)
+    if (OGG_FOUND)
+        add_definitions("-DHAS_OGG")
+    endif (OGG_FOUND)
+endif()
 
-pkg_search_module(VORBIS vorbis)
-if (VORBIS_FOUND)
-    add_definitions("-DHAS_VORBIS")
-endif (VORBIS_FOUND)
+if(BUILD_WITH_VORBIS)
+    pkg_search_module(VORBIS vorbis)
+    if (VORBIS_FOUND)
+        add_definitions("-DHAS_VORBIS")
+    endif (VORBIS_FOUND)
+endif()
 
-pkg_search_module(TREMOR vorbisidec)
-if (TREMOR_FOUND)
-    add_definitions("-DHAS_TREMOR")
-endif (TREMOR_FOUND)
+if(BUILD_WITH_TREMOR)
+    pkg_search_module(TREMOR vorbisidec)
+    if (TREMOR_FOUND)
+        add_definitions("-DHAS_TREMOR")
+    endif (TREMOR_FOUND)
+endif()
 
-pkg_search_module(VORBISENC vorbisenc)
-if (VORBISENC_FOUND)
-    add_definitions("-DHAS_VORBISENC")
+if(BUILD_WITH_VORBIS)
+    pkg_search_module(VORBISENC vorbisenc)
+    if (VORBISENC_FOUND)
+        add_definitions("-DHAS_VORBISENC")
+    endif(VORBISENC_FOUND)
 endif()