Makefile.am 10.5 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
libmedialibrary_la_CPPFLAGS = \
	$(MEDIALIB_CPPFLAGS) \
	$(SQLITE_CFLAGS) \
	$(NULL)

22 23 24 25 26
libmedialibrary_la_HEADERS = \
	include/medialibrary/IAlbum.h \
	include/medialibrary/IAlbumTrack.h \
	include/medialibrary/IArtist.h \
	include/medialibrary/IAudioTrack.h \
27
	include/medialibrary/IChapter.h \
28 29 30 31 32 33 34 35 36 37 38 39
	include/medialibrary/IFile.h \
	include/medialibrary/IGenre.h \
	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 \
40
	include/medialibrary/IDeviceLister.h \
41
	include/medialibrary/IFolder.h \
42
	include/medialibrary/IQuery.h \
43
	include/medialibrary/IMetadata.h \
44
	include/medialibrary/ISubtitleTrack.h \
45
	include/medialibrary/IThumbnailer.h \
46 47
	$(NULL)

48
libmedialibraryfsdir = $(libmedialibrary_ladir)/filesystem
49 50 51 52
libmedialibraryfs_HEADERS = \
	include/medialibrary/filesystem/IDevice.h \
	include/medialibrary/filesystem/IDirectory.h \
	include/medialibrary/filesystem/IFile.h \
53
	include/medialibrary/filesystem/IFileSystemFactory.h \
54 55
	$(NULL)

56
libmedialibraryparserdir = $(libmedialibrary_ladir)/parser
57 58
libmedialibraryparser_HEADERS = \
	include/medialibrary/parser/IItem.h \
59
	include/medialibrary/parser/Parser.h \
60
	include/medialibrary/parser/IParserService.h \
61 62
	$(NULL)

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 \
71
	src/Chapter.cpp \
72 73 74 75 76 77 78 79 80
	src/Folder.cpp \
	src/Genre.cpp \
	src/Label.cpp \
	src/Media.cpp \
	src/MediaLibrary.cpp \
	src/Movie.cpp \
	src/Playlist.cpp \
	src/Settings.cpp \
	src/Show.cpp \
81
	src/Thumbnail.cpp \
82 83
	src/ShowEpisode.cpp \
	src/VideoTrack.cpp \
84
	src/Metadata.cpp \
85
	src/SubtitleTrack.cpp \
86 87 88 89 90
	src/database/SqliteConnection.cpp \
	src/database/SqliteTools.cpp \
	src/database/SqliteTransaction.cpp \
	src/discoverer/DiscovererWorker.cpp \
	src/discoverer/FsDiscoverer.cpp \
91
	src/discoverer/probe/PathProbe.cpp \
92
	src/factory/FileSystemFactory.cpp \
93
	src/factory/DeviceListerFactory.cpp \
94
	src/filesystem/common/CommonDevice.cpp \
95
	src/filesystem/common/CommonFile.cpp \
96
	src/filesystem/common/CommonDirectory.cpp \
97 98 99
	src/logging/IostreamLogger.cpp \
	src/logging/Logger.cpp \
	src/metadata_services/MetadataParser.cpp \
100
	src/thumbnails/ThumbnailerWorker.cpp \
101
	src/parser/Parser.cpp \
102
	src/parser/ParserWorker.cpp \
103
	src/parser/Task.cpp \
104
	src/utils/Directory.cpp \
105 106
	src/utils/Filename.cpp \
	src/utils/ModificationsNotifier.cpp \
107
	src/utils/Strings.cpp \
108
	src/utils/Url.cpp \
109
	src/utils/File.cpp \
110 111
	$(NULL)

112

113 114 115 116 117 118 119 120 121 122 123
noinst_HEADERS = \
	include/discoverer/IDiscoverer.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 \
124
	src/database/SqliteQuery.h \
125 126 127 128 129 130
	src/database/SqliteTools.h \
	src/database/SqliteTraits.h \
	src/database/SqliteTransaction.h \
	src/Device.h \
	src/discoverer/DiscovererWorker.h \
	src/discoverer/FsDiscoverer.h \
