Makefile.am 9.07 KB
Newer Older
1 2
ACLOCAL_AMFLAGS = -I m4

3
AM_CXXFLAGS = -Wall -Wsign-compare -Wextra -Wstrict-aliasing -Wstrict-overflow \
4
			  -Wformat=2 -Wno-unused-parameter -Wcast-align -Wpointer-arith \
5
			  -Wwrite-strings \
6 7 8 9
			  -pipe

MEDIALIB_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/include -I$(top_srcdir)/src

10 11
libmedialibrary_ladir = $(includedir)/medialibrary

12
libmedialibrary_la_CXXFLAGS = \
13
	$(AM_CXXFLAGS) \
14 15 16
	-fvisibility=default \
	$(NULL)

17 18 19 20 21 22 23
libmedialibrary_la_CPPFLAGS = \
	$(MEDIALIB_CPPFLAGS) \
	$(SQLITE_CFLAGS) \
	$(VLC_CFLAGS) \
	$(VLCPP_CFLAGS) \
	$(NULL)

24 25 26 27 28 29 30
libmedialibrary_la_HEADERS = \
	include/medialibrary/IAlbum.h \
	include/medialibrary/IAlbumTrack.h \
	include/medialibrary/IArtist.h \
	include/medialibrary/IAudioTrack.h \
	include/medialibrary/IFile.h \
	include/medialibrary/IGenre.h \
31
	include/medialibrary/IHistoryEntry.h \
32 33 34 35 36 37 38 39 40 41
	include/medialibrary/ILabel.h \
	include/medialibrary/ILogger.h \
	include/medialibrary/IMedia.h \
	include/medialibrary/IMediaLibrary.h \
	include/medialibrary/IMovie.h \
	include/medialibrary/IPlaylist.h \
	include/medialibrary/IShowEpisode.h \
	include/medialibrary/IShow.h \
	include/medialibrary/IVideoTrack.h \
	include/medialibrary/Types.h \
42
	include/medialibrary/IDeviceLister.h \
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
43
	include/medialibrary/IFolder.h \
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
44
	include/medialibrary/IQuery.h \
45 46
	$(NULL)

47 48 49 50 51 52 53
libmedialibraryfsdir = $(includedir)/filesystem
libmedialibraryfs_HEADERS = \
	include/medialibrary/filesystem/IDevice.h \
	include/medialibrary/filesystem/IDirectory.h \
	include/medialibrary/filesystem/IFile.h \
	$(NULL)

54 55 56
libmedialibraryparserdir = $(includedir)/parser
libmedialibraryparser_HEADERS = \
	include/medialibrary/parser/IItem.h \
57
	include/medialibrary/parser/Parser.h \
58
	include/medialibrary/parser/IParserService.h \
59 60
	$(NULL)

61 62 63 64 65 66 67 68 69 70
libmedialibrary_la_SOURCES = \
	src/Album.cpp \
	src/AlbumTrack.cpp \
	src/Artist.cpp \
	src/AudioTrack.cpp \
	src/Device.cpp \
	src/Factory.cpp \
	src/File.cpp \
	src/Folder.cpp \
	src/Genre.cpp \
71
	src/History.cpp \
72 73 74 75 76 77 78
	src/Label.cpp \
	src/Media.cpp \
	src/MediaLibrary.cpp \
	src/Movie.cpp \
	src/Playlist.cpp \
	src/Settings.cpp \
	src/Show.cpp \
79
	src/Thumbnail.cpp \
80 81 82 83 84 85 86
	src/ShowEpisode.cpp \
	src/VideoTrack.cpp \
	src/database/SqliteConnection.cpp \
	src/database/SqliteTools.cpp \
	src/database/SqliteTransaction.cpp \
	src/discoverer/DiscovererWorker.cpp \
	src/discoverer/FsDiscoverer.cpp \
87
	src/discoverer/probe/PathProbe.cpp \
88
	src/factory/FileSystemFactory.cpp \
89
	src/factory/NetworkFileSystemFactory.cpp \
90
	src/factory/DeviceListerFactory.cpp \
91
	src/filesystem/common/CommonDevice.cpp \
92
	src/filesystem/common/CommonFile.cpp \
93
	src/filesystem/common/CommonDirectory.cpp \
94 95 96
	src/filesystem/network/Directory.cpp \
	src/filesystem/network/File.cpp \
	src/filesystem/network/Device.cpp \
97 98 99
	src/logging/IostreamLogger.cpp \
	src/logging/Logger.cpp \
	src/metadata_services/MetadataParser.cpp \
100
	src/metadata_services/vlc/Common.cpp \
101 102 103
	src/metadata_services/vlc/VLCMetadataService.cpp \
	src/metadata_services/vlc/VLCThumbnailer.cpp \
	src/parser/Parser.cpp \
104
	src/parser/ParserWorker.cpp \
105
	src/parser/Task.cpp \
106
	src/utils/Directory.cpp \
107 108
	src/utils/Filename.cpp \
	src/utils/ModificationsNotifier.cpp \
109
	src/utils/Url.cpp \
