[amarok] /: Biggie: introduce libamarokshared.so library to avoid building things in shared/ twice

Matěj Laitl matej at laitl.cz
Mon Mar 4 15:52:35 UTC 2013


Git commit 6f9edfd86a8982bcf1d34dbd8f218b25851214f9 by Matěj Laitl.
Committed on 25/02/2013 at 01:43.
Pushed by laitl into branch 'master'.

Biggie: introduce libamarokshared.so library to avoid building things in shared/ twice

Shared libraries exist to *cough* share built code, use them! This is first part
of much larger buildsystem changes planned in Randa 2012.

This also brings some other changes that were needed, namely avoiding UTILITIES_BUILD.
>From changes to top-level CMakeLists.txt it may look as if kdelibs are now needed even
when just utilities (not player) are built. This was however the case for at least a
year now. To be able to build utilities w/put kdelibs we'd need:
 a) require newer CMake to do automoc for us
 b) replace KDE's KMimeType by Qt5's QMimeDatabase

Static member s_fileTypeStrings of FileTypeSupport is not used outside
the FileType.cpp -> make it a plain static compilation unit variable to
prevent problems with static variables shared across multiple shared
libraries.

@Patrick: this needs at least build testing on Windows to ensure I've done the
KDE_IMPORT/EXPORT macros right.

CCMAIL: amarok-devel at kde.org
CCMAIL: Patrick von Reth <vonreth at kde.org>

M  +40   -35   CMakeLists.txt
A  +60   -0    shared/CMakeLists.txt
M  +1    -1    shared/FileType.cpp
M  +3    -4    shared/FileType.h
M  +2    -6    shared/MetaReplayGain.h
M  +0    -14   shared/MetaTagLib.cpp
M  +8    -16   shared/MetaTagLib.h
M  +1    -1    shared/README
M  +3    -8    shared/TagsFromFileNameGuesser.h
C  +15   -23   shared/amarokshared_export.h [from: src/core-impl/collections/support/jobs/WriteTagsJob.cpp - 066% similarity]
M  +1    -0    shared/collectionscanner/Album.cpp
M  +4    -9    shared/collectionscanner/Album.h
M  +3    -7    shared/collectionscanner/BatchFile.h
M  +2    -3    shared/collectionscanner/Directory.cpp
M  +5    -14   shared/collectionscanner/Directory.h
M  +3    -7    shared/collectionscanner/Playlist.h
M  +3    -7    shared/collectionscanner/ScanningState.h
M  +5    -10   shared/collectionscanner/Track.h
M  +1    -1    shared/tag_helpers/APETagHelper.h
M  +4    -8    shared/tag_helpers/ASFTagHelper.cpp
M  +1    -3    shared/tag_helpers/ASFTagHelper.h
M  +5    -8    shared/tag_helpers/ID3v2TagHelper.cpp
M  +1    -3    shared/tag_helpers/ID3v2TagHelper.h
M  +3    -6    shared/tag_helpers/MP4TagHelper.cpp
M  +1    -3    shared/tag_helpers/MP4TagHelper.h
M  +6    -11   shared/tag_helpers/StringHelper.h
M  +1    -2    shared/tag_helpers/TagHelper.cpp
M  +5    -11   shared/tag_helpers/TagHelper.h
M  +3    -14   shared/tag_helpers/VorbisCommentTagHelper.cpp
M  +1    -3    shared/tag_helpers/VorbisCommentTagHelper.h
M  +1    -31   src/CMakeLists.txt
M  +1    -0    src/core-impl/collections/db/sql/CMakeLists.txt
M  +1    -0    src/core-impl/collections/ipodcollection/CMakeLists.txt
M  +1    -0    src/core-impl/collections/support/jobs/WriteTagsJob.cpp
M  +1    -0    src/core-impl/collections/umscollection/CMakeLists.txt
M  +1    -0    src/core-impl/collections/umscollection/UmsCollection.cpp
M  +1    -0    tests/core-impl/collections/db/sql/CMakeLists.txt
M  +4    -47   utilities/collectionscanner/CMakeLists.txt
M  +2    -1    utilities/collectionscanner/CollectionScanner.cpp
M  +0    -8    utilities/collectionscanner/CollectionScanner.h

http://commits.kde.org/amarok/6f9edfd86a8982bcf1d34dbd8f218b25851214f9

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d96cbc9..d167577 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -84,25 +84,54 @@ endif (CMAKE_COMPILER_IS_GNUCXX)
 
 include_directories(
     ${CMAKE_CURRENT_SOURCE_DIR}/shared
-    ${CMAKE_CURRENT_BINARY_DIR}/shared )
+    ${CMAKE_CURRENT_BINARY_DIR}/shared
+)
 
-set(QT_MIN_VERSION "4.8.0")
-if( WITH_PLAYER )
-    set(KDE_MIN_VERSION "4.8.4")
-    find_package( KDE4 REQUIRED ) # honors QT_MIN_VERSION
-    include (KDE4Defaults)
-    include (MacroLibrary)
+set( QT_MIN_VERSION "4.8.0" )
+set( KDE_MIN_VERSION "4.8.4" )
+find_package( KDE4 REQUIRED ) # honors QT_MIN_VERSION
+include( KDE4Defaults )
+include( MacroBoolTo01 )
+include( MacroLibrary )
+add_definitions( ${QT_DEFINITIONS} ${KDE4_DEFINITIONS} )
+
+# QCA2 is required for the Script Updater
+find_package( QCA2 )
+
+find_package( QtScriptQtBindings )
+
+macro_optional_find_package( LibLastFm )
+set( LIBLASTFM_MIN_VERSION "1.0.0" )
+if( LIBLASTFM_FOUND )
+    macro_ensure_version( ${LIBLASTFM_MIN_VERSION} ${LIBLASTFM_VERSION} LIBLASTFM_FOUND )
+endif( LIBLASTFM_FOUND )
+macro_bool_to_01( LIBLASTFM_FOUND HAVE_LIBLASTFM )
+
+macro_optional_find_package( FFmpeg )
+
+if( FFMPEG_FOUND )
+    macro_optional_find_package( LibOFA )
+    macro_bool_to_01( LIBOFA_FOUND HAVE_LIBOFA )
+endif( FFMPEG_FOUND )
+
+string( TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_TOLOWER )
+if( CMAKE_BUILD_TYPE_TOLOWER MATCHES debug )
+    set( DEBUG_BUILD_TYPE ON )
+endif( CMAKE_BUILD_TYPE_TOLOWER MATCHES debug )
 
-    include(MacroBoolTo01)
+# this needs to be here because also code in shared/ needs config.h. This is also the
+# reason why various checks are above why they belong under if( WITH_PLAYER )
+configure_file( shared/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/shared/config.h )
+
+add_subdirectory( shared )
+
+if( WITH_PLAYER )
     include(MacroLogFeature)
 
     macro_log_feature( KDE4_FOUND "kdelibs" "The toolkit Amarok uses to build" "http://www.kde.org" TRUE ${KDE_MIN_VERSION} "" )
 
-    find_package( QtScriptQtBindings )
     macro_log_feature( QTSCRIPTQTBINDINGS_FOUND "qtscript-qt" "QtScript Qt Bindings" "http://code.google.com/p/qtscriptgenerator/" FALSE "" "" )
 
-    add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
-
     find_package(MySQLAmarok REQUIRED)
     if( WITH_MYSQL_EMBEDDED )
         set( BUILD_MYSQLE_COLLECTION TRUE )
@@ -116,37 +145,23 @@ if( WITH_PLAYER )
     find_package(ZLIB REQUIRED)
     macro_log_feature( ZLIB_FOUND "zlib" "zlib" "" TRUE "" "" )
 