131 132 133
	src/discoverer/probe/CrawlerProbe.h \
	src/discoverer/probe/IProbe.h \
	src/discoverer/probe/PathProbe.h \
134
	src/factory/FileSystemFactory.h \
135
	src/factory/DeviceListerFactory.h \
136 137
	src/File.h \
	src/filesystem/common/CommonFile.h \
138
	src/filesystem/common/CommonDirectory.h \
139
	src/filesystem/common/CommonDevice.h \
140
	src/filesystem/darwin/DeviceLister.h \
141 142 143
	src/filesystem/unix/Device.h \
	src/filesystem/unix/Directory.h \
	src/filesystem/unix/File.h \
144
	src/filesystem/unix/DeviceLister.h \
145 146
	src/filesystem/win32/Directory.h \
	src/filesystem/win32/File.h \
147
	src/Chapter.h \
148 149 150 151 152 153 154 155
	src/Folder.h \
	src/Genre.h \
	src/Label.h \
	src/logging/IostreamLogger.h \
	src/logging/Logger.h \
	src/Media.h \
	src/MediaLibrary.h \
	src/metadata_services/MetadataParser.h \
156
	src/thumbnails/ThumbnailerWorker.h \
157 158
	src/Movie.h \
	src/parser/Parser.h \
159
	src/parser/ParserWorker.h \
160 161 162 163 164
	src/parser/Task.h \
	src/Playlist.h \
	src/Settings.h \
	src/ShowEpisode.h \
	src/Show.h \
165
	src/Thumbnail.h \
166
	src/utils/Directory.h \
167 168
	src/utils/Filename.h \
	src/utils/ModificationsNotifier.h \
169
	src/utils/Strings.h \
170
	src/utils/SWMRLock.h \
171
	src/utils/Url.h \
172
	src/utils/File.h \
173
	src/VideoTrack.h \
174
	src/Metadata.h \
175
	src/compat/Thread.h \
176
	src/compat/Mutex.h \
177
	src/compat/ConditionVariable.h \
178
	src/SubtitleTrack.h \
179 180 181
	$(NULL)


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

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

215 216 217 218 219 220
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

221 222 223 224 225 226
lib_LTLIBRARIES = libmedialibrary.la
if HAVE_DARWIN
lib_LTLIBRARIES += libmedialibrary_macos.la
endif

if HAVE_LIBVLC
227

228 229
if HAVE_LIBVLC4
libmedialibrary_la_SOURCES += \
230 231
	src/thumbnails/CoreThumbnailer.cpp \
	src/thumbnails/CoreThumbnailer.h
232 233 234

else
libmedialibrary_la_SOURCES += \
235 236
	src/thumbnails/VmemThumbnailer.cpp \
	src/thumbnails/VmemThumbnailer.h
237

238
if HAVE_LIBJPEG
239 240
libmedialibrary_la_SOURCES += src/thumbnails/imagecompressors/JpegCompressor.cpp
noinst_HEADERS += src/thumbnails/imagecompressors/JpegCompressor.h
241 242 243 244
libmedialibrary_la_CPPFLAGS += $(LIBJPEG_CFLAGS)
libmedialibrary_la_LIBADD += $(LIBJPEG_LIBS)
endif

245 246
endif

247 248 249 250 251 252 253 254 255 256 257 258 259 260
libmedialibrary_la_SOURCES += \
	src/metadata_services/vlc/VLCMetadataService.cpp \
	src/metadata_services/vlc/Common.cpp \
	src/utils/VLCInstance.cpp \
	src/factory/NetworkFileSystemFactory.cpp \
	src/filesystem/network/Directory.cpp \
	src/filesystem/network/File.cpp \
	src/filesystem/network/Device.cpp \
	$(NULL)

noinst_HEADERS += \
	src/utils/VLCInstance.h \
    src/metadata_services/vlc/Common.hpp \
	src/metadata_services/vlc/VLCMetadataService.h \
261
	src/thumbnails/imagecompressors/IImageCompressor.h \
262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277
	src/factory/NetworkFileSystemFactory.h \
	src/filesystem/network/Device.h \
	src/filesystem/network/Directory.h \
	src/filesystem/network/File.h \
	$(NULL)

