From af2336b32f7885678197b73e97562a1f996b6c1e Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Fri, 24 May 2013 11:23:22 +0200 Subject: [PATCH] Adjust cmake to build again and fix include errors These are partly hacks - I split the commit for referencing the hacks afterwards --- CMakeLists.txt | 1 - src/CMakeLists.txt | 13 +++++++++++++ src/accounts/twitter/TwitterAccount.cpp | 4 ++-- src/accounts/twitter/TwitterInfoPlugin.cpp | 2 +- src/accounts/twitter/TwitterInfoPlugin.h | 2 +- src/infoplugins/generic/charts/ChartsPlugin.h | 3 ++- src/infoplugins/generic/discogs/DiscogsPlugin.h | 3 ++- .../generic/echonest/EchonestPlugin.h | 3 ++- src/infoplugins/generic/hypem/HypemPlugin.h | 3 ++- .../generic/musicbrainz/MusicBrainzPlugin.h | 3 ++- .../generic/musixmatch/MusixMatchPlugin.h | 4 +++- .../generic/newreleases/NewReleasesPlugin.h | 4 +++- src/infoplugins/generic/rovi/RoviPlugin.h | 4 +++- src/infoplugins/generic/spotify/SpotifyPlugin.h | 4 +++- .../linux/fdonotify/FdoNotifyPlugin.h | 3 ++- src/infoplugins/linux/mpris/MprisPlugin.h | 4 +++- src/infoplugins/mac/adium/AdiumPlugin.h | 3 ++- src/libtomahawk/CMakeLists.txt | 6 ++---- src/tomahawk/CMakeLists.txt | 16 +++------------- src/tomahawk/TomahawkApp.cpp | 2 +- 20 files changed, 52 insertions(+), 35 deletions(-) create mode 100644 src/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 000c973e6..f74590f5a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -311,7 +311,6 @@ SET( TOMAHAWK_LIBRARIES tomahawklib ) ADD_SUBDIRECTORY( thirdparty ) ADD_SUBDIRECTORY( src ) -ADD_SUBDIRECTORY( src/libtomahawk ) ADD_SUBDIRECTORY( admin ) if( BUILD_TESTS ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 000000000..c5f432164 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,13 @@ +setup_qt() + +add_subdirectory( libtomahawk ) + +include_directories( ${CMAKE_CURRENT_BINARY_DIR}/libtomahawk ) +include_directories( ${CMAKE_CURRENT_LIST_DIR}/libtomahawk ) + +add_subdirectory( tomahawk ) + +add_subdirectory( breakpad/CrashReporter/ ) + +add_subdirectory( accounts ) +add_subdirectory( infoplugins ) \ No newline at end of file diff --git a/src/accounts/twitter/TwitterAccount.cpp b/src/accounts/twitter/TwitterAccount.cpp index e28191cc3..4dd95d601 100644 --- a/src/accounts/twitter/TwitterAccount.cpp +++ b/src/accounts/twitter/TwitterAccount.cpp @@ -20,8 +20,8 @@ #include "TwitterAccount.h" #include "TwitterConfigWidget.h" -#include "accounts/twitter/TomahawkOAuthTwitter.h" -#include "libtomahawk/infosystem/InfoSystem.h" +#include "TomahawkOAuthTwitter.h" +#include "infosystem/InfoSystem.h" #include "utils/Logger.h" #include "sip/SipPlugin.h" diff --git a/src/accounts/twitter/TwitterInfoPlugin.cpp b/src/accounts/twitter/TwitterInfoPlugin.cpp index c78cc630b..f6342dc3a 100644 --- a/src/accounts/twitter/TwitterInfoPlugin.cpp +++ b/src/accounts/twitter/TwitterInfoPlugin.cpp @@ -20,7 +20,7 @@ #include "TwitterInfoPlugin.h" -#include "accounts/twitter/TwitterAccount.h" +#include "TwitterAccount.h" #include "GlobalActionManager.h" #include "utils/Logger.h" diff --git a/src/accounts/twitter/TwitterInfoPlugin.h b/src/accounts/twitter/TwitterInfoPlugin.h index 893249a84..187df4c6c 100644 --- a/src/accounts/twitter/TwitterInfoPlugin.h +++ b/src/accounts/twitter/TwitterInfoPlugin.h @@ -21,7 +21,7 @@ #define TWITTERINFOPLUGIN_H #include "infosystem/InfoSystem.h" -#include "accounts/twitter/TomahawkOAuthTwitter.h" +#include "TomahawkOAuthTwitter.h" #include #include diff --git a/src/infoplugins/generic/charts/ChartsPlugin.h b/src/infoplugins/generic/charts/ChartsPlugin.h index f7380c90b..17722373a 100644 --- a/src/infoplugins/generic/charts/ChartsPlugin.h +++ b/src/infoplugins/generic/charts/ChartsPlugin.h @@ -20,7 +20,8 @@ #ifndef ChartsPlugin_H #define ChartsPlugin_H -#include "infoplugins/InfoPluginDllMacro.h" +#include "../../InfoPluginDllMacro.h" + #include "infosystem/InfoSystem.h" #include "infosystem/InfoSystemWorker.h" #include diff --git a/src/infoplugins/generic/discogs/DiscogsPlugin.h b/src/infoplugins/generic/discogs/DiscogsPlugin.h index ecf3ac834..8a3c498e2 100644 --- a/src/infoplugins/generic/discogs/DiscogsPlugin.h +++ b/src/infoplugins/generic/discogs/DiscogsPlugin.h @@ -22,7 +22,8 @@ #include "Typedefs.h" #include "infosystem/InfoSystem.h" #include "infosystem/InfoSystemWorker.h" -#include "infoplugins/InfoPluginDllMacro.h" + +#include "../../InfoPluginDllMacro.h" class QNetworkReply; diff --git a/src/infoplugins/generic/echonest/EchonestPlugin.h b/src/infoplugins/generic/echonest/EchonestPlugin.h index e461060b1..62b70db3f 100644 --- a/src/infoplugins/generic/echonest/EchonestPlugin.h +++ b/src/infoplugins/generic/echonest/EchonestPlugin.h @@ -20,7 +20,8 @@ #ifndef ECHONESTPLUGIN_H #define ECHONESTPLUGIN_H -#include "infoplugins/InfoPluginDllMacro.h" +#include "../../InfoPluginDllMacro.h" + #include "infosystem/InfoSystem.h" #include "infosystem/InfoSystemWorker.h" #include "echonest/Artist.h" diff --git a/src/infoplugins/generic/hypem/HypemPlugin.h b/src/infoplugins/generic/hypem/HypemPlugin.h index d0c9502e0..e3e66bc79 100644 --- a/src/infoplugins/generic/hypem/HypemPlugin.h +++ b/src/infoplugins/generic/hypem/HypemPlugin.h @@ -20,7 +20,8 @@ #ifndef HYPEMPLUGIN_H #define HYPEMPLUGIN_H -#include "infoplugins/InfoPluginDllMacro.h" +#include "../../InfoPluginDllMacro.h" + #include "infosystem/InfoSystem.h" #include "infosystem/InfoSystemWorker.h" #include diff --git a/src/infoplugins/generic/musicbrainz/MusicBrainzPlugin.h b/src/infoplugins/generic/musicbrainz/MusicBrainzPlugin.h index ac278bd11..f48aa0476 100644 --- a/src/infoplugins/generic/musicbrainz/MusicBrainzPlugin.h +++ b/src/infoplugins/generic/musicbrainz/MusicBrainzPlugin.h @@ -22,7 +22,8 @@ #include "infosystem/InfoSystem.h" #include "infosystem/InfoSystemWorker.h" -#include "infoplugins/InfoPluginDllMacro.h" + +#include "../../InfoPluginDllMacro.h" class QNetworkReply; diff --git a/src/infoplugins/generic/musixmatch/MusixMatchPlugin.h b/src/infoplugins/generic/musixmatch/MusixMatchPlugin.h index 96c5dbad2..17495d42e 100644 --- a/src/infoplugins/generic/musixmatch/MusixMatchPlugin.h +++ b/src/infoplugins/generic/musixmatch/MusixMatchPlugin.h @@ -22,7 +22,9 @@ #include "infosystem/InfoSystem.h" #include "infosystem/InfoSystemWorker.h" -#include "infoplugins/InfoPluginDllMacro.h" + +#include "../../InfoPluginDllMacro.h" + class QNetworkReply; diff --git a/src/infoplugins/generic/newreleases/NewReleasesPlugin.h b/src/infoplugins/generic/newreleases/NewReleasesPlugin.h index 212b058bd..7af94a5ad 100644 --- a/src/infoplugins/generic/newreleases/NewReleasesPlugin.h +++ b/src/infoplugins/generic/newreleases/NewReleasesPlugin.h @@ -22,7 +22,9 @@ #include "infosystem/InfoSystem.h" #include "infosystem/InfoSystemWorker.h" -#include "infoplugins/InfoPluginDllMacro.h" + +#include "../../InfoPluginDllMacro.h" + #include #include #include diff --git a/src/infoplugins/generic/rovi/RoviPlugin.h b/src/infoplugins/generic/rovi/RoviPlugin.h index 87fc3bc08..715c608bb 100644 --- a/src/infoplugins/generic/rovi/RoviPlugin.h +++ b/src/infoplugins/generic/rovi/RoviPlugin.h @@ -21,7 +21,9 @@ #define ROVIPLUGIN_H #include "infosystem/InfoSystem.h" -#include "infoplugins/InfoPluginDllMacro.h" + +#include "../../InfoPluginDllMacro.h" + #include diff --git a/src/infoplugins/generic/spotify/SpotifyPlugin.h b/src/infoplugins/generic/spotify/SpotifyPlugin.h index b8de3967d..69625dcba 100644 --- a/src/infoplugins/generic/spotify/SpotifyPlugin.h +++ b/src/infoplugins/generic/spotify/SpotifyPlugin.h @@ -22,7 +22,9 @@ #include "infosystem/InfoSystem.h" #include "infosystem/InfoSystemWorker.h" -#include "infoplugins/InfoPluginDllMacro.h" + +#include "../../InfoPluginDllMacro.h" + #include #include diff --git a/src/infoplugins/linux/fdonotify/FdoNotifyPlugin.h b/src/infoplugins/linux/fdonotify/FdoNotifyPlugin.h index c9f3e78e0..ff4743cdd 100644 --- a/src/infoplugins/linux/fdonotify/FdoNotifyPlugin.h +++ b/src/infoplugins/linux/fdonotify/FdoNotifyPlugin.h @@ -20,7 +20,8 @@ #ifndef FDONOTIFYPLUGIN_H #define FDONOTIFYPLUGIN_H -#include "infoplugins/InfoPluginDllMacro.h" +#include "../../InfoPluginDllMacro.h" + #include "infosystem/InfoSystem.h" #include diff --git a/src/infoplugins/linux/mpris/MprisPlugin.h b/src/infoplugins/linux/mpris/MprisPlugin.h index 576979be1..a5997cf55 100644 --- a/src/infoplugins/linux/mpris/MprisPlugin.h +++ b/src/infoplugins/linux/mpris/MprisPlugin.h @@ -24,7 +24,9 @@ #include "Source.h" #include "audio/AudioEngine.h" #include "infosystem/InfoSystem.h" -#include "infoplugins/InfoPluginDllMacro.h" + +#include "../../InfoPluginDllMacro.h" + #include #include diff --git a/src/infoplugins/mac/adium/AdiumPlugin.h b/src/infoplugins/mac/adium/AdiumPlugin.h index 02980eff7..b0fe123d4 100644 --- a/src/infoplugins/mac/adium/AdiumPlugin.h +++ b/src/infoplugins/mac/adium/AdiumPlugin.h @@ -20,7 +20,8 @@ #ifndef ADIUMPLUGIN_H #define ADIUMPLUGIN_H -#include "infoplugins/InfoPluginDllMacro.h" +#include "../../InfoPluginDllMacro.h" + #include "infosystem/InfoSystem.h" #include diff --git a/src/libtomahawk/CMakeLists.txt b/src/libtomahawk/CMakeLists.txt index 0575e4db3..48b53970f 100644 --- a/src/libtomahawk/CMakeLists.txt +++ b/src/libtomahawk/CMakeLists.txt @@ -1,16 +1,14 @@ project( tomahawklib ) -setup_qt() - add_definitions( ${QT_DEFINITIONS} ) add_definitions( -DQT_SHARED ) add_definitions( -DDLLEXPORT_PRO ) add_definitions( -DQT_SHAREDPOINTER_TRACK_POINTERS ) add_definitions( -DPORTFWDDLLEXPORT_STATIC ) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../Config.h.in +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../tomahawk/Config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../TomahawkVersion.h.in +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../tomahawk/TomahawkVersion.h.in ${CMAKE_CURRENT_BINARY_DIR}/TomahawkVersion.h) set( libGuiSources diff --git a/src/tomahawk/CMakeLists.txt b/src/tomahawk/CMakeLists.txt index 5ae0c8655..636ff2c3c 100644 --- a/src/tomahawk/CMakeLists.txt +++ b/src/tomahawk/CMakeLists.txt @@ -1,9 +1,6 @@ PROJECT( tomahawk ) CMAKE_MINIMUM_REQUIRED( VERSION 2.8 ) - -setup_qt() - include( AddAppIconMacro ) # SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" ) @@ -93,10 +90,10 @@ SET( tomahawkUI ${tomahawkUI} INCLUDE_DIRECTORIES( . ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_BINARY_DIR}/libtomahawk + ${CMAKE_CURRENT_BINARY_DIR}/../libtomahawk sourcetree - libtomahawk + ../libtomahawk mac ${THIRDPARTY_DIR}/breakpad @@ -132,9 +129,6 @@ IF( APPLE ) SET( tomahawkSources ${tomahawkSources} mac/TomahawkApp_Mac.mm mac/MacShortcutHandler.cpp ) ENDIF( APPLE ) -ADD_SUBDIRECTORY( accounts ) -ADD_SUBDIRECTORY( infoplugins ) - IF(QCA2_FOUND) INCLUDE_DIRECTORIES( ${QCA2_INCLUDE_DIR} ) ENDIF(QCA2_FOUND) @@ -156,14 +150,10 @@ SET( final_src ${final_src} ${tomahawkMoc} ${tomahawkSources} ${trans_outfile}) IF( BUILD_GUI ) LIST(APPEND tomahawkSources ${tomahawkSourcesGui}) qt_wrap_ui( tomahawkUI_H ${tomahawkUI} ) - - IF( WITH_CRASHREPORTER ) - ADD_SUBDIRECTORY( breakpad/CrashReporter ) - ENDIF() ENDIF() kde4_add_app_icon( tomahawkSources "${CMAKE_SOURCE_DIR}/data/icons/tomahawk-icon-*.png" ) -qt_add_resources( RC_SRCS "../resources.qrc" ) +qt_add_resources( RC_SRCS "../../resources.qrc" ) SET( final_src ${final_src} ${tomahawkUI_H} ${tomahawkMoc} ${tomahawkSources} ${RC_SRCS} ) diff --git a/src/tomahawk/TomahawkApp.cpp b/src/tomahawk/TomahawkApp.cpp index c20fe28d3..c77ca8e21 100644 --- a/src/tomahawk/TomahawkApp.cpp +++ b/src/tomahawk/TomahawkApp.cpp @@ -46,7 +46,7 @@ #include "web/Api_v1.h" #include "SourceList.h" #include "ShortcutHandler.h" -#include "libtomahawk/filemetadata/ScanManager.h" +#include "filemetadata/ScanManager.h" #include "TomahawkSettings.h" #include "GlobalActionManager.h" #include "database/LocalCollection.h"