-    # QCA2 is required for the Script Updater
-    find_package(QCA2)
     macro_log_feature( QCA2_FOUND "qca2" "Qt Cryptographic Architecture" "http://delta.affinix.com/qca/" FALSE "" "" )
 
     # QJson is required for the PlaydarCollection
     macro_optional_find_package(QJSON)
     macro_log_feature( QJSON_FOUND "QJson" "Qt JSON Parser used for the Playdar Collection" "http://qjson.sourceforge.net/" FALSE "" "" )
 
-    # macro_optional_find_package(Strigi)
-    # macro_log_feature( STRIGI_FOUND "strigi" "Index metadata of files" "http://strigi.sourceforge.net" FALSE "" "" )
-
-    macro_optional_find_package(LibLastFm)
-    set( LIBLASTFM_MIN_VERSION "1.0.0" )
-    if( LIBLASTFM_FOUND )
-        macro_ensure_version( ${LIBLASTFM_MIN_VERSION} ${LIBLASTFM_VERSION} LIBLASTFM_FOUND )
-    endif( LIBLASTFM_FOUND )
     # We tell users that we need 1.0.3, but we really check just >= 1.0.0. This is because
     # upstream forgot to update version in lastfm/global.h, so it looks like 1.0.2. :-(
     # will be fixed in liblastfm-1.0.4
     set( LIBLASTFM_MIN_VERSION "1.0.3" )
     macro_log_feature( LIBLASTFM_FOUND "liblastfm" "Enable Last.Fm service, including scrobbling, song submissions, and suggested song dynamic playlists"
                        "http://cdn.last.fm/client/liblastfm-${LIBLASTFM_MIN_VERSION}.tar.gz" FALSE ${LIBLASTFM_MIN_VERSION} "" )
-    macro_bool_to_01( LIBLASTFM_FOUND HAVE_LIBLASTFM )
 
-    macro_optional_find_package( FFmpeg )
     macro_log_feature( FFMPEG_FOUND "ffmpeg" "Libraries and tools for handling multimedia data" "http://www.ffmpeg.org/" FALSE "0.7" "" )
 
     if( FFMPEG_FOUND )
-        macro_optional_find_package(LibOFA)
         macro_log_feature( LIBOFA_FOUND "libofa" "Enable MusicDNS service" "http://code.google.com/p/musicip-libofa/" FALSE "0.9.x" "" )
-        macro_bool_to_01( LIBOFA_FOUND HAVE_LIBOFA )
     endif( FFMPEG_FOUND )
 
     ##gpodder Service
@@ -201,13 +216,6 @@ if( WITH_PLAYER )
     find_program( CLAMZ_FOUND clamz PATH )
     macro_log_feature( CLAMZ_FOUND "clamz" "Optional requirement to download songs from the Amazon MP3 store. Highly recommended on Linux, as the official downloader from Amazon is quite broken on many systems." "https://code.google.com/p/clamz/" FALSE )
 
-    string( TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_TOLOWER )
-    if( CMAKE_BUILD_TYPE_TOLOWER MATCHES debug )
-        set( DEBUG_BUILD_TYPE ON )
-    endif( CMAKE_BUILD_TYPE_TOLOWER MATCHES debug )
-
-    configure_file( shared/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/shared/config.h )
-
     include_directories( ${KDE4_INCLUDES} )
 
     if( KDE4_BUILD_TESTS AND NOT WIN32 )
@@ -230,9 +238,6 @@ if( WITH_PLAYER )
     #PO_SUBDIR
     #DOC_SUBDIR
 
-else( WITH_PLAYER )
-    find_package( Qt4 REQUIRED ) # honors QT_MIN_VERSION
-    add_definitions(${QT_DEFINITIONS})
 endif( WITH_PLAYER )
 
 if( WITH_UTILITIES )
diff --git a/shared/CMakeLists.txt b/shared/CMakeLists.txt
new file mode 100644
index 0000000..da47b5e
--- /dev/null
+++ b/shared/CMakeLists.txt
@@ -0,0 +1,60 @@
+include_directories(
+    ${KDE4_INCLUDES}
+)
+
+set( amarokshared_SRCS
+    FileType.cpp
+    MetaTagLib.cpp
+    TagsFromFileNameGuesser.cpp
+)
+if( TAGLIB_FOUND )
+    set( amarokshared_SRCS
+        ${amarokshared_SRCS}
+        FileTypeResolver.cpp
+        MetaReplayGain.cpp
+    )
+endif( TAGLIB_FOUND )
+
+set( amarokshared_collectionscanner_SRCS
+    collectionscanner/Album.cpp
+    collectionscanner/BatchFile.cpp
+    collectionscanner/Directory.cpp
+    collectionscanner/Playlist.cpp
+    collectionscanner/ScanningState.cpp
+    collectionscanner/Track.cpp
+)
+
+if( TAGLIB_FOUND )
+    set( amarokshared_tag_helpers_SRCS
+        tag_helpers/APETagHelper.cpp
+        tag_helpers/ASFTagHelper.cpp
+        tag_helpers/ID3v2TagHelper.cpp
+        tag_helpers/MP4TagHelper.cpp
+        tag_helpers/StringHelper.cpp
+        tag_helpers/TagHelper.cpp
+        tag_helpers/VorbisCommentTagHelper.cpp
+    )
+endif( TAGLIB_FOUND )
+
+kde4_add_library( amarokshared SHARED ${amarokshared_SRCS}
+    ${amarokshared_collectionscanner_SRCS} ${amarokshared_tag_helpers_SRCS} )
+
+if( TAGLIB_FOUND )
+    include_directories( ${TAGLIB_INCLUDES} )
+    add_definitions( ${TAGLIB_CFLAGS} )
+    target_link_libraries( amarokshared ${TAGLIB_LIBRARIES} )
+endif( TAGLIB_FOUND )
+if( TAGLIB-EXTRAS_FOUND )
+    include_directories( ${TAGLIB-EXTRAS_INCLUDES} )
+    add_definitions( ${TAGLIB-EXTRAS_CFLAGS} )
+    target_link_libraries( amarokshared ${TAGLIB-EXTRAS_LIBRARIES} )
+endif( TAGLIB-EXTRAS_FOUND )
+
+target_link_libraries( amarokshared
+    ${QT_QTCORE_LIBRARY}
+    ${QT_QTGUI_LIBRARY} # for QImage, ...
+    ${KDE4_KDECORE_LIBRARY} # for KMimeType, ...
+)
+
+set_target_properties( amarokshared PROPERTIES VERSION 1.0.0 SOVERSION 1 )
+install( TARGETS amarokshared ${INSTALL_TARGETS_DEFAULT_ARGS} )
diff --git a/shared/FileType.cpp b/shared/FileType.cpp
index eed96c2..460b8c1 100644
--- a/shared/FileType.cpp
+++ b/shared/FileType.cpp
@@ -19,7 +19,7 @@
 
 using namespace Amarok;
 
-QStringList FileTypeSupport::s_fileTypeStrings = QStringList()
+static QStringList s_fileTypeStrings = QStringList()
         << QLatin1String( "" )
         << QLatin1String( "mp3" )
         << QLatin1String( "ogg" )
diff --git a/shared/FileType.h b/shared/FileType.h
index f4f7254..136a62c 100644
--- a/shared/FileType.h
+++ b/shared/FileType.h
@@ -19,6 +19,8 @@
 #ifndef SHARED_FILETYPE_H
 #define SHARED_FILETYPE_H
 
+#include "amarokshared_export.h"
+
 #include <QStringList>
 #include <QString>
 
@@ -48,7 +50,7 @@ namespace Amarok
         Opus        = 18
     };
 
-    class FileTypeSupport
+    class AMAROKSHARED_EXPORT FileTypeSupport
     {
         public:
             /**
@@ -72,9 +74,6 @@ namespace Amarok
              *         type is in the enum
              */
             static Amarok::FileType fileType( const QString& extension );
-
-        private:
-            static QStringList s_fileTypeStrings;
     };
 }
 
