Makefile.am 9.51 KB
Newer Older
1 2 3 4
ACLOCAL_AMFLAGS = -I m4

AM_CPPFLAGS = -Wall -Wsign-compare -Wextra -Wstrict-aliasing -Wstrict-overflow \
			  -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 13 14 15 16 17 18 19
libmedialibrary_la_CPPFLAGS = \
	$(MEDIALIB_CPPFLAGS) \
	$(SQLITE_CFLAGS) \
	$(VLC_CFLAGS) \
	$(VLCPP_CFLAGS) \
	-fvisibility=default \
	$(NULL)

20 21 22 23 24 25 26
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 \
27
	include/medialibrary/IHistoryEntry.h \
28 29 30 31 32 33 34 35 36 37
	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 \
38
	include/medialibrary/IDeviceLister.h \
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
39
	include/medialibrary/IFolder.h \
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
40
	include/medialibrary/IQuery.h \
41 42
	$(NULL)

43 44 45 46 47 48 49 50 51 52
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 \
53
	src/History.cpp \
54 55 56 57 58 59 60
	src/Label.cpp \
	src/Media.cpp \
	src/MediaLibrary.cpp \
	src/Movie.cpp \
	src/Playlist.cpp \
	src/Settings.cpp \
	src/Show.cpp \
61
	src/Thumbnail.cpp \
62 63 64 65 66 67 68
	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 \
69
	src/discoverer/probe/PathProbe.cpp \
70
	src/factory/FileSystemFactory.cpp \
71
	src/factory/NetworkFileSystemFactory.cpp \
72
	src/factory/DeviceListerFactory.cpp \
73
	src/filesystem/common/CommonDevice.cpp \
74
	src/filesystem/common/CommonFile.cpp \
75
	src/filesystem/common/CommonDirectory.cpp \
76 77 78
	src/filesystem/network/Directory.cpp \
	src/filesystem/network/File.cpp \
	src/filesystem/network/Device.cpp \
79 80 81
	src/logging/IostreamLogger.cpp \
	src/logging/Logger.cpp \
	src/metadata_services/MetadataParser.cpp \
82
	src/metadata_services/vlc/Common.cpp \
83 84 85 86
	src/metadata_services/vlc/VLCMetadataService.cpp \
	src/metadata_services/vlc/VLCThumbnailer.cpp \
	src/parser/Parser.cpp \
	src/parser/ParserService.cpp \
87
	src/parser/Task.cpp \
88
	src/utils/Directory.cpp \
89 90
	src/utils/Filename.cpp \
	src/utils/ModificationsNotifier.cpp \
91
	src/utils/Url.cpp \
92 93 94
	src/utils/VLCInstance.cpp \
	$(NULL)

95 96 97 98 99 100 101 102 103 104 105 106 107
noinst_HEADERS = \
	include/discoverer/IDiscoverer.h \
	include/factory/IFileSystem.h \
	include/filesystem/IDevice.h \
	include/filesystem/IDirectory.h \
	include/filesystem/IFile.h \
	include/Fixup.h \
	include/medialibrary/IAlbum.h \
	include/medialibrary/IAlbumTrack.h \
	include/medialibrary/IArtist.h \
	include/medialibrary/IAudioTrack.h \
	include/medialibrary/IFile.h \
	include/medialibrary/IGenre.h \
108
	include/medialibrary/IHistoryEntry.h \
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
	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 \
	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 \
	src/database/SqliteTools.h \
	src/database/SqliteTraits.h \
	src/database/SqliteTransaction.h \
	src/Device.h \
	src/discoverer/DiscovererWorker.h \
	src/discoverer/FsDiscoverer.h \
133 134 135
	src/discoverer/probe/CrawlerProbe.h \
	src/discoverer/probe/IProbe.h \
	src/discoverer/probe/PathProbe.h \
136
	src/factory/FileSystemFactory.h \
137
	src/factory/NetworkFileSystemFactory.h \
138
	src/factory/DeviceListerFactory.h \
139 140
	src/File.h \
	src/filesystem/common/CommonFile.h \
141
	src/filesystem/common/CommonDirectory.h \
142
	src/filesystem/common/CommonDevice.h \
Soomin Lee's avatar
Soomin Lee committed
143
	src/filesystem/darwin/DeviceLister.h \
144 145 146
	src/filesystem/unix/Device.h \
	src/filesystem/unix/Directory.h \
	src/filesystem/unix/File.h \
147 148 149
	src/filesystem/network/Device.h \
	src/filesystem/network/Directory.h \
	src/filesystem/network/File.h \
150
	src/filesystem/unix/DeviceLister.h \
151 152 153 154
	src/filesystem/win32/Directory.h \
	src/filesystem/win32/File.h \
	src/Folder.h \
	src/Genre.h \
155
	src/History.h \
156 157 158 159 160 161
	src/Label.h \
	src/logging/IostreamLogger.h \
	src/logging/Logger.h \
	src/Media.h \
	src/MediaLibrary.h \
	src/metadata_services/MetadataParser.h \
162
	src/metadata_services/vlc/Common.hpp \
163 164
	src/metadata_services/vlc/VLCMetadataService.h \
	src/metadata_services/vlc/VLCThumbnailer.h \
165
	src/metadata_services/vlc/imagecompressors/IImageCompressor.h \
166 167 168 169 170 171 172 173
	src/Movie.h \
	src/parser/Parser.h \
	src/parser/ParserService.h \
	src/parser/Task.h \
	src/Playlist.h \
	src/Settings.h \
	src/ShowEpisode.h \
	src/Show.h \
174
	src/Thumbnail.h \
175
	src/utils/Cache.h \
176
	src/utils/Directory.h \
177 178 179
	src/utils/Filename.h \
	src/utils/ModificationsNotifier.h \
	src/utils/SWMRLock.h \
180
	src/utils/Url.h \
181 182
	src/utils/VLCInstance.h \
	src/VideoTrack.h \
183
	src/compat/Thread.h \
184
	src/compat/Mutex.h \
185
	src/compat/ConditionVariable.h \
186 187 188
	$(NULL)


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

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

223 224 225 226 227 228 229
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


230 231 232
if HAVE_EVAS
libmedialibrary_la_SOURCES += src/metadata_services/vlc/imagecompressors/EvasCompressor.cpp
noinst_HEADERS += src/metadata_services/vlc/imagecompressors/EvasCompressor.h
233
libmedialibrary_la_CPPFLAGS += $(EVAS_CFLAGS)
234 235 236 237 238 239 240 241 242
else
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
endif

243
lib_LTLIBRARIES = libmedialibrary.la
244 245 246
if HAVE_DARWIN
lib_LTLIBRARIES += libmedialibrary_macos.la
endif
247

248 249
EXTRA_DIST=

250 251 252 253 254 255 256 257 258 259 260 261 262
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 = \
263 264
	-I$(top_srcdir)/googletest \
	-I$(top_srcdir)/googletest/include
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291

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

307 308
EXTRA_DIST += test/unittest/db_v3.sql

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

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

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

endif

354 355
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = medialibrary.pc
356
EXTRA_DIST += medialibrary.pc \
357
	src/database/migrations/migration3-5.sql \
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
358 359
	src/database/migrations/migration7-8.sql \
	src/database/migrations/migration13-14.sql