2010-02-28 18:28:56 +01:00
|
|
|
cmake_minimum_required(VERSION 2.6)
|
|
|
|
|
|
|
|
# Source files
|
|
|
|
set(CLEMENTINE-SOURCES
|
|
|
|
mainwindow.cpp
|
|
|
|
player.cpp
|
|
|
|
library.cpp
|
|
|
|
librarybackend.cpp
|
|
|
|
playlist.cpp
|
|
|
|
playlistitem.cpp
|
|
|
|
enginebase.cpp
|
|
|
|
analyzers/baranalyzer.cpp
|
|
|
|
analyzers/analyzerbase.cpp
|
|
|
|
fht.cpp
|
|
|
|
analyzers/blockanalyzer.cpp
|
2010-03-20 23:45:54 +01:00
|
|
|
analyzers/analyzercontainer.cpp
|
2010-03-21 18:22:05 +01:00
|
|
|
analyzers/boomanalyzer.cpp
|
|
|
|
analyzers/sonogram.cpp
|
|
|
|
analyzers/turbine.cpp
|
2010-02-28 18:28:56 +01:00
|
|
|
sliderwidget.cpp
|
|
|
|
playlistview.cpp
|
|
|
|
librarywatcher.cpp
|
|
|
|
song.cpp
|
|
|
|
songplaylistitem.cpp
|
|
|
|
libraryview.cpp
|
|
|
|
libraryconfig.cpp
|
|
|
|
systemtrayicon.cpp
|
|
|
|
libraryquery.cpp
|
|
|
|
fileview.cpp
|
|
|
|
fileviewlist.cpp
|
|
|
|
playlistheader.cpp
|
|
|
|
radioitem.cpp
|
|
|
|
radioservice.cpp
|
|
|
|
lastfmservice.cpp
|
|
|
|
radiomodel.cpp
|
|
|
|
lastfmconfig.cpp
|
|
|
|
busyindicator.cpp
|
|
|
|
radioplaylistitem.cpp
|
|
|
|
radioview.cpp
|
|
|
|
lastfmstationdialog.cpp
|
|
|
|
osd.cpp
|
|
|
|
trackslider.cpp
|
|
|
|
edittagdialog.cpp
|
|
|
|
lineedit.cpp
|
|
|
|
multiloadingindicator.cpp
|
|
|
|
somafmservice.cpp
|
|
|
|
settingsdialog.cpp
|
|
|
|
librarydirectorymodel.cpp
|
|
|
|
libraryconfigdialog.cpp
|
|
|
|
lastfmconfigdialog.cpp
|
|
|
|
about.cpp
|
|
|
|
albumcoverfetcher.cpp
|
|
|
|
addstreamdialog.cpp
|
|
|
|
savedradio.cpp
|
|
|
|
stylesheetloader.cpp
|
2010-02-28 19:04:50 +01:00
|
|
|
albumcovermanager.cpp
|
|
|
|
albumcoverloader.cpp
|
2010-03-01 16:40:12 +01:00
|
|
|
m3uparser.cpp
|
2010-03-08 19:05:41 +01:00
|
|
|
playlistsequence.cpp
|
2010-03-09 18:17:32 +01:00
|
|
|
xspfparser.cpp
|
2010-03-21 20:02:56 +01:00
|
|
|
globalshortcuts/globalshortcuts.cpp
|
2010-03-23 15:07:05 +01:00
|
|
|
fixlastfm.cpp
|
2010-03-23 18:26:54 +01:00
|
|
|
backgroundthread.cpp
|
2010-02-28 18:28:56 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
# Header files that have Q_OBJECT in
|
|
|
|
set(CLEMENTINE-MOC-HEADERS
|
|
|
|
mainwindow.h
|
|
|
|
player.h
|
|
|
|
library.h
|
|
|
|
librarybackend.h
|
|
|
|
playlist.h
|
|
|
|
enginebase.h
|
|
|
|
sliderwidget.h
|
|
|
|
playlistview.h
|
|
|
|
backgroundthread.h
|
|
|
|
librarywatcher.h
|
|
|
|
songmimedata.h
|
|
|
|
libraryview.h
|
|
|
|
libraryconfig.h
|
|
|
|
systemtrayicon.h
|
|
|
|
fileview.h
|
|
|
|
fileviewlist.h
|
|
|
|
playlistheader.h
|
|
|
|
radioservice.h
|
|
|
|
lastfmservice.h
|
|
|
|
radiomodel.h
|
|
|
|
lastfmconfig.h
|
|
|
|
busyindicator.h
|
|
|
|
radiomimedata.h
|
|
|
|
radioview.h
|
|
|
|
lastfmstationdialog.h
|
|
|
|
osd.h
|
|
|
|
trackslider.h
|
|
|
|
edittagdialog.h
|
|
|
|
lineedit.h
|
|
|
|
multiloadingindicator.h
|
|
|
|
somafmservice.h
|
|
|
|
settingsdialog.h
|
|
|
|
librarydirectorymodel.h
|
|
|
|
libraryconfigdialog.h
|
|
|
|
lastfmconfigdialog.h
|
|
|
|
about.h
|
|
|
|
albumcoverfetcher.h
|
|
|
|
addstreamdialog.h
|
|
|
|
savedradio.h
|
2010-02-28 19:04:50 +01:00
|
|
|
albumcovermanager.h
|
|
|
|
albumcoverloader.h
|
2010-03-01 16:40:12 +01:00
|
|
|
m3uparser.h
|
2010-03-08 19:05:41 +01:00
|
|
|
playlistsequence.h
|
2010-03-09 18:17:32 +01:00
|
|
|
xspfparser.h
|
2010-03-20 23:45:54 +01:00
|
|
|
analyzers/analyzercontainer.h
|
|
|
|
analyzers/baranalyzer.h
|
|
|
|
analyzers/blockanalyzer.h
|
|
|
|
analyzers/analyzerbase.h
|
2010-03-21 18:22:05 +01:00
|
|
|
analyzers/boomanalyzer.h
|
|
|
|
analyzers/sonogram.h
|
|
|
|
analyzers/turbine.h
|
2010-03-21 20:02:56 +01:00
|
|
|
globalshortcuts/globalshortcuts.h
|
2010-02-28 18:28:56 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
# UI files
|
|
|
|
set(CLEMENTINE-UI
|
|
|
|
mainwindow.ui
|
|
|
|
libraryconfig.ui
|
|
|
|
fileview.ui
|
|
|
|
lastfmconfig.ui
|
|
|
|
lastfmstationdialog.ui
|
|
|
|
trackslider.ui
|
|
|
|
edittagdialog.ui
|
|
|
|
multiloadingindicator.ui
|
|
|
|
settingsdialog.ui
|
|
|
|
libraryconfigdialog.ui
|
|
|
|
lastfmconfigdialog.ui
|
|
|
|
about.ui
|
|
|
|
addstreamdialog.ui
|
2010-02-28 19:04:50 +01:00
|
|
|
albumcovermanager.ui
|
2010-03-08 19:05:41 +01:00
|
|
|
playlistsequence.ui
|
2010-02-28 18:28:56 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
# Resource files
|
|
|
|
set(CLEMENTINE-RESOURCES
|
|
|
|
../data/data.qrc
|
|
|
|
)
|
|
|
|
|
2010-03-01 18:31:54 +01:00
|
|
|
# Translations
|
|
|
|
file (GLOB TRANSLATIONS_FILES *.ts)
|
|
|
|
set (FILES_TO_TRANSLATE ${CLEMENTINE-SOURCES} ${CLEMENTINE-UI} ${CLEMENTINE-MOC-HEADERS})
|
|
|
|
|
|
|
|
option (UPDATE_TRANSLATIONS "Update source translation translations/*.ts files
|
|
|
|
(WARNING: make clean will delete the source .ts files! Danger!)")
|
|
|
|
if (UPDATE_TRANSLATIONS)
|
|
|
|
qt4_create_translation(CLEMENTINE-QM-FILES ${FILES_TO_TRANSLATE} ${TRANSLATIONS_FILES})
|
|
|
|
else (UPDATE_TRANSLATIONS)
|
|
|
|
qt4_add_translation(CLEMENTINE-QM-FILES ${TRANSLATIONS_FILES})
|
|
|
|
endif (UPDATE_TRANSLATIONS)
|
|
|
|
|
|
|
|
# Generate a qrc file for the translations
|
|
|
|
set(CLEMENTINE-QM-RESOURCE ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc)
|
|
|
|
file(WRITE ${CLEMENTINE-QM-RESOURCE} "<RCC><qresource prefix=\"/translations\">")
|
|
|
|
foreach(QM-FILE ${CLEMENTINE-QM-FILES})
|
|
|
|
file(RELATIVE_PATH QM-RELATIVE-PATH ${CMAKE_CURRENT_BINARY_DIR} ${QM-FILE})
|
|
|
|
file(APPEND ${CLEMENTINE-QM-RESOURCE} "<file>" ${QM-RELATIVE-PATH} "</file>")
|
|
|
|
endforeach(QM-FILE)
|
|
|
|
file(APPEND ${CLEMENTINE-QM-RESOURCE} "</qresource></RCC>")
|
|
|
|
|
2010-03-02 21:46:46 +01:00
|
|
|
# Audio engine - phonon on windows, xine elsewhere
|
2010-02-28 18:28:56 +01:00
|
|
|
if(WIN32)
|
2010-03-02 21:46:46 +01:00
|
|
|
set(CLEMENTINE-SOURCES ${CLEMENTINE-SOURCES} phononengine.cpp)
|
2010-02-28 18:28:56 +01:00
|
|
|
set(CLEMENTINE-MOC-HEADERS ${CLEMENTINE-MOC-HEADERS} phononengine.h)
|
|
|
|
else(WIN32)
|
|
|
|
set(CLEMENTINE-SOURCES ${CLEMENTINE-SOURCES} xine-engine.cpp xine-scope.c)
|
|
|
|
set(CLEMENTINE-MOC-HEADERS ${CLEMENTINE-MOC-HEADERS} xine-engine.h)
|
|
|
|
endif(WIN32)
|
|
|
|
|
2010-03-02 21:46:46 +01:00
|
|
|
# OSD
|
2010-02-28 18:28:56 +01:00
|
|
|
if(APPLE)
|
|
|
|
set(CLEMENTINE-SOURCES ${CLEMENTINE-SOURCES} osd_mac.mm)
|
|
|
|
else(APPLE)
|
2010-03-02 21:46:46 +01:00
|
|
|
if(WIN32)
|
|
|
|
set(CLEMENTINE-SOURCES ${CLEMENTINE-SOURCES} osd_win.cpp)
|
|
|
|
else(WIN32)
|
|
|
|
set(CLEMENTINE-SOURCES ${CLEMENTINE-SOURCES} osd_x11.cpp)
|
|
|
|
endif(WIN32)
|
2010-02-28 18:28:56 +01:00
|
|
|
endif(APPLE)
|
|
|
|
|
2010-03-02 23:02:43 +01:00
|
|
|
# resource file for windows
|
|
|
|
if(WIN32)
|
2010-03-22 19:35:31 +01:00
|
|
|
set(CLEMENTINE-WIN32-RESOURCES ../dist/windows/windres.rc)
|
2010-03-02 23:02:43 +01:00
|
|
|
endif(WIN32)
|
|
|
|
|
2010-02-28 18:28:56 +01:00
|
|
|
qt4_wrap_cpp(CLEMENTINE-SOURCES-MOC ${CLEMENTINE-MOC-HEADERS})
|
|
|
|
qt4_wrap_ui(CLEMENTINE-SOURCES-UI ${CLEMENTINE-UI})
|
2010-03-01 18:31:54 +01:00
|
|
|
qt4_add_resources(CLEMENTINE-SOURCES-RESOURCE ${CLEMENTINE-RESOURCES} ${CLEMENTINE-QM-RESOURCE})
|
2010-02-28 18:28:56 +01:00
|
|
|
|
|
|
|
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
|
|
|
|
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/qtsingleapplication")
|
|
|
|
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/qxt")
|
2010-03-01 23:00:15 +01:00
|
|
|
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/gmock/gtest/include")
|
2010-02-28 18:28:56 +01:00
|
|
|
|
|
|
|
set(EXECUTABLE_OUTPUT_PATH ..)
|
2010-03-01 02:47:50 +01:00
|
|
|
add_library(clementine_lib
|
2010-02-28 18:28:56 +01:00
|
|
|
${CLEMENTINE-SOURCES}
|
|
|
|
${CLEMENTINE-SOURCES-MOC}
|
|
|
|
${CLEMENTINE-SOURCES-UI}
|
2010-03-01 13:55:51 +01:00
|
|
|
${CLEMENTINE-SOURCES-RESOURCE}
|
2010-03-01 18:31:54 +01:00
|
|
|
${CLEMENTINE-QM-FILES}
|
2010-02-28 18:28:56 +01:00
|
|
|
)
|
2010-03-01 02:47:50 +01:00
|
|
|
target_link_libraries(clementine_lib
|
2010-02-28 18:28:56 +01:00
|
|
|
qtsingleapplication
|
|
|
|
qxt
|
2010-03-02 21:46:46 +01:00
|
|
|
lastfm
|
2010-02-28 18:28:56 +01:00
|
|
|
${XINE_LIBRARIES}
|
|
|
|
${LIBNOTIFY_LIBRARIES}
|
|
|
|
${TAGLIB_LIBRARIES}
|
2010-03-02 21:46:46 +01:00
|
|
|
${QT_LIBRARIES}
|
2010-02-28 18:28:56 +01:00
|
|
|
)
|
2010-02-28 21:55:10 +01:00
|
|
|
if (APPLE)
|
2010-03-01 02:47:50 +01:00
|
|
|
target_link_libraries(clementine_lib
|
2010-02-28 21:55:10 +01:00
|
|
|
${GROWL}
|
|
|
|
)
|
2010-03-01 13:13:11 +01:00
|
|
|
include_directories(${GROWL}/Headers)
|
2010-02-28 21:55:10 +01:00
|
|
|
endif (APPLE)
|
2010-03-01 02:47:50 +01:00
|
|
|
add_dependencies(clementine_lib qtsingleapplication qxt)
|
|
|
|
|
2010-03-22 19:35:31 +01:00
|
|
|
# Link against the qsqlite plugin on windows
|
|
|
|
if(WIN32)
|
|
|
|
set(3RDPARTY_SQLITE_LIBRARY qsqlite)
|
|
|
|
target_link_libraries(clementine_lib qsqlite)
|
|
|
|
endif(WIN32)
|
|
|
|
|
2010-03-01 02:47:50 +01:00
|
|
|
add_executable(clementine
|
|
|
|
MACOSX_BUNDLE
|
2010-03-02 23:02:43 +01:00
|
|
|
WIN32
|
|
|
|
${CLEMENTINE-WIN32-RESOURCES}
|
2010-03-01 02:47:50 +01:00
|
|
|
main.cpp
|
|
|
|
)
|
|
|
|
target_link_libraries(clementine clementine_lib)
|
2010-02-28 18:28:56 +01:00
|
|
|
|
2010-03-24 13:07:37 +01:00
|
|
|
set_property(TARGET clementine clementine_lib
|
2010-02-28 18:28:56 +01:00
|
|
|
PROPERTY COMPILE_FLAGS
|
2010-03-01 13:13:11 +01:00
|
|
|
"-Wnon-virtual-dtor -Woverloaded-virtual -Wall"
|
2010-02-28 18:28:56 +01:00
|
|
|
)
|
|
|
|
|
2010-02-28 21:55:10 +01:00
|
|
|
set_target_properties(clementine PROPERTIES
|
2010-03-22 17:18:03 +01:00
|
|
|
MACOSX_BUNDLE_INFO_STRING "Clementine 0.2"
|
2010-02-28 21:55:10 +01:00
|
|
|
MACOSX_BUNDLE_ICON_FILE "clementine"
|
2010-03-22 17:18:03 +01:00
|
|
|
MACOSX_BUNDLE_SHORT_VERSION_STRING "0.2"
|
2010-02-28 21:55:10 +01:00
|
|
|
)
|
|
|
|
|
2010-02-28 18:28:56 +01:00
|
|
|
install(TARGETS clementine
|
2010-03-01 13:55:51 +01:00
|
|
|
BUNDLE DESTINATION bin
|
2010-03-04 17:41:14 +01:00
|
|
|
RUNTIME DESTINATION bin
|
|
|
|
)
|
|
|
|
|
|
|
|
install(FILES ../dist/clementine_64.png
|
|
|
|
DESTINATION share/icons/hicolor/64x64/apps/
|
|
|
|
RENAME application-x-clementine.png
|
|
|
|
)
|
|
|
|
|
|
|
|
install(FILES ../dist/clementine.desktop
|
|
|
|
DESTINATION share/applications
|
|
|
|
)
|