-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
188 lines (149 loc) · 5.88 KB
/
CMakeLists.txt
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
#
# CMakeLists.txt - The main CMake file
#
# Copyright (c) 2010 Paul Giblock <pgib/at/users.sourceforge.net>
#
# This file is part of Unison - http://unison.sourceforge.net/
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program (see COPYING); if not, write to the
# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301 USA.
#
cmake_minimum_required(VERSION 2.6)
project(unison)
enable_testing()
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
include(DefineCMakeDefaults)
include(DefineCompilerFlags)
include(MacroLogFeature)
find_package(PkgConfig)
find_package(Jack)
find_package(Slv2)
# TODO: use these to ensure the user has at least one backend supported.
# Since JACK is the only backend right now, we simply require JACK
set(BACKENDS_AVAILABLE "")
set(BACKENDS_ENABLED "")
## Options ########
option(WANT_FLAC_EXTENSION "Include FLAC file support extension" OFF)
option(WANT_JACK_EXTENSION "Include JACK (Jack Audio Connection Kit) backend extension" ON)
option(WANT_LADSPA_EXTENSION "Include LADSPA plugin support extension" ON)
option(WANT_LV2_EXTENSION "Include LV2 plugin support extension" ON)
option(WANT_OGGVORBIS_EXTENSION "Include OGG/Vorbis file support extension" ON)
option(WANT_SNDFILE_EXTENSION "Include libsndfile support (WAV,AIFF,SND,VOC,etc..) extension" ON)
option(COMPILE_TESTS "Compile unit-tests" OFF)
## Find required dependencies ########
find_package(Qt4 4.6.0 COMPONENTS QtCore QtGui QtXml QtNetwork) # REQUIRED)
macro_log_feature(QT4_FOUND "Qt4"
"Needed for cross-platform data, UI, XML, and Network support"
"http://qt.nokia.com/"
TRUE "" "")
## Find dependencies based on features selected ########
if(WANT_FLAC_EXTENSION)
find_package(Flac)
macro_log_feature(FLAC_FOUND "Flac"
"Needed for the Flac audio file extension."
"http://flac.sourceforge.net/"
FALSE "" "")
#find_package(Flac++)
#macro_log_feature( FLAC++_FOUND "Flac++"
# "Needed for the Flac support extension."
# "http://flac.sourceforge.net/"
# FALSE "" "")
endif(WANT_FLAC_EXTENSION)
if(WANT_JACK_EXTENSION)
find_package(Jack)
# JACK is technically optional, but it is required since it is the only
# backend implementation at the current time
macro_log_feature(JACK_FOUND "Jack"
"Needed for the Jack (Jack Audio Connection Kit) backend extension."
"http://jackaudio.org/"
TRUE "" "")
endif(WANT_JACK_EXTENSION)
if(WANT_LV2_EXTENSION)
find_package(Slv2)
macro_log_feature(SLV2_FOUND "SLV2"
"Needed to discover, load, and use LV2 plugins."
"http://drobilla.net/docs/slv2/"
FALSE "" "")
endif(WANT_LV2_EXTENSION)
if(WANT_OGGVORBIS_EXTENSION)
find_package(OggVorbis)
macro_log_feature(OGGVORBIS_FOUND "Ogg Vorbis"
"Needed for the Ogg Vorbis audio file extention."
"http://www.vorbis.com/"
FALSE "" "")
endif(WANT_OGGVORBIS_EXTENSION)
if(WANT_SNDFILE_EXTENSION)
find_package(Sndfile)
macro_log_feature(SNDFILE_FOUND "Sndfile"
"Needed for the libsndfile extension which supports many audio types."
"http://www.mega-nerd.com/libsndfile/"
FALSE "" "")
endif(WANT_SNDFILE_EXTENSION)
## Now, enable features based on which deps are found ########
if(WANT_FLAC_EXTENSION AND FLAC_FOUND) # AND FLAC++_FOUND)
set(BUILD_FLAC_EXTENSION 1)
endif(WANT_FLAC_EXTENSION AND FLAC_FOUND) # AND FLAC++_FOUND)
if(WANT_JACK_EXTENSION AND JACK_FOUND)
set(BUILD_JACK_EXTENSION 1)
endif(WANT_JACK_EXTENSION AND JACK_FOUND)
if(WANT_LADSPA_EXTENSION)
set(BUILD_LADSPA_EXTENSION 1)
endif(WANT_LADSPA_EXTENSION)
if(WANT_LV2_EXTENSION AND SLV2_FOUND)
set(BUILD_LV2_EXTENSION 1)
endif(WANT_LV2_EXTENSION AND SLV2_FOUND)
if(WANT_OGGVORBIS_EXTENSION AND OGGVORBIS_FOUND)
set(BUILD_OGGVORBIS_EXTENSION 1)
endif(WANT_OGGVORBIS_EXTENSION AND OGGVORBIS_FOUND)
if(WANT_SNDFILE_EXTENSION AND SNDFILE_FOUND)
set(BUILD_SNDFILE_EXTENSION 1)
endif(WANT_SNDFILE_EXTENSION AND SNDFILE_FOUND)
## Doxygen ########
set(DOXYFILE_LATEX "NO")
include(UseDoxygen OPTIONAL)
configure_file(${CMAKE_SOURCE_DIR}/Doxyfile.in
${CMAKE_BINARY_DIR}/Doxyfile)
## Define some stuff ########
include(${QT_USE_FILE})
# Qt translations feedback
if(EXISTS "${QT_TRANSLATIONS_DIR}")
message("-- Found Qt translations in ${QT_TRANSLATIONS_DIR}")
add_definitions(-D'QT_TRANSLATIONS_DIR="${QT_TRANSLATIONS_DIR}"')
endif(EXISTS "${QT_TRANSLATIONS_DIR}")
if(NOT WIN32)
string(REPLACE "-DQT_DLL" "" QT_DEFINITIONS "${QT_DEFINITIONS}")
endif(NOT WIN32)
# use, i.e. don't skip the full RPATH for the build tree
set(CMAKE_SKIP_BUILD_RPATH FALSE)
# when building, don't use the install RPATH already
# (but later on when installing)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
# the RPATH to be used when installing
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib/unison")
# don't add the automatically determined parts of the RPATH
# which point to directories outside the build tree to the install RPATH
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
#Internal location, TODO: Don't hardcode platform-specific paths!!
set(PRG_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/libs/prg)
set(UNISON_INCLUDE_DIR ) #${CMAKE_SOURCE_DIR}/libs/unison)
set(COMMON_LIBS_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/libs)
#Directories
add_subdirectory(libs)
add_subdirectory(extensions)
add_subdirectory(plugins)
add_subdirectory(unisonstudio)
## Config Summary ########
macro_display_feature_log()
# vim: tw=90 ts=8 sw=2 sts=2 et sta noai