libmedialibrary_la_CPPFLAGS += \
	$(VLC_CFLAGS) \
	$(VLCPP_CFLAGS) \
	$(NULL)

libmedialibrary_la_LIBADD += $(VLC_LIBS)

endif


278 279
EXTRA_DIST=

280 281 282 283 284 285 286 287 288 289 290 291 292
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 = \
293
	$(AM_CPPFLAGS) \
294 295
	-I$(top_srcdir)/googletest \
	-I$(top_srcdir)/googletest/include
296

297
libgtestmain_la_CPPFLAGS = $(AM_CPPFLAGS) $(libgtest_la_CPPFLAGS)
298 299 300 301 302 303 304 305 306 307 308

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 \
309
	test/unittest/ChapterTests.cpp \
310 311 312 313
	test/unittest/DeviceTests.cpp \
	test/unittest/FileTests.cpp \
	test/unittest/FolderTests.cpp \
	test/unittest/FsUtilsTests.cpp \
314
	test/unittest/UrlTests.cpp \
315 316 317 318 319 320 321 322 323
	test/unittest/GenreTests.cpp \
	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 \
324
	test/unittest/MiscTests.cpp \
325
	test/unittest/ThumbnailTests.cpp \
326
	test/unittest/SubtitleTrackTests.cpp \
327 328
	$(NULL)

329 330
EXTRA_DIST += test/unittest/db_v3.sql

331
unittest_CPPFLAGS = 		\
332
	$(MEDIALIB_CPPFLAGS) 	\
333
	-DSRC_DIR=\"$(abs_srcdir)\"	\
334
	-I$(top_srcdir)/test	\
335
	-I$(top_srcdir)/googletest/include \
336
	$(libmedialibrary_la_CPPFLAGS) \
337 338 339 340 341 342 343 344 345 346 347 348 349 350 351
	$(NULL)

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

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

352
samples_CPPFLAGS = 			\
353
	$(MEDIALIB_CPPFLAGS)	\
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
354
	-DSRC_DIR=\"$(abs_srcdir)\"	\
355
	-I$(top_srcdir)/test	\
356
	-I$(top_srcdir)/googletest/include \
357
	$(RAPIDJSON_CFLAGS)		\
358
	$(libmedialibrary_la_CPPFLAGS) \
359 360 361 362 363 364 365 366 367
	$(NULL)

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

368 369 370 371 372 373
EXTRA_PROGRAMS = test_discoverer

test_discoverer_SOURCES = test/discoverer/main.cpp
test_discoverer_CXXFLAGS = $(MEDIALIB_CPPFLAGS)
test_discoverer_LDADD = libmedialibrary.la $(SQLITE_LIBS)

374 375
endif

376 377
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = medialibrary.pc
378
EXTRA_DIST += medialibrary.pc \
379
	src/database/migrations/migration3-5.sql \
380
	src/database/migrations/migration7-8.sql \
381
	src/database/migrations/migration13-14.sql \
382
	src/database/migrations/migration14-15.sql \
383
	src/database/migrations/migration15-16.sql \
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
384
	src/database/migrations/migration16-17.sql \
385 386 387
	src/database/tables/File_v14.sql \
	src/database/tables/File_triggers_v14.sql \
	src/database/tables/Media_v14.sql \
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
388
	src/database/tables/Media_v17.sql \
389 390
	src/database/tables/Media_triggers_v14.sql \
	src/database/tables/Folder_v14.sql \
391
	src/database/tables/Folder_v15.sql \
392
	src/database/tables/Folder_v16.sql \
393
	src/database/tables/Folder_triggers_v14.sql \
394
	src/database/tables/Folder_triggers_v15.sql \
395
	src/database/tables/Playlist_v14.sql \
396
	src/database/tables/Playlist_v16.sql \
397
	src/database/tables/Playlist_triggers_v14.sql \
398
	src/database/tables/Playlist_triggers_v16.sql \
399
	src/database/tables/Metadata_v14.sql \
400
	src/database/tables/Device_v14.sql \
401
	src/database/tables/Task_v14.sql \
402 403 404 405
	$(NULL)