Makefile.am 9.31 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 27 28
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 \
29
	include/medialibrary/IHistoryEntry.h \
30 31 32 33 34 35 36 37 38 39
	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 \
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
41
	include/medialibrary/IFolder.h \
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
42
	include/medialibrary/IQuery.h \
43
	include/medialibrary/IMetadata.h \
44 45
	$(NULL)

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

54
libmedialibraryparserdir = $(libmedialibrary_ladir)/parser
55 56
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
	src/ShowEpisode.cpp \
	src/VideoTrack.cpp \
82
	src/Metadata.cpp \
83 84 85 86 87
	src/database/SqliteConnection.cpp \
	src/database/SqliteTools.cpp \
	src/database/SqliteTransaction.cpp \
	src/discoverer/DiscovererWorker.cpp \
	src/discoverer/FsDiscoverer.cpp \
88
	src/discoverer/probe/PathProbe.cpp \
89
	src/factory/FileSystemFactory.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 97
	src/logging/IostreamLogger.cpp \
	src/logging/Logger.cpp \
	src/metadata_services/MetadataParser.cpp \
	src/parser/Parser.cpp \
98
	src/parser/ParserWorker.cpp \
99
	src/parser/Task.cpp \
100
	src/utils/Directory.cpp \
101 102
	src/utils/Filename.cpp \
	src/utils/ModificationsNotifier.cpp \
103
	src/utils/Url.cpp \
104 105
	$(NULL)

106

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


173 174 175
if HAVE_WIN32
libmedialibrary_la_SOURCES += \
	src/filesystem/win32/Directory.cpp \
176
	src/filesystem/win32/File.cpp \
177
	src/filesystem/win32/DeviceLister.cpp \
178
	$(NULL)
179 180 181
noinst_HEADERS += \
	src/utils/Charsets.h \
	$(NULL)
182 183 184
else
libmedialibrary_la_SOURCES += \
	src/filesystem/unix/Directory.cpp \
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
185 186
	src/filesystem/unix/File.cpp \
	$(NULL)
187
if HAVE_LINUX
188
if !HAVE_ANDROID
189
libmedialibrary_la_SOURCES += \
190 191
	src/filesystem/unix/DeviceLister.cpp \
	$(NULL)
192
endif
193
endif
194
if HAVE_DARWIN
195
libmedialibrary_macos_la_CPPFLAGS = $(libmedialibrary_la_CPPFLAGS)
196
libmedialibrary_macos_la_SOURCES = \
Soomin Lee's avatar
Soomin Lee committed
197 198
	src/filesystem/darwin/DeviceLister.mm \
	$(NULL)
199
endif
200 201 202 203 204 205
endif

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

206 207 208 209 210 211 212
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


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

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

225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258
if HAVE_LIBVLC
libmedialibrary_la_SOURCES += \
	src/metadata_services/vlc/VLCMetadataService.cpp \
	src/metadata_services/vlc/VLCThumbnailer.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 \
	src/metadata_services/vlc/VLCThumbnailer.h \
	src/metadata_services/vlc/imagecompressors/IImageCompressor.h \
	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


259 260
EXTRA_DIST=

261 262 263 264 265 266 267 268 269 270 271 272 273
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 = \
274
	$(AM_CPPFLAGS) \
275 276
	-I$(top_srcdir)/googletest \
	-I$(top_srcdir)/googletest/include
277

278
libgtestmain_la_CPPFLAGS = $(AM_CPPFLAGS) $(libgtest_la_CPPFLAGS)
279 280 281 282 283 284 285 286 287 288 289 290 291 292 293

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 \
294
	test/unittest/UrlTests.cpp \
295
	test/unittest/GenreTests.cpp \
296
	test/unittest/HistoryTests.cpp \
297 298 299 300 301 302 303 304
	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 \
305
	test/unittest/MiscTests.cpp \
306
	test/unittest/ThumbnailTests.cpp \
307 308
	$(NULL)

309 310
EXTRA_DIST += test/unittest/db_v3.sql

311
unittest_CPPFLAGS = 		\
312
	$(MEDIALIB_CPPFLAGS) 	\
313
	-DSRC_DIR=\"$(abs_srcdir)\"	\
314
	-I$(top_srcdir)/test	\
315
	-I$(top_srcdir)/googletest/include \
316
	$(libmedialibrary_la_CPPFLAGS) \
317 318 319 320 321 322 323 324 325 326 327 328 329 330 331
	$(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)

332
samples_CPPFLAGS = 			\
333
	$(MEDIALIB_CPPFLAGS)	\
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
334
	-DSRC_DIR=\"$(abs_srcdir)\"	\
335
	-I$(top_srcdir)/test	\
336
	-I$(top_srcdir)/googletest/include \
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
337
	$(RAPIDJSON_CFLAGS)		\
338
	$(libmedialibrary_la_CPPFLAGS) \
339 340 341 342 343 344 345 346 347 348 349
	$(NULL)

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

endif

350 351
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = medialibrary.pc
352
EXTRA_DIST += medialibrary.pc \
353
	src/database/migrations/migration3-5.sql \
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
354
	src/database/migrations/migration7-8.sql \
355 356 357 358 359 360 361 362 363 364 365
	src/database/migrations/migration13-14.sql \
	src/database/tables/File_v14.sql \
	src/database/tables/File_triggers_v14.sql \
	src/database/tables/Media_v14.sql \
	src/database/tables/Media_triggers_v14.sql \
	src/database/tables/Folder_v14.sql \
	src/database/tables/Folder_triggers_v14.sql \
	$(NULL)