Revert previous commit, was incorrect
[amarok.git] / src / CMakeLists.txt
blob7dffcbb53c829ca00bbde71de6bbe82e50e80d04
2 FIND_PATH( KONQSIDEBAR_INCLUDE_DIR konqsidebarplugin.h
3   ${KDE4_INCLUDE_DIR}
4   /usr/include
5   /usr/local/include
8 MESSAGE(STATUS "reactivate konquesidebar when it is ported")
9 #if(KONQSIDEBAR_INCLUDE_DIR)
10 #   add_subdirectory( konquisidebar ) #disabling for now
11 #else(KONQSIDEBAR_INCLUDE_DIR)
12 #    MESSAGE(STATUS "You're missing the kdebase header files")
13 #    MESSAGE(STATUS "Konqueror sidebar will not be compiled.")
14 #endif(KONQSIDEBAR_INCLUDE_DIR)
16 ADD_DEFINITIONS(${TAGLIB_CFLAGS})
18 if(MP4V2_FOUND)
19     ADD_DEFINITIONS(-DHAVE_MP4V2)
20     include_directories( ${MP4V2_INCLUDE_DIR} )
21 endif(MP4V2_FOUND)
23 if(APPLE)
24     set(mac_SRCS app_mac.cpp)
25 endif(APPLE)
27 add_subdirectory( amarokcore )
28 add_subdirectory( data )
29 add_subdirectory( images )
30 add_subdirectory( scripts )
31 add_subdirectory( themes )
32 add_subdirectory( vis )
33 add_subdirectory( metadata )
34 add_subdirectory( engine )
35 add_subdirectory( mediadevice )
36 add_subdirectory( collectionscanner )
37 add_subdirectory( collection )
38 add_subdirectory( strigi )
39 add_subdirectory( context )
40 add_subdirectory( playlistmanager )
41 add_subdirectory( servicebrowser )
43 OPTION(USE_SYSTEM_SQLITE "Use system sqlite instead of amarok's own copy" OFF)
45 if (USE_SYSTEM_SQLITE)
46     find_package(Sqlite REQUIRED)
47     set(libsqlite_SRCS )
48 else (USE_SYSTEM_SQLITE)
49     # Use our own copy
50     set(libsqlite_SRCS sqlite/sqlite3.c)
51 endif (USE_SYSTEM_SQLITE)
54 include_directories(
55     amarokcore
56     analyzers
57     context
58     context/widgets
59     configdialog
60     configdialog/dialogs
61     plugin
62     statusbar
63     mediadevice
64     servicebrowser
65     #servicebrowser/magnatunestore
66     ${CMAKE_CURRENT_SOURCE_DIR}
67     meta
68     collection
69     podcasts
70     widgets
71     playlistbrowser
72     ${CMAKE_CURRENT_BINARY_DIR} #for amarokconfig.h
73     ${KDE4_INCLUDE_DIR}
74     ${TAGLIB_INCLUDE_DIR}
75     ${QT_INCLUDES}
79 set(libamarokcore_SRCS
80     amarokcore/amarokdbushandler.cpp
81     amarokcore/crashhandler.cpp
84 qt4_add_dbus_adaptor( libamarokcore_SRCS amarokcore/org.kde.amarok.collection.xml amarokcore/amarokdbushandler.h Amarok::DbusCollectionHandler)
85 #qt4_add_dbus_adaptor( libamarokcore_SRCS amarokcore/org.kde.amarok.mediabrowser.xml amarokcore/amarokdbushandler.h Amarok::DbusMediaBrowserHandler)
86 qt4_add_dbus_adaptor( libamarokcore_SRCS amarokcore/org.kde.amarok.player.xml amarokcore/amarokdbushandler.h Amarok::DbusPlayerHandler)
87 qt4_add_dbus_adaptor( libamarokcore_SRCS amarokcore/org.kde.amarok.playlist.xml amarokcore/amarokdbushandler.h Amarok::DbusPlaylistHandler)
88 qt4_add_dbus_adaptor( libamarokcore_SRCS amarokcore/org.kde.amarok.playlistbrowser.xml amarokcore/amarokdbushandler.h Amarok::DbusPlaylistBrowserHandler)
89 qt4_add_dbus_adaptor( libamarokcore_SRCS amarokcore/org.kde.amarok.script.xml amarokcore/amarokdbushandler.h Amarok::DbusScriptHandler)
90 qt4_add_dbus_adaptor( libamarokcore_SRCS amarokcore/org.kde.amarok.context.xml amarokcore/amarokdbushandler.h Amarok::DbusContextHandler)
92 #####################################################################
93 # PLUGIN
94 #####################################################################
95 set(libplugin_SRCS
96     plugin/plugin.cpp
97     plugin/pluginconfig.cpp
100 #####################################################################
101 # SERVICEBROWSER
102 #####################################################################
103 set(libservicebrowser_SRCS
104     servicebrowser/servicebrowser.cpp
105     servicebrowser/servicebase.cpp
106     servicebrowser/ServicePluginManager.cpp
107     servicebrowser/servicemetabase.cpp
108     servicebrowser/servicecollection.cpp
109     servicebrowser/servicesqlquerymaker.cpp
110     servicebrowser/servicesqlcollection.cpp
111     servicebrowser/ServiceDynamicCollection.cpp
112     servicebrowser/infoparserbase.cpp
113     servicebrowser/ServiceSqlRegistry.cpp
114     servicebrowser/ServiceAlbumCoverDownloader.cpp
115     servicebrowser/ServiceInfoProxy.cpp
116     servicebrowser/ServiceListModel.cpp
117     servicebrowser/ServiceListDelegate.cpp
118     servicebrowser/DynamicServiceQueryMaker.cpp
119     servicebrowser/ServiceCustomActionsCapability.cpp
122 #####################################################################
123 # SCRIPTABLESERVICE
124 #####################################################################
125 set(libscriptableservice_SRCS
126     servicebrowser/scriptableservice/scriptableservicemanager.cpp
127     servicebrowser/scriptableservice/ScriptableServiceInfoParser.cpp
128     servicebrowser/scriptableservice/scriptableservice.cpp
129     servicebrowser/scriptableservice/ScriptableServiceCollection.cpp
130     servicebrowser/scriptableservice/DynamicScriptableServiceMeta.cpp
131     servicebrowser/scriptableservice/DynamicScriptableServiceCollection.cpp
132     servicebrowser/scriptableservice/DynamicScriptableQueryMaker.cpp
136 qt4_add_dbus_adaptor( libscriptableservice_SRCS servicebrowser/scriptableservice/org.kde.amarok.ScriptableServiceManager.xml servicebrowser/scriptableservice/scriptableservicemanager.h ScriptableServiceManager)
138 #####################################################################
139 # CONFIGDIALOG
140 #####################################################################
141 set(libconfigdialog_SRCS
142     configdialog/ConfigDialog.cpp
143     configdialog/ConfigDialogBase.cpp
144     configdialog/dialogs/AppearanceConfig.cpp
145     configdialog/dialogs/CollectionConfig.cpp
146     configdialog/dialogs/EngineConfig.cpp
147     configdialog/dialogs/GeneralConfig.cpp
148     configdialog/dialogs/LastfmConfig.cpp
149     configdialog/dialogs/MediadeviceConfig.cpp
150     configdialog/dialogs/OsdConfig.cpp
151     configdialog/dialogs/PlaybackConfig.cpp
152     configdialog/dialogs/ServiceConfig.cpp
155 kde4_add_ui_files(libconfigdialog_SRCS
156     configdialog/dialogs/AppearanceConfig.ui
157     configdialog/dialogs/CollectionConfig.ui
158     configdialog/dialogs/GeneralConfig.ui
159     configdialog/dialogs/LastfmConfig.ui
160     configdialog/dialogs/OsdConfig.ui
161     configdialog/dialogs/PlaybackConfig.ui
164 kde4_add_ui_files(libconfigdialog_SRCS
165     servicebrowser/magnatunestore/magnatunepurchasedialogbase.ui
168 #####################################################################
169 # COLLECTIONBROWSER
170 #####################################################################
171 set(libcollectionbrowser_SRCS
172     collectionbrowser/CollectionTreeView.cpp
173     collectionbrowser/CollectionTreeItemModelBase.cpp
174     collectionbrowser/CollectionTreeItemModel.cpp
175     collectionbrowser/SingleCollectionTreeItemModel.cpp
176     collectionbrowser/CollectionSortFilterProxyModel.cpp
177     collectionbrowser/CollectionTreeItem.cpp
178     collectionbrowser/CollectionWidget.cpp
181 #####################################################################
182 # ANALYZERS
183 #####################################################################
184 set(libanalyzers_SRCS
185     analyzers/analyzerbase.cpp
186     analyzers/analyzerfactory.cpp
187     analyzers/baranalyzer.cpp
188     analyzers/blockanalyzer.cpp
189     analyzers/glanalyzer.cpp
190     analyzers/glanalyzer2.cpp
191     analyzers/glanalyzer3.cpp
192     analyzers/sonogram.cpp
193 #    analyzers/turbine.cpp
194 #analyzers/boomanalyzer.cpp
197 #####################################################################
198 # STATUSBAR
199 #####################################################################
200 set(libstatusbar_SRCS
201     statusbar/AmarokStatusBar.cpp
202     statusbar/StatusBarBase.cpp
203     statusbar/ContextStatusBar.cpp
204     statusbar/overlayWidget.cpp
205     statusbar/popupMessage.cpp
206     statusbar/progressBar.cpp
207     statusbar/StatusBarMessageLabel.cpp
208     statusbar/selectLabel.cpp
209 #   statusbar/queueLabel.cpp
212 #####################################################################
213 # LAST.FM
214 #####################################################################
215 set(lastfm_SRCS
216     meta/lastfm/LastFmMeta.cpp
219 #####################################################################
220 # META
221 #####################################################################
222 set(meta_SRCS
223     meta/Capability.cpp
224     meta/EditCapability.cpp
225     meta/LastFmCapability.cpp
226     meta/CustomActionsCapability.cpp
227     meta/Meta.cpp
228     meta/proxy/MetaProxy.cpp
229     meta/file/File.cpp
230     meta/stream/Stream.cpp
231     meta/PlaylistFileSupport.cpp
232     meta/MetaUtility.cpp
235 #####################################################################
236 # COLLECTION
237 #####################################################################
238 set(collection_SRCS
239     collection/BlockingQuery.cpp
240     collection/Collection.cpp
241     collection/CollectionManager.cpp
242     collection/CollectionLocation.cpp
243     collection/MetaQueryBuilder.cpp
244     collection/QueryMaker.cpp
245     collection/support/MemoryMatcher.cpp
246     collection/support/MemoryQueryMaker.cpp
250 #####################################################################
251 # CONTEXT
252 #####################################################################
255 set( libcontextview_SRCS
256     context/Applet.cpp
257     context/Containment.cpp
258     context/ContextView.cpp
259     context/ContextObserver.cpp
260     context/ContextScene.cpp
261     context/CoverBling.cpp
262     context/DataEngineManager.cpp
263     context/LyricsManager.cpp
264     context/Svg.cpp
265     context/widgets/TextWidget.cpp
266     context/layouts/ContextLayout.cpp
269 #####################################################################
270 # PODCASTS
271 #####################################################################
272 set(libpodcasts_SRCS
273     podcasts/PodcastCollection.cpp
274     podcasts/PodcastReader.cpp
277 #####################################################################
278 # PLAYLISTBROWSER
279 #####################################################################
280 set(libplaylistbrowser_SRCS
281     playlistbrowser/PlaylistBrowser.cpp
282     playlistbrowser/PodcastModel.cpp
285 #####################################################################
286 # QUEUEMANAGER
287 #####################################################################
288 set(libqueuemanager_SRCS
289     queuemanager/QueueManager.cpp
290     queuemanager/QueueModel.cpp
293 #####################################################################
294 # PLAYLISTMANAGER
295 #####################################################################
296 set(libplaylistmanager_SRCS
297     playlistmanager/PlaylistManager.cpp
300 #####################################################################
301 # PLAYLIST
302 #####################################################################
303 set(libplaylist_SRCS
304     playlist/PlaylistHeader.cpp
305     playlist/PlaylistItem.cpp
306     playlist/PlaylistModel.cpp
307     playlist/PlaylistWidget.cpp
308     playlist/RepeatTrackNavigator.cpp
309     playlist/StandardTrackNavigator.cpp
310     playlist/TrackNavigator.cpp
311     playlist/UndoCommands.cpp
312     playlist/PlaylistDropVis.cpp
313     playlist/PlaylistGraphicsItem.cpp
314     playlist/PlaylistGraphicsScene.cpp
315     playlist/PlaylistGraphicsView.cpp
316     playlist/PlaylistTextItem.cpp
317     playlist/PlaylistAlbumGroup.cpp
318     playlist/PlaylistClassicView.cpp
321 #####################################################################
322 # LIBAMAROK
323 #####################################################################
324 set(amaroklib_LIB_SRCS
325     ${libscriptableservice_SRCS}
326     ${libamarokcore_SRCS}
327     ${libanalyzers_SRCS}
328     ${libcontextview_SRCS}
329     ${libcollectionbrowser_SRCS}
330     ${libconfigdialog_SRCS}
331     ${libplaylist_SRCS}
332     ${libplugin_SRCS}
333     ${libpodcasts_SRCS}
334     ${libservicebrowser_SRCS}
335     ${libsqlite_SRCS}
336     ${libstatusbar_SRCS}
337     ${lastfm_SRCS}
338     ${meta_SRCS}
339     ${collection_SRCS}
340     ${mac_SRCS}
341     ${libplaylistbrowser_SRCS}
342     ${libqueuemanager_SRCS}
343     ${libplaylistmanager_SRCS}
344     actionclasses.cpp
345     AmarokMimeData.cpp
346     app.cpp
347     atomicstring.cpp
348     collectiondb.cpp
349     CoverFetcher.cpp
350     CoverManager.cpp
351     cuefile.cpp
352     dbsetup.ui.h
353     deletedialog.cpp
354     deviceconfiguredialog.cpp
355     directorylist.cpp
356     editfilterdialog.cpp
357     enginebase.cpp
358     enginecontroller.cpp
359     engineobserver.cpp
360     equalizergraph.cpp
361     equalizerpresetmanager.cpp
362     equalizersetup.cpp
363     expression.cpp
364     fht.cpp
365     filebrowser.cpp
366     filebrowserwidget.cpp
367     hintlineedit.cpp
368     IconLoader.cpp
369     k3bexporter.cpp
370     kbookmarkhandler.cpp
371     ktrm.cpp
372     lastfm.cpp
373     MainWindow.cpp
374     mediabrowser.cpp
375     MediaItem.cpp
376     MediaDevice.cpp
377     MediaDeviceCache.cpp
378     MediaDevicePluginManager.cpp
379     medium.cpp
380     metabundle.cpp
381     moodbar.cpp
382     mountpointmanager.cpp
383     mydiroperator.cpp
384     osd.cpp
385     PixmapViewer.cpp
386     PlaylistHandler.cpp
387     pluginmanager.cpp
388     podcastsettings.cpp
389     prettypopupmenu.cpp
390         Process.cpp
391     querybuilder.cpp
392     refreshimages.cpp
393     scriptmanager.cpp
394     scrobbler.cpp
395     Sidebar.h
396     SmartPlaylistEditor.cpp
397     socketserver.cpp
398     StarManager.cpp
399     Statistics.cpp
400     systray.cpp
401     tagdialog.cpp
402     TagGuesser.cpp
403     threadmanager.cpp
404     tooltip.cpp
405     trackpickerdialog.cpp
406     tracktooltip.cpp
407     transferdialog.cpp
408     widgets/analyzerwidget.cpp
409     widgets/progressslider.cpp
410     widgets/searchwidget.cpp
411     widgets/SidebarWidget.cpp
412     widgets/sliderwidget.cpp
413     widgets/volumewidget.cpp
414     widgets/MainToolbar.cpp
415     xmlloader.cpp
416     xspfplaylist.cpp
420 set( amaroklib_DEPENDS "amarokplasma" )
422 kde4_add_kcfg_files(amaroklib_LIB_SRCS amarokcore/amarokconfig.kcfgc)
424 kde4_add_ui3_files(amaroklib_LIB_SRCS
425    dbsetup.ui
426 #   newdynamic.ui
427    collectionbrowser/OrganizeCollectionDialog.ui
428    podcastsettingsbase.ui
429    tagdialogbase.ui
430 #   tagguesserconfigdialog.ui
431    trackpickerdialogbase.ui
434 kde4_add_ui_files(amaroklib_LIB_SRCS
435     deletedialogbase.ui
436     scriptmanagerbase.ui
437     tagguesserconfigdialog.ui
440 kde4_add_library(amaroklib SHARED ${amaroklib_LIB_SRCS})
442 target_link_libraries(amaroklib
443     ${KDE4_KUTILS_LIBS} ${KDE4_KDEUI_LIBS} ${KDE4_KHTML_LIBS} ${KDE4_KNEWSTUFF_LIBS}
444     ${TAGLIB_LIBRARIES}
445     ${KDE4_KFILE_LIBS}
446     ${KDE4_KDE3SUPPORT_LIBS}
447     ${KDE4_THREADWEAVER_LIBRARIES}
448     ${QT_QTOPENGL_LIBRARY}
449     ${OPENGL_gl_LIBRARY}
450     ${OPENGL_glu_LIBRARY}
451     amarok_taglib
452     amarokplasma
455 if(NOT WIN32)
456     target_link_libraries(amaroklib dl)
457 endif(NOT WIN32)
459 if(USE_SYSTEM_SQLITE)
460     target_link_libraries(amaroklib ${SQLITE_LIBRARIES})
461 endif(USE_SYSTEM_SQLITE)
463 set_target_properties(amaroklib PROPERTIES VERSION 1.0.0 SOVERSION 1 )
464 install(TARGETS amaroklib DESTINATION ${LIB_INSTALL_DIR} )
467 #####################################################################
468 # AMAROK
469 #####################################################################
471 set(amarok_SRCS main.cpp )
473 if(Q_WS_MAC)
474     kde4_add_executable(Amarok ${amarok_SRCS})
475     target_link_libraries(Amarok ${KDE4_KDECORE_LIBS} amaroklib )
476     install(TARGETS Amarok DESTINATION ${BIN_INSTALL_DIR})
478 else(Q_WS_MAC)
480     kde4_add_executable(amarok ${amarok_SRCS})
481     target_link_libraries(amarok ${KDE4_KDECORE_LIBS} amaroklib )
482     install(TARGETS amarok DESTINATION ${BIN_INSTALL_DIR})
483 endif(Q_WS_MAC)
486 ########### install files ###############
488 install(FILES amarok.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
489 install(FILES amarok.profile.xml DESTINATION ${DATA_INSTALL_DIR}/profiles )
490 install(FILES amarokrc DESTINATION ${CONFIG_INSTALL_DIR})
491 install(FILES amarok_plugin.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR})
492 install(FILES amarok_append.desktop DESTINATION
493 ${SERVICES_INSTALL_DIR}/ServiceMenus)
495 install(FILES context/servicetypes/amarok_context_applet.desktop
496               context/servicetypes/amarok_data_engine.desktop
497               DESTINATION ${SERVICETYPES_INSTALL_DIR} )
499 kde4_install_icons( ${ICON_INSTALL_DIR} )