diff --git a/shared/MetaReplayGain.h b/shared/MetaReplayGain.h
index bf130cf..f126d7c 100644
--- a/shared/MetaReplayGain.h
+++ b/shared/MetaReplayGain.h
@@ -17,6 +17,7 @@
 #ifndef AMAROK_METAREPLAYGAIN_H
 #define AMAROK_METAREPLAYGAIN_H
 
+#include "amarokshared_export.h"
 
 #include <QMap>
 
@@ -43,12 +44,7 @@ namespace Meta
     /**
      * Reads the replay gain tags from a taglib file.
      */
-#ifndef UTILITIES_BUILD
-#include "amarok_export.h"
-    AMAROK_EXPORT ReplayGainTagMap readReplayGainTags( const TagLib::FileRef &fileref );
-#else
-    ReplayGainTagMap readReplayGainTags( const TagLib::FileRef &fileref );
-#endif
+    AMAROKSHARED_EXPORT ReplayGainTagMap readReplayGainTags( const TagLib::FileRef &fileref );
 }
 
 #endif // AMAROK_METAREPLAYGAIN_H
diff --git a/shared/MetaTagLib.cpp b/shared/MetaTagLib.cpp
index a2125d2..f0fbf76 100644
--- a/shared/MetaTagLib.cpp
+++ b/shared/MetaTagLib.cpp
@@ -29,10 +29,6 @@
 #include "TagsFromFileNameGuesser.h"
 #include "config.h"
 
-#ifndef UTILITIES_BUILD
-#include "amarokconfig.h"
-#endif
-
 #include <KEncodingProber>
 
 #include <QImage>
@@ -284,9 +280,6 @@ Meta::Tag::readTags( const QString &path, bool /*useCharsetDetector*/ )
     return result;
 }
 
-#ifndef UTILITIES_BUILD
-// the utilities don't need to handle images
-
 QImage
 Meta::Tag::embeddedCover( const QString &path )
 {
@@ -314,8 +307,6 @@ Meta::Tag::embeddedCover( const QString &path )
 #endif
 }
 
-#endif
-
 void
 Meta::Tag::writeTags( const QString &path, const FieldHash &changes, bool writeStatistics )
 {
@@ -350,8 +341,6 @@ Meta::Tag::writeTags( const QString &path, const FieldHash &changes, bool writeS
 #endif
 }
 
-#ifndef UTILITIES_BUILD
-
 void
 Meta::Tag::setEmbeddedCover( const QString &path, const QImage &cover )
 {
@@ -379,7 +368,4 @@ Meta::Tag::setEmbeddedCover( const QString &path, const QImage &cover )
 #endif
 }
 
-#endif
-
 #undef Qt4QStringToTString
-
diff --git a/shared/MetaTagLib.h b/shared/MetaTagLib.h
index fb0184a..2de3be2 100644
--- a/shared/MetaTagLib.h
+++ b/shared/MetaTagLib.h
@@ -17,14 +17,9 @@
 #ifndef AMAROK_METATAGLIB_H
 #define AMAROK_METATAGLIB_H
 
-#ifndef UTILITIES_BUILD
-    #include "amarok_export.h"
-    #include <QImage>
-#else
-    #define AMAROK_EXPORT
-#endif
-
 #include "MetaValues.h"
+#include "amarokshared_export.h"
+
 #include <QString>
 
 /* This file exists because we need to share the implementation between
@@ -34,8 +29,7 @@ namespace Meta
 {
     namespace Tag
     {
-
-        AMAROK_EXPORT Meta::FieldHash readTags( const QString &path, bool useCharsetDetector = true );
+        AMAROKSHARED_EXPORT Meta::FieldHash readTags( const QString &path, bool useCharsetDetector = true );
 
         /**
          * Writes tags stored in @param changes back to file. Respects
@@ -52,13 +46,12 @@ namespace Meta
          *
          * @see WriteTagsJob
          */
-        AMAROK_EXPORT void writeTags( const QString &path,
-                                      const Meta::FieldHash &changes,
-                                      bool writeStatistics );
+        AMAROKSHARED_EXPORT void writeTags( const QString &path,
+                                            const Meta::FieldHash &changes,
+                                            bool writeStatistics );
 
-#ifndef UTILITIES_BUILD
         // the utilities don't need to handle images
-        AMAROK_EXPORT QImage embeddedCover( const QString &path );
+        AMAROKSHARED_EXPORT QImage embeddedCover( const QString &path );
 
         /**
          * Writes embedded cover back to file. Overwrites any possible existing covers.
@@ -69,8 +62,7 @@ namespace Meta
          *
          * @see WriteTagsJob
          */
-        AMAROK_EXPORT void setEmbeddedCover( const QString &path, const QImage &cover );
-#endif
+        AMAROKSHARED_EXPORT void setEmbeddedCover( const QString &path, const QImage &cover );
     }
 }
 
diff --git a/shared/README b/shared/README
index 3d84f0d..6df6f11 100644
--- a/shared/README
+++ b/shared/README
@@ -1 +1 @@
-This directory contains code shared between both the utilities and the player and should be included in the source tree of both.
+This directory contains code shared between both the utilities and the player.
diff --git a/shared/TagsFromFileNameGuesser.h b/shared/TagsFromFileNameGuesser.h
index 7f4443e..0aa94c5 100644
--- a/shared/TagsFromFileNameGuesser.h
+++ b/shared/TagsFromFileNameGuesser.h
@@ -18,12 +18,7 @@
 #ifndef TAGSFROMFILENAMEGUESSER_H
 #define TAGSFROMFILENAMEGUESSER_H
 
-#ifndef UTILITIES_BUILD
-    #include "amarok_export.h"
-#else
-    #define AMAROK_EXPORT
-#endif
-
+#include "amarokshared_export.h"
 #include "MetaValues.h"
 
 namespace Meta
@@ -39,7 +34,7 @@ namespace Meta
             * truckated.
             * @returns guessed metadata.
             */
-            AMAROK_EXPORT Meta::FieldHash guessTags( const QString &fileName );
+            AMAROKSHARED_EXPORT Meta::FieldHash guessTags( const QString &fileName );
 
             /**
             * Try to guess metadata from fil name,using specified scheme.
@@ -50,7 +45,7 @@ namespace Meta
             * @arg isRegExp - if true - prevents guesser from screening special symbols
             * Available Tokens: %album%, %albumartist%, %artist%, %title%, %track%.
             */
