Makefile.am 8.65 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 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
libmedialibrary_ladir = $(includedir)/medialibrary

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 \
	include/medialibrary/IHistoryEntry.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 \
30
	include/medialibrary/IDeviceLister.h \
31 32
	$(NULL)

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
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 \
	src/History.cpp \
	src/Label.cpp \
	src/Media.cpp \
	src/MediaLibrary.cpp \
	src/Movie.cpp \
	src/Playlist.cpp \
	src/Settings.cpp \
	src/Show.cpp \
	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 \
58
	src/factory/FileSystemFactory.cpp \
59
	src/factory/NetworkFileSystemFactory.cpp \
60
	src/factory/DeviceListerFactory.cpp \
61
	src/filesystem/common/CommonDevice.cpp \
62
	src/filesystem/common/CommonFile.cpp \
63
	src/filesystem/common/CommonDirectory.cpp \
64 65 66
	src/filesystem/network/Directory.cpp \
	src/filesystem/network/File.cpp \
	src/filesystem/network/Device.cpp \
67 68 69 70 71 72 73 74 75 76 77 78
	src/logging/IostreamLogger.cpp \
	src/logging/Logger.cpp \
	src/metadata_services/MetadataParser.cpp \
	src/metadata_services/vlc/VLCMetadataService.cpp \
	src/metadata_services/vlc/VLCThumbnailer.cpp \
	src/parser/Parser.cpp \
	src/parser/ParserService.cpp \
	src/utils/Filename.cpp \
	src/utils/ModificationsNotifier.cpp \
	src/utils/VLCInstance.cpp \
	$(NULL)

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
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 \
	include/medialibrary/IHistoryEntry.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 \
	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 \
117
	src/factory/FileSystemFactory.h \
118
	src/factory/NetworkFileSystemFactory.h \
119
	src/factory/DeviceListerFactory.h \
120 121
	src/File.h \
	src/filesystem/common/CommonFile.h \
122
	src/filesystem/common/CommonDirectory.h \
123
	src/filesystem/common/CommonDevice.h \
124 125 126
	src/filesystem/unix/Device.h \
	src/filesystem/unix/Directory.h \
	src/filesystem/unix/File.h \
127 128 129
	src/filesystem/network/Device.h \
	src/filesystem/network/Directory.h \
	src/filesystem/network/File.h \
130
	src/filesystem/unix/DeviceLister.h \
131 132 133 134 135 136 137 138 139 140 141 142 143
	src/filesystem/win32/Directory.h \
	src/filesystem/win32/File.h \
	src/Folder.h \
	src/Genre.h \
	src/History.h \
	src/Label.h \
	src/logging/IostreamLogger.h \
	src/logging/Logger.h \
	src/Media.h \
	src/MediaLibrary.h \
	src/metadata_services/MetadataParser.h \
	src/metadata_services/vlc/VLCMetadataService.h \
	src/metadata_services/vlc/VLCThumbnailer.h \
144
	src/metadata_services/vlc/imagecompressors/IImageCompressor.h \
145 146 147 148 149 150 151 152 153 154 155 156 157 158
	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 \
	src/utils/Cache.h \
	src/utils/Filename.h \
	src/utils/ModificationsNotifier.h \
	src/utils/SWMRLock.h \
	src/utils/VLCInstance.h \
	src/VideoTrack.h \
159
	src/compat/Thread.h \
160
	src/compat/Mutex.h \
161
	src/compat/ConditionVariable.h \
162 163 164
	$(NULL)


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

libmedialibrary_la_CPPFLAGS = \
	$(MEDIALIB_CPPFLAGS) \
	$(SQLITE_CFLAGS) \
	$(VLC_CFLAGS) \
	$(VLCPP_CFLAGS) \
	$(NULL)

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

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


214 215 216 217 218 219 220 221 222 223 224 225
if HAVE_EVAS
libmedialibrary_la_SOURCES += src/metadata_services/vlc/imagecompressors/EvasCompressor.cpp
noinst_HEADERS += src/metadata_services/vlc/imagecompressors/EvasCompressor.h
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

226
lib_LTLIBRARIES = libmedialibrary.la
227 228 229
if HAVE_DARWIN
lib_LTLIBRARIES += libmedialibrary_macos.la
endif
230 231 232 233 234 235 236 237 238 239 240 241 242 243

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 = \
244 245
	-I$(top_srcdir)/googletest \
	-I$(top_srcdir)/googletest/include
246 247 248 249 250 251 252 253 254 255 256 257 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 \
	test/unittest/GenreTests.cpp \
	test/unittest/HistoryTests.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 \
	$(NULL)

285
unittest_CPPFLAGS = 		\
286 287
	$(MEDIALIB_CPPFLAGS) 	\
	-I$(top_srcdir)/test	\
288
	-I$(top_srcdir)/googletest/include \
289
	$(SQLITE_CFLAGS) 		\
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305
	$(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)

306
samples_CPPFLAGS = 			\
307 308 309
	$(MEDIALIB_CPPFLAGS)	\
	-DSRC_DIR=\"$(top_srcdir)\"	\
	-I$(top_srcdir)/test	\
310
	-I$(top_srcdir)/googletest/include \
311
	$(SQLITE_CFLAGS)		\
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
312
	$(RAPIDJSON_CFLAGS)		\
313 314 315 316 317 318 319 320 321 322 323 324
	$(NULL)

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

endif

325 326 327
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = medialibrary.pc
EXTRA_DIST = medialibrary.pc