110 111 112
	src/utils/VLCInstance.cpp \
	$(NULL)

113 114 115 116 117 118 119 120 121 122 123 124
noinst_HEADERS = \
	include/discoverer/IDiscoverer.h \
	include/factory/IFileSystem.h \
	include/Fixup.h \
	include/Types.h \
	src/Album.h \
	src/AlbumTrack.h \
	src/Artist.h \
	src/AudioTrack.h \
	src/database/DatabaseHelpers.h \
	src/database/SqliteConnection.h \
	src/database/SqliteErrors.h \
125
	src/database/SqliteQuery.h \
126 127 128 129 130 131
	src/database/SqliteTools.h \
	src/database/SqliteTraits.h \
	src/database/SqliteTransaction.h \
	src/Device.h \
	src/discoverer/DiscovererWorker.h \
	src/discoverer/FsDiscoverer.h \
132 133 134
	src/discoverer/probe/CrawlerProbe.h \
	src/discoverer/probe/IProbe.h \
	src/discoverer/probe/PathProbe.h \
135
	src/factory/FileSystemFactory.h \
136
	src/factory/NetworkFileSystemFactory.h \
137
	src/factory/DeviceListerFactory.h \
138 139
	src/File.h \
	src/filesystem/common/CommonFile.h \
140
	src/filesystem/common/CommonDirectory.h \
141
	src/filesystem/common/CommonDevice.h \
Soomin Lee's avatar
Soomin Lee committed
142
	src/filesystem/darwin/DeviceLister.h \
143 144 145
	src/filesystem/unix/Device.h \
	src/filesystem/unix/Directory.h \
	src/filesystem/unix/File.h \
146 147 148
	src/filesystem/network/Device.h \
	src/filesystem/network/Directory.h \
	src/filesystem/network/File.h \
149
	src/filesystem/unix/DeviceLister.h \
150 151 152 153
	src/filesystem/win32/Directory.h \
	src/filesystem/win32/File.h \
	src/Folder.h \
	src/Genre.h \
154
	src/History.h \
155 156 157 158 159 160
	src/Label.h \
	src/logging/IostreamLogger.h \
	src/logging/Logger.h \
	src/Media.h \
	src/MediaLibrary.h \
	src/metadata_services/MetadataParser.h \
161
	src/metadata_services/vlc/Common.hpp \
162 163
	src/metadata_services/vlc/VLCMetadataService.h \
	src/metadata_services/vlc/VLCThumbnailer.h \
164
	src/metadata_services/vlc/imagecompressors/IImageCompressor.h \
165 166
	src/Movie.h \
	src/parser/Parser.h \
167
	src/parser/ParserWorker.h \
168 169 170 171 172
	src/parser/Task.h \
	src/Playlist.h \
	src/Settings.h \
	src/ShowEpisode.h \
	src/Show.h \
173
	src/Thumbnail.h \
174
	src/utils/Cache.h \
175
	src/utils/Directory.h \
176 177 178
	src/utils/Filename.h \
	src/utils/ModificationsNotifier.h \
	src/utils/SWMRLock.h \
179
	src/utils/Url.h \
180 181
	src/utils/VLCInstance.h \
	src/VideoTrack.h \
182
	src/compat/Thread.h \
183
	src/compat/Mutex.h \
184
	src/compat/ConditionVariable.h \
185 186 187
	$(NULL)


188 189 190
if HAVE_WIN32
libmedialibrary_la_SOURCES += \
	src/filesystem/win32/Directory.cpp \
191
	src/filesystem/win32/File.cpp \
192
	src/filesystem/win32/DeviceLister.cpp \
193
	$(NULL)
194 195 196
noinst_HEADERS += \
	src/utils/Charsets.h \
	$(NULL)
197 198 199
else
libmedialibrary_la_SOURCES += \
	src/filesystem/unix/Directory.cpp \
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
200 201
	src/filesystem/unix/File.cpp \
	$(NULL)
202
if HAVE_LINUX
203
if !HAVE_ANDROID
204
libmedialibrary_la_SOURCES += \
205 206
	src/filesystem/unix/DeviceLister.cpp \
	$(NULL)
207
endif
208
endif
209
if HAVE_DARWIN
210
libmedialibrary_macos_la_CPPFLAGS = $(libmedialibrary_la_CPPFLAGS)
211
libmedialibrary_macos_la_SOURCES = \
Soomin Lee's avatar
Soomin Lee committed
212 213
	src/filesystem/darwin/DeviceLister.mm \
	$(NULL)
214
endif
215 216 217 218 219 220 221
endif

libmedialibrary_la_LIBADD = \
	$(SQLITE_LIBS) 			\
	$(VLC_LIBS) 			\
	$(NULL)

222 223 224 225 226 227 228
libmedialibrary_la_LDFLAGS = -no-undefined -export-symbols-regex 'NewMediaLibrary'
if HAVE_DARWIN
libmedialibrary_la_LIBADD += libmedialibrary_macos.la
libmedialibrary_la_LDFLAGS += -Wl,-undefined,dynamic_lookup,-framework,Foundation
endif