-            AMAROK_EXPORT Meta::FieldHash guessTagsByScheme( const QString &fileName,
+            AMAROKSHARED_EXPORT Meta::FieldHash guessTagsByScheme( const QString &fileName,
                                                              const QString &scheme,
                                                              bool cutTrailingSpaces = true,
                                                              bool convertUnderscores = true,
diff --git a/src/core-impl/collections/support/jobs/WriteTagsJob.cpp b/shared/amarokshared_export.h
similarity index 66%
copy from src/core-impl/collections/support/jobs/WriteTagsJob.cpp
copy to shared/amarokshared_export.h
index 3749336..3825061 100644
--- a/src/core-impl/collections/support/jobs/WriteTagsJob.cpp
+++ b/shared/amarokshared_export.h
@@ -1,5 +1,5 @@
 /****************************************************************************************
- * Copyright (c) 2012 Matěj Laitl <matej at laitl.cz>                                      *
+ * Copyright (c) 2013 Matěj Laitl <matej at laitl.cz>                                      *
  *                                                                                      *
  * This program is free software; you can redistribute it and/or modify it under        *
  * the terms of the GNU General Public License as published by the Free Software        *
@@ -14,28 +14,20 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
  ****************************************************************************************/
 
-#include "WriteTagsJob.h"
+#ifndef AMAROKSHARED_EXPORT_H
+#define AMAROKSHARED_EXPORT_H
 
-#include "amarokconfig.h"
-#include "MetaTagLib.h"
+/* needed for KDE_EXPORT and KDE_IMPORT macros */
+#include <kdemacros.h>
 
+#ifndef AMAROKSHARED_EXPORT
+# ifdef MAKE_AMAROKSHARED_LIB
+   /* We are building this library */
+#  define AMAROKSHARED_EXPORT KDE_EXPORT
+# else
+   /* We are using this library */
+#  define AMAROKSHARED_EXPORT KDE_IMPORT
+# endif
+#endif // AMAROKSHARED_EXPORT
 
-WriteTagsJob::WriteTagsJob(const QString& path, const Meta::FieldHash& changes)
-    : Job()
-    , m_path( path )
-    , m_changes( changes )
-{
-}
-
-void WriteTagsJob::run()
-{
-    if( !AmarokConfig::writeBack() )
-        return;
-
-    Meta::Tag::writeTags( m_path, m_changes, AmarokConfig::writeBackStatistics() );
-
-    if( m_changes.contains( Meta::valImage ) && AmarokConfig::writeBackCover() )
-        Meta::Tag::setEmbeddedCover( m_path, m_changes.value( Meta::valImage ).value<QImage>() );
-}
-
-#include "WriteTagsJob.moc"
+#endif // AMAROKSHARED_EXPORT_H
diff --git a/shared/collectionscanner/Album.cpp b/shared/collectionscanner/Album.cpp
index bb30c00..f03faba 100644
--- a/shared/collectionscanner/Album.cpp
+++ b/shared/collectionscanner/Album.cpp
@@ -18,6 +18,7 @@
  ***************************************************************************/
 
 #include "Album.h"
+
 #include "Track.h"
 
 #include <QDebug>
diff --git a/shared/collectionscanner/Album.h b/shared/collectionscanner/Album.h
index 21df5dd..4fa32d0 100644
--- a/shared/collectionscanner/Album.h
+++ b/shared/collectionscanner/Album.h
@@ -20,29 +20,24 @@
 #ifndef COLLECTIONSCANNER_ALBUM_H
 #define COLLECTIONSCANNER_ALBUM_H
 
+#include "amarokshared_export.h"
+
 #include <QList>
 #include <QString>
 #include <QStringList>
 #include <QXmlStreamReader>
 #include <QXmlStreamWriter>
 
-#include "Track.h"
-
-#ifndef UTILITIES_BUILD
-    #include "amarok_export.h"
-#else
-    #define AMAROK_EXPORT
-#endif
-
 namespace CollectionScanner
 {
+class Track;
 
 /** This album class is used by the ScanResultProcessor to sort tracks into albums.
     @class Album
     @short Represents a scanned album and it's contents
     @author Ralf Engels <ralf-engels at gmx.de>
 */
-class AMAROK_EXPORT Album
+class AMAROKSHARED_EXPORT Album
 {
 public:
     Album();
diff --git a/shared/collectionscanner/BatchFile.h b/shared/collectionscanner/BatchFile.h
index 6119277..484583e 100644
--- a/shared/collectionscanner/BatchFile.h
+++ b/shared/collectionscanner/BatchFile.h
@@ -20,17 +20,13 @@
 #ifndef COLLECTIONSCANNER_BATCHFILE_H
 #define COLLECTIONSCANNER_BATCHFILE_H
 
+#include "amarokshared_export.h"
+
 #include <QString>
 #include <QStringList>
 #include <QPair>
 #include <QList>
 
-#ifndef UTILITIES_BUILD
-    #include "amarok_export.h"
-#else
-    #define AMAROK_EXPORT
-#endif
-
 namespace CollectionScanner
 {
 
@@ -40,7 +36,7 @@ namespace CollectionScanner
  * @short This class can be used to read and write batch files for the collection scanner.
  */
 
-class AMAROK_EXPORT BatchFile
+class AMAROKSHARED_EXPORT BatchFile
 {
 public:
     /** Constructs and empty BatchFile */
diff --git a/shared/collectionscanner/Directory.cpp b/shared/collectionscanner/Directory.cpp
index a6b02f8..a65884b 100644
--- a/shared/collectionscanner/Directory.cpp
+++ b/shared/collectionscanner/Directory.cpp
@@ -22,9 +22,10 @@
  ***************************************************************************/
 
 #include "Directory.h"
-#include "utils.h"
 
 #include "collectionscanner/ScanningState.h"
+#include "collectionscanner/Track.h"
+#include "collectionscanner/utils.h"
 
 #include <QDebug>
 #include <QString>
@@ -215,7 +216,6 @@ CollectionScanner::Directory::playlists() const
     return m_playlists;
 }
 
-#ifdef UTILITIES_BUILD
 void
 CollectionScanner::Directory::toXml( QXmlStreamWriter *writer ) const
 {
@@ -245,4 +245,3 @@ CollectionScanner::Directory::toXml( QXmlStreamWriter *writer ) const
         writer->writeEndElement();
     }
 }
-#endif // UTILITIES_BUILD
diff --git a/shared/collectionscanner/Directory.h b/shared/collectionscanner/Directory.h
index 03f07ce..395d399 100644
--- a/shared/collectionscanner/Directory.h
+++ b/shared/collectionscanner/Directory.h
@@ -20,23 +20,16 @@
 #ifndef COLLECTIONSCANNER_DIRECTORY_H
 #define COLLECTIONSCANNER_DIRECTORY_H
 
+#include "Album.h"
+#include "Playlist.h"
+#include "amarokshared_export.h"
+
 #include <QString>
 #include <QList>
 #include <QHash>
 #include <QXmlStreamReader>
 #include <QXmlStreamWriter>
 
-#include "Playlist.h"
-#include "Album.h"
-
-#ifndef UTILITIES_BUILD
-    #include "amarok_export.h"
-#else
-    #define AMAROK_EXPORT
-#endif
-
-class QSettings;
-
 namespace CollectionScanner
 {
 
@@ -47,7 +40,7 @@ class ScanningState;
  * @class Directory
  * @short Represents a scanned directory and it's contents
  */
-class AMAROK_EXPORT Directory
+class AMAROKSHARED_EXPORT Directory
 {
 public:
     /**
@@ -84,14 +77,12 @@ public:
     const QList<Track*>& tracks() const;
     const QList<Playlist>& playlists() const;
 
-#ifdef UTILITIES_BUILD
     /** Writes the contents of this object to an xml stream.
      *  Only the content is writen and no enclosing directory tags.
      *  This is done to make it mirror the constructor which does not read those
      *  tags either.
      */
     void toXml( QXmlStreamWriter *writer ) const;
-#endif // UTILITIES_BUILD
 
 private:
     QString m_path;
diff --git a/shared/collectionscanner/Playlist.h b/shared/collectionscanner/Playlist.h
index 420bafc..20613a8 100644
--- a/shared/collectionscanner/Playlist.h
+++ b/shared/collectionscanner/Playlist.h
@@ -20,16 +20,12 @@
 #ifndef COLLECTIONSCANNER_PLAYLIST_H
 #define COLLECTIONSCANNER_PLAYLIST_H
 
+#include "amarokshared_export.h"
+
 #include <QString>
 #include <QXmlStreamReader>
 #include <QXmlStreamWriter>
 
-#ifndef UTILITIES_BUILD
-    #include "amarok_export.h"
-#else
-    #define AMAROK_EXPORT
-#endif
-
 namespace CollectionScanner
 {
 
@@ -38,7 +34,7 @@ namespace CollectionScanner
  * @short Represents a playlist
  */
 
-class AMAROK_EXPORT Playlist
+class AMAROKSHARED_EXPORT Playlist
 {
 public:
     Playlist( const QString &path );
diff --git a/shared/collectionscanner/ScanningState.h b/shared/collectionscanner/ScanningState.h
index dedf049..3d13c7f 100644
--- a/shared/collectionscanner/ScanningState.h
+++ b/shared/collectionscanner/ScanningState.h
@@ -20,16 +20,12 @@
 #ifndef COLLECTIONSCANNER_SCANNINGSTATE_H
 #define COLLECTIONSCANNER_SCANNINGSTATE_H
 
+#include "amarokshared_export.h"
+
 #include <QSharedMemory>
 #include <QString>
 #include <QStringList>
 
-#ifndef UTILITIES_BUILD
-    #include "amarok_export.h"
-#else
-    #define AMAROK_EXPORT
-#endif
-
 namespace CollectionScanner
 {
 
@@ -38,7 +34,7 @@ namespace CollectionScanner
     We are using a shared memory that the amarok process holds open until the scanning
     is finished to store the state.
  */
-class AMAROK_EXPORT ScanningState
+class AMAROKSHARED_EXPORT ScanningState
 {
     public:
         ScanningState();
diff --git a/shared/collectionscanner/Track.h b/shared/collectionscanner/Track.h
index 96d243e..71406a4 100644
--- a/shared/collectionscanner/Track.h
+++ b/shared/collectionscanner/Track.h
@@ -20,20 +20,15 @@
 #ifndef COLLECTIONSCANNER_TRACK_H
 #define COLLECTIONSCANNER_TRACK_H
 
+#include "FileType.h"
+#include "MetaReplayGain.h"
+#include "amarokshared_export.h"
+
 #include <QString>
 #include <QDateTime>
 #include <QXmlStreamReader>
 #include <QXmlStreamWriter>
 
-#include "FileType.h"
-#include "MetaReplayGain.h"
-
-#ifndef UTILITIES_BUILD
-    #include "amarok_export.h"
-#else
-    #define AMAROK_EXPORT
-#endif
-
 namespace CollectionScanner
 {
 
@@ -44,7 +39,7 @@ class Directory;
    @short Represents a scanned track
    An empty QString or a negative int means that the value is unset.
  */
-class AMAROK_EXPORT Track
+class AMAROKSHARED_EXPORT Track
 {
 public:
     /** Reads a track from the given path */
diff --git a/shared/tag_helpers/APETagHelper.h b/shared/tag_helpers/APETagHelper.h
index 2da8734..0147a7a 100644
--- a/shared/tag_helpers/APETagHelper.h
+++ b/shared/tag_helpers/APETagHelper.h
@@ -25,7 +25,7 @@ namespace Meta
 {
     namespace Tag
     {
-        class AMAROK_EXPORT APETagHelper : public TagHelper
+        class AMAROKSHARED_EXPORT APETagHelper : public TagHelper
         {
             public:
                 APETagHelper( TagLib::Tag *tag, TagLib::APE::Tag *apeTag, Amarok::FileType fileType );
diff --git a/shared/tag_helpers/ASFTagHelper.cpp b/shared/tag_helpers/ASFTagHelper.cpp
index 966c298..3439845 100644
--- a/shared/tag_helpers/ASFTagHelper.cpp
+++ b/shared/tag_helpers/ASFTagHelper.cpp
@@ -17,17 +17,15 @@
 
 #include "ASFTagHelper.h"
 
-#include <asfattribute.h>
+#include "StringHelper.h"
 
-#ifndef UTILITIES_BUILD
-    #include <QBuffer>
-#endif  //UTILITIES_BUILD
+#include <QBuffer>
+#include <QImage>
 
-#include "StringHelper.h"
+#include <asfattribute.h>
 
 using namespace Meta::Tag;
 
-
 ASFTagHelper::ASFTagHelper( TagLib::Tag *tag, TagLib::ASF::Tag *asfTag, Amarok::FileType fileType )
             : TagHelper( tag, fileType )
             , m_tag( asfTag )
@@ -143,7 +141,6 @@ ASFTagHelper::setTags( const Meta::FieldHash &changes )
     return modified;
 }
 
-#ifndef UTILITIES_BUILD
 bool
 ASFTagHelper::hasEmbeddedCover() const
 {
@@ -253,4 +250,3 @@ ASFTagHelper::setEmbeddedCover( const QImage &cover )
 
     return true;
 }
-#endif  //UTILITIES_BUILD
diff --git a/shared/tag_helpers/ASFTagHelper.h b/shared/tag_helpers/ASFTagHelper.h
index 9981894..db6afaa 100644
--- a/shared/tag_helpers/ASFTagHelper.h
+++ b/shared/tag_helpers/ASFTagHelper.h
@@ -26,7 +26,7 @@ namespace Meta
 {
     namespace Tag
     {
-        class AMAROK_EXPORT ASFTagHelper : public TagHelper
+        class AMAROKSHARED_EXPORT ASFTagHelper : public TagHelper
         {
             public:
                 ASFTagHelper( TagLib::Tag *tag, TagLib::ASF::Tag *asfTag, Amarok::FileType fileType );
@@ -34,11 +34,9 @@ namespace Meta
                 virtual Meta::FieldHash tags() const;
                 virtual bool setTags( const Meta::FieldHash &changes );
 
-#ifndef UTILITIES_BUILD
                 virtual bool hasEmbeddedCover() const;
                 virtual QImage embeddedCover() const;
                 virtual bool setEmbeddedCover(const QImage &cover);
-#endif  //UTILITIES_BUILD
 
             private:
                 TagLib::ASF::Tag *m_tag;
diff --git a/shared/tag_helpers/ID3v2TagHelper.cpp b/shared/tag_helpers/ID3v2TagHelper.cpp
index 7d50ca6..03a3836 100644
--- a/shared/tag_helpers/ID3v2TagHelper.cpp
+++ b/shared/tag_helpers/ID3v2TagHelper.cpp
@@ -22,17 +22,16 @@
 
 #include "ID3v2TagHelper.h"
 
+#include "StringHelper.h"
+
+#include <QBuffer>
+#include <QImage>
+
 #include <attachedpictureframe.h>
 #include <popularimeterframe.h>
 #include <textidentificationframe.h>
 #include <uniquefileidentifierframe.h>
 
-#ifndef UTILITIES_BUILD
-    #include <QBuffer>
-#endif  //UTILITIES_BUILD
-
-#include "StringHelper.h"
-
 const TagLib::ByteVector TXXX_Frame = "TXXX";
 const TagLib::ByteVector POPM_Frame = "POPM";
 
@@ -321,7 +320,6 @@ ID3v2TagHelper::render() const
     return m_tag->render();
 }
 
-#ifndef UTILITIES_BUILD
 bool
 ID3v2TagHelper::hasEmbeddedCover() const
 {
@@ -416,4 +414,3 @@ ID3v2TagHelper::setEmbeddedCover( const QImage &cover )
 
     return true;
 }
-#endif  //UTILITIES_BUILD
diff --git a/shared/tag_helpers/ID3v2TagHelper.h b/shared/tag_helpers/ID3v2TagHelper.h
index 5aec4ed..a9c9ab9 100644
--- a/shared/tag_helpers/ID3v2TagHelper.h
+++ b/shared/tag_helpers/ID3v2TagHelper.h
@@ -25,7 +25,7 @@ namespace Meta
 {
     namespace Tag
     {
-        class AMAROK_EXPORT ID3v2TagHelper : public TagHelper
+        class AMAROKSHARED_EXPORT ID3v2TagHelper : public TagHelper
         {
             public:
                 ID3v2TagHelper( TagLib::Tag *tag, TagLib::ID3v2::Tag *id3v2Tag, Amarok::FileType fileType );
@@ -35,11 +35,9 @@ namespace Meta
 
                 virtual TagLib::ByteVector render() const;
 
-#ifndef UTILITIES_BUILD
                 virtual bool hasEmbeddedCover() const;
                 virtual QImage embeddedCover() const;
                 virtual bool setEmbeddedCover( const QImage &cover );
-#endif  //UTILITIES_BUILD
 
             private:
                 TagLib::ID3v2::Tag *m_tag;
diff --git a/shared/tag_helpers/MP4TagHelper.cpp b/shared/tag_helpers/MP4TagHelper.cpp
index 37fcc17..23d8879 100644
--- a/shared/tag_helpers/MP4TagHelper.cpp
+++ b/shared/tag_helpers/MP4TagHelper.cpp
@@ -23,12 +23,11 @@
 
 #include "MP4TagHelper.h"
 
-#ifndef UTILITIES_BUILD
-    #include <QBuffer>
-#endif  //UTILITIES_BUILD
-
 #include "StringHelper.h"
 
+#include <QBuffer>
+#include <QImage>
+
 using namespace Meta::Tag;
 
 MP4TagHelper::MP4TagHelper( TagLib::Tag *tag, TagLib::MP4::Tag *mp4Tag, Amarok::FileType fileType )
@@ -138,7 +137,6 @@ MP4TagHelper::setTags( const Meta::FieldHash &changes )
     return modified;
 }
 
-#ifndef UTILITIES_BUILD
 bool
 MP4TagHelper::hasEmbeddedCover() const
 {
@@ -205,4 +203,3 @@ MP4TagHelper::setEmbeddedCover( const QImage &cover )
 
     return true;
 }
-#endif  //UTILITIES_BUILD
diff --git a/shared/tag_helpers/MP4TagHelper.h b/shared/tag_helpers/MP4TagHelper.h
index 8a5b185..31dd5c7 100644
--- a/shared/tag_helpers/MP4TagHelper.h
+++ b/shared/tag_helpers/MP4TagHelper.h
@@ -26,7 +26,7 @@ namespace Meta
 {
     namespace Tag
     {
-        class AMAROK_EXPORT MP4TagHelper : public TagHelper
+        class AMAROKSHARED_EXPORT MP4TagHelper : public TagHelper
         {
             public:
                 MP4TagHelper( TagLib::Tag *tag, TagLib::MP4::Tag *mp4Tag, Amarok::FileType fileType );
@@ -34,11 +34,9 @@ namespace Meta
                 virtual Meta::FieldHash tags() const;
                 virtual bool setTags( const Meta::FieldHash &changes );
 
-#ifndef UTILITIES_BUILD
                 virtual bool hasEmbeddedCover() const;
                 virtual QImage embeddedCover() const;
                 virtual bool setEmbeddedCover( const QImage &cover );
-#endif  //UTILITIES_BUILD
 
             private:
                 TagLib::MP4::Tag *m_tag;
diff --git a/shared/tag_helpers/StringHelper.h b/shared/tag_helpers/StringHelper.h
index 6b31b68..1ca8e10 100644
--- a/shared/tag_helpers/StringHelper.h
+++ b/shared/tag_helpers/StringHelper.h
@@ -17,12 +17,6 @@
 #ifndef STRINGHELPER_H
 #define STRINGHELPER_H
 
-#ifndef UTILITIES_BUILD
-    #include "amarok_export.h"
-#else
-    #define AMAROK_EXPORT
-#endif
-
 #include <QString>
 #include <tstring.h>
 
@@ -41,18 +35,19 @@ namespace Meta
          * Convert TString to QString, trimmes spaces in the begin and at the end
          * and fixes encoding if needed.
          */
-        AMAROK_EXPORT QString TStringToQString( const TagLib::String &str );
+        QString TStringToQString( const TagLib::String &str );
+
         /**
          * Convert QString to TString and trimmes spaces in the begin and at the end.
          */
-        AMAROK_EXPORT TagLib::String Qt4QStringToTString( const QString &str );
+        TagLib::String Qt4QStringToTString( const QString &str );
+
         /**
          * Set codec for TStringToQString conversion.
          */
-        AMAROK_EXPORT void setCodec( QTextCodec *codec );
-        AMAROK_EXPORT void setCodecByName( QByteArray codecName );
+        void setCodec( QTextCodec *codec );
+        void setCodecByName( QByteArray codecName );
     }
 }
 
-
 #endif // STRINGHELPER_H
diff --git a/shared/tag_helpers/TagHelper.cpp b/shared/tag_helpers/TagHelper.cpp
index 6909483..8fbc851 100644
--- a/shared/tag_helpers/TagHelper.cpp
+++ b/shared/tag_helpers/TagHelper.cpp
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <QImage>
 #include <QRegExp>
 #include <QStringList>
 
@@ -137,7 +138,6 @@ TagHelper::render() const
     return TagLib::ByteVector( byteArray.constData(), byteArray.size() );
 }
 
-#ifndef UTILITIES_BUILD
 bool
 TagHelper::hasEmbeddedCover() const
 {
@@ -156,7 +156,6 @@ TagHelper::setEmbeddedCover( const QImage &cover )
     Q_UNUSED( cover )
     return false;
 }
-#endif  //UTILITIES_BUILD
 
 TagLib::String
 TagHelper::fieldName( const qint64 field ) const
diff --git a/shared/tag_helpers/TagHelper.h b/shared/tag_helpers/TagHelper.h
index 898a76b..89a1e0c 100644
--- a/shared/tag_helpers/TagHelper.h
+++ b/shared/tag_helpers/TagHelper.h
@@ -17,17 +17,11 @@
 #ifndef TAGHELPER_H
 #define TAGHELPER_H
 
-#ifndef UTILITIES_BUILD
-    #include "amarok_export.h"
-    #include <QImage>
-#else
-    #define AMAROK_EXPORT
-#endif
-
 #define MIN_COVER_SIZE 1024 // Minimum size for an embedded cover to be loaded
 
 #include "MetaValues.h"
 #include "FileType.h"
+#include "amarokshared_export.h"
 
 #include <fileref.h>
 #include <tag.h>
@@ -37,7 +31,7 @@ namespace Meta
 {
     namespace Tag
     {
-        class AMAROK_EXPORT TagHelper
+        class AMAROKSHARED_EXPORT TagHelper
         {
             public:
                 enum UIDType
@@ -71,21 +65,21 @@ namespace Meta
                  */
                 virtual TagLib::ByteVector render() const;
 
-#ifndef UTILITIES_BUILD
                 /**
                  * Check If file contains embedded cover.
                  */
                 virtual bool hasEmbeddedCover() const;
+
                 /**
                  * Read embedded cover from file.
                  */
                 virtual QImage embeddedCover() const;
+
                 /**
                  * Add or update cover in file. Will be set as FrontCover.
                  * Return true If something writen.
                  */
                 virtual bool setEmbeddedCover( const QImage &cover );
-#endif  //UTILITIES_BUILD
 
                 /**
                  * Return file type.
@@ -146,7 +140,7 @@ namespace Meta
          * @return TagHelper or NULL if file doesn't have tags.
          * Should be deleted by user after use.
          */
-        AMAROK_EXPORT TagHelper *selectHelper( const TagLib::FileRef fileref, bool forceCreation = false );
+        AMAROKSHARED_EXPORT TagHelper *selectHelper( const TagLib::FileRef fileref, bool forceCreation = false );
     }
 }
 
diff --git a/shared/tag_helpers/VorbisCommentTagHelper.cpp b/shared/tag_helpers/VorbisCommentTagHelper.cpp
index 85689fb..8ff52c5 100644
--- a/shared/tag_helpers/VorbisCommentTagHelper.cpp
+++ b/shared/tag_helpers/VorbisCommentTagHelper.cpp
@@ -25,11 +25,10 @@
 
 #include "StringHelper.h"
 
-#include <flacpicture.h>
+#include <QBuffer>
+#include <QImage>
 
-#ifndef UTILITIES_BUILD
-    #include <QBuffer>
-#endif  //UTILITIES_BUILD
+#include <flacpicture.h>
 
 using namespace Meta::Tag;
 
@@ -61,7 +60,6 @@ isAlbumCover( const TagLib::FLAC::Picture* picture )
              picture->data().size() > MIN_COVER_SIZE; // must be at least 1kb
 }
 
-#ifndef UTILITIES_BUILD
 /**
  * Extract the given FLAC Picture object to QImage picture.
  *
@@ -84,7 +82,6 @@ flacPictureToQImage( const TagLib::FLAC::Picture* picture, QImage& cover, QImage
     }
     return false;
 }
-#endif //UTILITIES_BUILD
 
 Meta::FieldHash
 VorbisCommentTagHelper::tags() const
@@ -186,7 +183,6 @@ VorbisCommentTagHelper::render() const
     return m_tag->render();
 }
 
-#ifndef UTILITIES_BUILD
 bool
 VorbisCommentTagHelper::hasEmbeddedCover() const
 {
@@ -326,14 +322,11 @@ VorbisCommentTagHelper::setEmbeddedCover( const QImage &cover )
 
     return false;
 }
-#endif  //UTILITIES_BUILD
 
 bool
 VorbisCommentTagHelper::parsePictureBlock( const TagLib::StringList& block, QImage* result )
 {
-#ifndef UTILITIES_BUILD
     QImage otherCover;
-#endif // UTILITIES_BUILD
     // Here's what's happening: "block" may contain several FLAC picture entries.
     // We need to find at least one that satisfies our needs.
     for( TagLib::StringList::ConstIterator i = block.begin(); i != block.end(); ++i )
@@ -346,7 +339,6 @@ VorbisCommentTagHelper::parsePictureBlock( const TagLib::StringList& block, QIma
             continue;
         if(isAlbumCover(&p))
         {
-#ifndef UTILITIES_BUILD
             if( result )
             {
                 // Now, if the image is a front cover, we just use it and quit
@@ -355,12 +347,10 @@ VorbisCommentTagHelper::parsePictureBlock( const TagLib::StringList& block, QIma
                     return true;
             }
             else
-#endif // UTILITIES_BUILD
                 // We found some image, but we don't need best one here, so just leave
                 return true;
         }
     }
-#ifndef UTILITIES_BUILD
     if(result)
     {
         // Now here we haven't found any front covers in the file
@@ -368,6 +358,5 @@ VorbisCommentTagHelper::parsePictureBlock( const TagLib::StringList& block, QIma
         *result = otherCover;
         return !result->isNull();
     }
-#endif //UTILITIES_BUILD
     return false;
 }
diff --git a/shared/tag_helpers/VorbisCommentTagHelper.h b/shared/tag_helpers/VorbisCommentTagHelper.h
index c5e87b3..6b920c3 100644
--- a/shared/tag_helpers/VorbisCommentTagHelper.h
+++ b/shared/tag_helpers/VorbisCommentTagHelper.h
@@ -29,7 +29,7 @@ namespace Meta
 {
     namespace Tag
     {
-        class AMAROK_EXPORT VorbisCommentTagHelper : public TagHelper
+        class AMAROKSHARED_EXPORT VorbisCommentTagHelper : public TagHelper
         {
             public:
                 VorbisCommentTagHelper( TagLib::Tag *tag, TagLib::Ogg::XiphComment *commentsTag, Amarok::FileType fileType, TagLib::FLAC::File *file = 0 );
@@ -39,11 +39,9 @@ namespace Meta
 
                 virtual TagLib::ByteVector render() const;
 
-#ifndef UTILITIES_BUILD
                 virtual bool hasEmbeddedCover() const;
                 virtual QImage embeddedCover() const;
                 virtual bool setEmbeddedCover( const QImage &cover );
-#endif  //UTILITIES_BUILD
 
             private:
                 static bool parsePictureBlock( const TagLib::StringList& block, QImage* result = 0 );
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 84e6130..c03541f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -541,36 +541,6 @@ if( CMAKE_BUILD_TYPE_TOLOWER MATCHES debug )
 endif( CMAKE_BUILD_TYPE_TOLOWER MATCHES debug )
 
 #####################################################################
-# SHARED
-#####################################################################
-set( shared_SRCS
-    ${CMAKE_SOURCE_DIR}/shared/MetaTagLib.cpp
-    ${CMAKE_SOURCE_DIR}/shared/TagsFromFileNameGuesser.cpp
-    ${CMAKE_SOURCE_DIR}/shared/FileType.cpp
-    ${CMAKE_SOURCE_DIR}/shared/collectionscanner/Album.cpp
-    ${CMAKE_SOURCE_DIR}/shared/collectionscanner/BatchFile.cpp
-    ${CMAKE_SOURCE_DIR}/shared/collectionscanner/Directory.cpp
-    ${CMAKE_SOURCE_DIR}/shared/collectionscanner/Playlist.cpp
-    ${CMAKE_SOURCE_DIR}/shared/collectionscanner/ScanningState.cpp
-    ${CMAKE_SOURCE_DIR}/shared/collectionscanner/Track.cpp
-)
-
-if( TAGLIB_FOUND )
-    set( shared_SRCS
-        ${shared_SRCS}
-        ${CMAKE_SOURCE_DIR}/shared/MetaReplayGain.cpp
-        ${CMAKE_SOURCE_DIR}/shared/FileTypeResolver.cpp
-        ${CMAKE_SOURCE_DIR}/shared/tag_helpers/APETagHelper.cpp
-        ${CMAKE_SOURCE_DIR}/shared/tag_helpers/ASFTagHelper.cpp
-        ${CMAKE_SOURCE_DIR}/shared/tag_helpers/ID3v2TagHelper.cpp
-        ${CMAKE_SOURCE_DIR}/shared/tag_helpers/MP4TagHelper.cpp
-        ${CMAKE_SOURCE_DIR}/shared/tag_helpers/StringHelper.cpp
-        ${CMAKE_SOURCE_DIR}/shared/tag_helpers/TagHelper.cpp
-        ${CMAKE_SOURCE_DIR}/shared/tag_helpers/VorbisCommentTagHelper.cpp
-    )
-endif( TAGLIB_FOUND )
-
-#####################################################################
 # STATISTICS SYNCHRONIZATION
 #####################################################################
 set( statsyncing_SRCS
@@ -634,7 +604,6 @@ set(amaroklib_LIB_SRCS
     ${libstatusbar_SRCS}
     ${libamarokurl_SRCS}
     ${libsynchronization_SRCS}
-    ${shared_SRCS}
     ${statsyncing_SRCS}
     core-impl/logger/ProxyLogger.cpp
     aboutdialog/AnimatedBarWidget.cpp
@@ -913,6 +882,7 @@ target_link_libraries(amaroklib
     amarokcore
     amarokocsclient
     amarok-transcoding
+    amarokshared
 )
 
 if( TAGLIB_FOUND )
diff --git a/src/core-impl/collections/db/sql/CMakeLists.txt b/src/core-impl/collections/db/sql/CMakeLists.txt
index 3d8eb0e..d4dfb3d 100644
--- a/src/core-impl/collections/db/sql/CMakeLists.txt
+++ b/src/core-impl/collections/db/sql/CMakeLists.txt
@@ -36,6 +36,7 @@ target_link_libraries(amarok-sqlcollection
     amarokcore
     amaroklib
     amarok-transcoding
+    amarokshared
 )
 
 if(APPLE)
diff --git a/src/core-impl/collections/ipodcollection/CMakeLists.txt b/src/core-impl/collections/ipodcollection/CMakeLists.txt
index 9d416d3..7bbb94b 100644
--- a/src/core-impl/collections/ipodcollection/CMakeLists.txt
+++ b/src/core-impl/collections/ipodcollection/CMakeLists.txt
@@ -51,6 +51,7 @@ if(IPOD_FOUND AND WITH_IPOD)
   kde4_add_plugin(amarok_collection-ipodcollection ${amarok_collection-ipodcollection_PART_SRCS})
 
   target_link_libraries(amarok_collection-ipodcollection
+    amarokshared
     amarokcore
     amaroklib
     amarok-transcoding
diff --git a/src/core-impl/collections/support/jobs/WriteTagsJob.cpp b/src/core-impl/collections/support/jobs/WriteTagsJob.cpp
index 3749336..5834cd4 100644
--- a/src/core-impl/collections/support/jobs/WriteTagsJob.cpp
+++ b/src/core-impl/collections/support/jobs/WriteTagsJob.cpp
@@ -19,6 +19,7 @@
 #include "amarokconfig.h"
 #include "MetaTagLib.h"
 
+#include <QImage>
 
 WriteTagsJob::WriteTagsJob(const QString& path, const Meta::FieldHash& changes)
     : Job()
diff --git a/src/core-impl/collections/umscollection/CMakeLists.txt b/src/core-impl/collections/umscollection/CMakeLists.txt
index ff3dd39..712d230 100644
--- a/src/core-impl/collections/umscollection/CMakeLists.txt
+++ b/src/core-impl/collections/umscollection/CMakeLists.txt
@@ -23,6 +23,7 @@ kde4_add_ui_files(amarok_collection-umscollection_PART_SRCS
 kde4_add_plugin(amarok_collection-umscollection ${amarok_collection-umscollection_PART_SRCS})
 	
 target_link_libraries(amarok_collection-umscollection
+  amarokshared
   amaroklib
   amarokcore
   amarok-transcoding
diff --git a/src/core-impl/collections/umscollection/UmsCollection.cpp b/src/core-impl/collections/umscollection/UmsCollection.cpp
index 1e8d04a..6bebd98 100644
--- a/src/core-impl/collections/umscollection/UmsCollection.cpp
+++ b/src/core-impl/collections/umscollection/UmsCollection.cpp
@@ -20,6 +20,7 @@
 
 #include "amarokconfig.h"
 #include "ui_UmsConfiguration.h"
+#include "collectionscanner/Track.h"
 #include "core/capabilities/ActionsCapability.h"
 #include "core/interfaces/Logger.h"
 #include "core/meta/Meta.h"
diff --git a/tests/core-impl/collections/db/sql/CMakeLists.txt b/tests/core-impl/collections/db/sql/CMakeLists.txt
index bf387af..60301f0 100644
--- a/tests/core-impl/collections/db/sql/CMakeLists.txt
+++ b/tests/core-impl/collections/db/sql/CMakeLists.txt
@@ -25,6 +25,7 @@ macro(add_database_test test_target test_sources)
     endif(NOT APPLE)
 
     target_link_libraries(${test_target}
+        amarokshared
         amarokcore
         amaroklib
         amarok-sqlcollection
diff --git a/utilities/collectionscanner/CMakeLists.txt b/utilities/collectionscanner/CMakeLists.txt
index 8f26145..df3b442 100644
--- a/utilities/collectionscanner/CMakeLists.txt
+++ b/utilities/collectionscanner/CMakeLists.txt
@@ -1,62 +1,19 @@
-
-include_directories( ../
-                     ${CMAKE_SOURCE_DIR}
-                     ${QT_INCLUDES}
-                   )
+include_directories( ${QT_INCLUDES} )
 
 ########### next target ###############
 
 qt4_automoc( CollectionScanner.cpp )
 
-add_definitions( "-DUTILITIES_BUILD" )
-
 set(amarokcollectionscanner_SRCS
     CollectionScanner.cpp
-    ${CMAKE_SOURCE_DIR}/shared/FileType.cpp
-    ${CMAKE_SOURCE_DIR}/shared/MetaTagLib.cpp
-    ${CMAKE_SOURCE_DIR}/shared/TagsFromFileNameGuesser.cpp
-    ${CMAKE_SOURCE_DIR}/shared/collectionscanner/Album.cpp
-    ${CMAKE_SOURCE_DIR}/shared/collectionscanner/BatchFile.cpp
-    ${CMAKE_SOURCE_DIR}/shared/collectionscanner/Directory.cpp
-    ${CMAKE_SOURCE_DIR}/shared/collectionscanner/Playlist.cpp
-    ${CMAKE_SOURCE_DIR}/shared/collectionscanner/ScanningState.cpp
-    ${CMAKE_SOURCE_DIR}/shared/collectionscanner/Track.cpp
 )
-if( TAGLIB_FOUND )
-    set(amarokcollectionscanner_SRCS
-        ${amarokcollectionscanner_SRCS}
-        ../../shared/FileTypeResolver.cpp
-        ../../shared/MetaReplayGain.cpp
-        ../../shared/tag_helpers/APETagHelper.cpp
-        ../../shared/tag_helpers/ASFTagHelper.cpp
-        ../../shared/tag_helpers/ID3v2TagHelper.cpp
-        ../../shared/tag_helpers/MP4TagHelper.cpp
-        ../../shared/tag_helpers/StringHelper.cpp
-        ../../shared/tag_helpers/TagHelper.cpp
-        ../../shared/tag_helpers/VorbisCommentTagHelper.cpp
-    )
-endif( TAGLIB_FOUND )
 
 add_executable(amarokcollectionscanner ${amarokcollectionscanner_SRCS} ${libchardet_SRCS})
 
-if( TAGLIB_FOUND )
-    include_directories(${TAGLIB_INCLUDES})
-    add_definitions(${TAGLIB_CFLAGS})
-    target_link_libraries(amarokcollectionscanner ${TAGLIB_LIBRARIES})
-endif( TAGLIB_FOUND )
-if( TAGLIB-EXTRAS_FOUND )
-    include_directories(${TAGLIB-EXTRAS_INCLUDES})
-    add_definitions(${TAGLIB-EXTRAS_CFLAGS})
-    target_link_libraries(amarokcollectionscanner ${TAGLIB-EXTRAS_LIBRARIES})
-endif( TAGLIB-EXTRAS_FOUND )
-
 target_link_libraries(amarokcollectionscanner 
-                      ${QT_QTGUI_LIBRARY} # required on Solaris, see bug 264112
-                      ${QT_QTCORE_LIBRARY}
-                      ${QT_QTXML_LIBRARY}
-                      ${QT_QTDBUS_LIBRARY}
-                      ${KDE4_KDECORE_LIBRARY}
-                      )
+    ${QT_QTCORE_LIBRARY}
+    amarokshared
+)
 
 if(APPLE)
     SET_TARGET_PROPERTIES(amarokcollectionscanner PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
diff --git a/utilities/collectionscanner/CollectionScanner.cpp b/utilities/collectionscanner/CollectionScanner.cpp
index bac3e59..c051ed2 100644
--- a/utilities/collectionscanner/CollectionScanner.cpp
+++ b/utilities/collectionscanner/CollectionScanner.cpp
@@ -21,9 +21,10 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
+#include "CollectionScanner.h"
+
 #include "Version.h"  // for AMAROK_VERSION
 #include "collectionscanner/BatchFile.h"
-#include "collectionscanner/CollectionScanner.h"
 #include "collectionscanner/Directory.h"
 #include "collectionscanner/Track.h"
 
diff --git a/utilities/collectionscanner/CollectionScanner.h b/utilities/collectionscanner/CollectionScanner.h
index de9309c..d66818e 100644
--- a/utilities/collectionscanner/CollectionScanner.h
+++ b/utilities/collectionscanner/CollectionScanner.h
@@ -30,14 +30,6 @@
 #include <QStringList>
 #include <QXmlStreamWriter>
 
-#ifndef UTILITIES_BUILD
-    #include "amarok_export.h"
-#else
-    #define AMAROK_EXPORT
-#endif
-
-class QSharedMemory;
-
 namespace CollectionScanner
 {
 



More information about the Amarok-devel mailing list