Permalink
Browse files

Move Playdar API into its own library

  • Loading branch information...
xhochy committed Aug 24, 2013
1 parent b6f6f42 commit a340be767da2764953e90c380ffa2936697c39d7
View
@@ -356,6 +356,7 @@ file(COPY TomahawkAddLibrary.cmake DESTINATION "${PROJECT_BINARY_DIR}")
SET( TOMAHAWK_LIBRARIES tomahawklib )
SET( TOMAHAWK_WIDGETS_LIBRARIES tomahawk-widgets )
+SET( TOMAHAWK_PLAYDARAPI_LIBRARIES tomahawk-playdarapi )
ADD_SUBDIRECTORY( thirdparty )
ADD_SUBDIRECTORY( src )
View
@@ -5,7 +5,7 @@ function(tomahawk_add_library)
set(NAME ${ARGV0})
set(options NO_INSTALL NO_VERSION)
set(oneValueArgs NAME TYPE EXPORT_MACRO TARGET TARGET_TYPE EXPORT VERSION SOVERSION INSTALL_BINDIR)
- set(multiValueArgs SOURCES UI LINK_LIBRARIES COMPILE_DEFINITIONS QT5_MODULES)
+ set(multiValueArgs SOURCES UI LINK_LIBRARIES LINK_PRIVATE_LIBRARIES COMPILE_DEFINITIONS QT5_MODULES)
cmake_parse_arguments(LIBRARY "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
set(LIBRARY_NAME ${NAME})
@@ -71,6 +71,9 @@ function(tomahawk_add_library)
if(LIBRARY_LINK_LIBRARIES)
target_link_libraries(${target} ${LIBRARY_LINK_LIBRARIES})
endif()
+ if(LIBRARY_LINK_PRIVATE_LIBRARIES)
+ target_link_libraries(${target} LINK_PRIVATE ${LIBRARY_LINK_PRIVATE_LIBRARIES})
+ endif()
# add soversion
if(NOT LIBRARY_NO_VERSION)
View
@@ -11,6 +11,7 @@ include_directories( ${CMAKE_CURRENT_LIST_DIR} )
# library
add_subdirectory( libtomahawk )
add_subdirectory( libtomahawk-widgets )
+add_subdirectory( libtomahawk-playdarapi )
# plugins
add_subdirectory( accounts )
File renamed without changes.
@@ -23,6 +23,8 @@
// See: http://doc.libqxt.org/tip/qxtweb.html
+#include "PlaydarAPIDllMacro.h"
+
#include <QxtWeb/QxtHttpServerConnector>
#include <QxtWeb/QxtHttpSessionManager>
#include <QxtWeb/QxtWebContent>
@@ -43,7 +45,7 @@ namespace Tomahawk
typedef QSharedPointer< Result > result_ptr;
}
-class Api_v1 : public QxtWebSlotService
+class TOMAHAWK_PLAYDARAPI_EXPORT Api_v1 : public QxtWebSlotService
{
Q_OBJECT
@@ -0,0 +1,20 @@
+
+set(TOMAHAWK_PLAYDARAPI_LIBRARY_TARGET tomahawk-playdarapi)
+
+list(APPEND ${TOMAHAWK_PLAYDARAPI_LIBRARY_TARGET}_SOURCES
+ Api_v1.cpp
+ )
+
+list(APPEND ${TOMAHAWK_PLAYDARAPI_LIBRARY_TARGET}_UI
+ )
+
+include_directories(${QXTWEB_INCLUDE_DIRS})
+
+tomahawk_add_library(${TOMAHAWK_PLAYDARAPI_LIBRARY_TARGET}
+ SOURCES ${${TOMAHAWK_PLAYDARAPI_LIBRARY_TARGET}_SOURCES}
+ UI ${${TOMAHAWK_PLAYDARAPI_LIBRARY_TARGET}_UI}
+ LINK_PRIVATE_LIBRARIES ${QXTWEB_LIBRARIES}
+ EXPORT TomahawkLibraryDepends
+ VERSION ${TOMAHAWK_VERSION_SHORT}
+ )
+
@@ -0,0 +1,33 @@
+/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
+ *
+ * Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
+ * Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org>
+ *
+ * Tomahawk 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 Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Tomahawk is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef PLAYDARAPIDLLMACRO_H
+#define PLAYDARAPISDLLMACRO_H
+
+#include <QtCore/qglobal.h>
+
+#ifndef TOMAHAWK_PLAYDARAPI_EXPORT
+# if defined (tomahawk_playdarapi_EXPORTS)
+# define TOMAHAWK_PLAYDARAPI_EXPORT Q_DECL_EXPORT
+# else
+# define TOMAHAWK_PLAYDARAPI_EXPORT Q_DECL_IMPORT
+# endif
+#endif
+
+#endif // PLAYDARAPIDLLMACRO_H
@@ -97,6 +97,7 @@ INCLUDE_DIRECTORIES(
${THIRDPARTY_DIR}/breakpad
+ ${QXTWEB_INCLUDE_DIRS}
${TAGLIB_INCLUDES}
${QJSON_INCLUDE_DIR}
${LIBATTICA_INCLUDE_DIR}
@@ -105,12 +106,6 @@ INCLUDE_DIRECTORIES(
${Boost_INCLUDE_DIR}
)
-IF( QXTWEB_FOUND )
- LIST(APPEND tomahawkSources web/Api_v1.cpp)
- LIST(APPEND LINK_LIBRARIES ${QXTWEB_LIBRARIES})
- INCLUDE_DIRECTORIES(${QXTWEB_INCLUDE_DIRS})
-ENDIF()
-
SET( OS_SPECIFIC_LINK_LIBRARIES "" )
IF( WIN32 )
@@ -183,11 +178,13 @@ ENDIF()
TARGET_LINK_LIBRARIES( tomahawk_bin
${LINK_LIBRARIES}
${TOMAHAWK_WIDGETS_LIBRARIES}
+ ${TOMAHAWK_PLAYDARAPI_LIBRARIES}
${TOMAHAWK_LIBRARIES}
${OS_SPECIFIC_LINK_LIBRARIES}
${QT_LIBRARIES}
${MAC_EXTRA_LIBS}
${ECHONEST_LIBRARIES}
+ ${QXTWEB_LIBRARIES}
${QJSON_LIBRARIES}
${TAGLIB_LIBRARIES}
)
@@ -37,7 +37,6 @@
#include "playlist/XspfUpdater.h"
#include "network/Servent.h"
#include "network/DbSyncConnection.h"
-#include "web/Api_v1.h"
#include "SourceList.h"
#include "ViewManager.h"
#include "ShortcutHandler.h"
@@ -65,6 +64,7 @@
#include "jobview/ErrorStatusMessage.h"
#include "jobview/JobStatusModel.h"
#include "jobview/JobStatusView.h"
+#include "libtomahawk-playdarapi/Api_v1.h"
#include "utils/XspfLoader.h"
#include "utils/JspfLoader.h"
#include "utils/Logger.h"

0 comments on commit a340be7

Please sign in to comment.