229 230 231 232 233 234 235
if HAVE_LIBJPEG
libmedialibrary_la_SOURCES += src/metadata_services/vlc/imagecompressors/JpegCompressor.cpp
noinst_HEADERS += src/metadata_services/vlc/imagecompressors/JpegCompressor.h
libmedialibrary_la_CPPFLAGS += $(LIBJPEG_CFLAGS)
libmedialibrary_la_LIBADD += $(LIBJPEG_LIBS)
endif

236
lib_LTLIBRARIES = libmedialibrary.la
237 238 239
if HAVE_DARWIN
lib_LTLIBRARIES += libmedialibrary_macos.la
endif
240

241 242
EXTRA_DIST=

243 244 245 246 247 248 249 250 251 252 253 254 255
if HAVE_TESTS

check_PROGRAMS = unittest samples

lib_LTLIBRARIES += libgtest.la libgtestmain.la

libgtest_la_SOURCES = \
	googletest/src/gtest-all.cc

libgtestmain_la_SOURCES = \
	googletest/src/gtest_main.cc

libgtest_la_CPPFLAGS = \
256 257
	-I$(top_srcdir)/googletest \
	-I$(top_srcdir)/googletest/include
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284

if HAVE_PTHREAD
	libgtest_la_CPPFLAGS += -DGTEST_HAS_PTHREAD=1
	libgtest_la_CXXFLAGS = $(PTHREAD_CFLAGS)
	libgtest_la_LIDADD = $(PTHREAD_LIBS)
else
	libgtest_la_CPPFLAGS += -DGTEST_HAS_PTHREAD=0
endif

libgtestmain_la_CPPFLAGS = $(libgtest_la_CPPFLAGS)
libgtestmain_la_CXXFLAGS = $(libgtest_la_CXXFLAGS)
libgtestmain_la_LIBADD   = $(libgtest_la_LIBADD)

unittest_SOURCES = \
	test/common/MediaLibraryTester.cpp \
	test/mocks/FileSystem.cpp \
	test/mocks/filesystem/MockDevice.cpp \
	test/mocks/filesystem/MockDirectory.cpp \
	test/mocks/filesystem/MockFile.cpp \
	test/unittest/AlbumTests.cpp \
	test/unittest/AlbumTrackTests.cpp \
	test/unittest/ArtistTests.cpp \
	test/unittest/AudioTrackTests.cpp \
	test/unittest/DeviceTests.cpp \
	test/unittest/FileTests.cpp \
	test/unittest/FolderTests.cpp \
	test/unittest/FsUtilsTests.cpp \
285
	test/unittest/UrlTests.cpp \
286
	test/unittest/GenreTests.cpp \
287
	test/unittest/HistoryTests.cpp \
288 289 290 291 292 293 294 295
	test/unittest/LabelTests.cpp \
	test/unittest/MediaTests.cpp \
	test/unittest/MovieTests.cpp \
	test/unittest/PlaylistTests.cpp \
	test/unittest/RemovalNotifierTests.cpp \
	test/unittest/ShowTests.cpp \
	test/unittest/Tests.cpp \
	test/unittest/VideoTrackTests.cpp \
296
	test/unittest/MiscTests.cpp \
297
	test/unittest/ThumbnailTests.cpp \
298 299
	$(NULL)

300 301
EXTRA_DIST += test/unittest/db_v3.sql

302
unittest_CPPFLAGS = 		\
303
	$(MEDIALIB_CPPFLAGS) 	\
304
	-DSRC_DIR=\"$(abs_srcdir)\"	\
305
	-I$(top_srcdir)/test	\
306
	-I$(top_srcdir)/googletest/include \
307
	$(libmedialibrary_la_CPPFLAGS) \
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323
	$(NULL)

unittest_LDADD = 		\
	libmedialibrary.la 	\
	libgtest.la			\
	libgtestmain.la		\
	$(PTHREAD_LIBS) 	\
	$(SQLITE_LIBS)		\
	$(NULL)

samples_SOURCES = 						\
	test/common/MediaLibraryTester.cpp 	\
	test/samples/main.cpp 				\
	test/samples/Tester.cpp 			\
	$(NULL)

324
samples_CPPFLAGS = 			\
325
	$(MEDIALIB_CPPFLAGS)	\
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
326
	-DSRC_DIR=\"$(abs_srcdir)\"	\
327
	-I$(top_srcdir)/test	\
328
	-I$(top_srcdir)/googletest/include \
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
329
	$(RAPIDJSON_CFLAGS)		\
330
	$(libmedialibrary_la_CPPFLAGS) \
331 332 333 334 335 336 337 338 339 340 341 342
	$(NULL)

samples_LDADD = 		\
	libmedialibrary.la	\
	libgtest.la			\
	libgtestmain.la		\
	$(PTHREAD_LIBS) 	\
	$(SQLITE_LIBS)		\
	$(NULL)

endif

343 344
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = medialibrary.pc
345
EXTRA_DIST += medialibrary.pc \
346
	src/database/migrations/migration3-5.sql \
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
347 348
	src/database/migrations/migration7-8.sql \
	src/database/migrations/migration13-14.sql