CMakeLists.txt 6.11 KB
Newer Older
1
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
2

3 4
# KDE Application Version, managed by KDE release team automatically
# https://community.kde.org/Guidelines_and_HOWTOs/Application_Versioning
5
set (KDE_APPLICATIONS_VERSION_MAJOR "18")
6
set (KDE_APPLICATIONS_VERSION_MINOR "04")
7
set (KDE_APPLICATIONS_VERSION_MICRO "2")
8 9 10
set (KDE_APPLICATIONS_VERSION "${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}.${KDE_APPLICATIONS_VERSION_MICRO}")

project(juk VERSION ${KDE_APPLICATIONS_VERSION})
11

12 13 14 15
set(QT_MIN_VERSION "5.6.0")
set(KF5_MIN_VERSION "5.35.0")

find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
16
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
17 18 19 20 21

include(CMakePushCheckState)
include(CheckIncludeFileCXX)
include(KDEInstallDirs)
include(KDECompilerSettings NO_POLICY_SCOPE)
22
include(KDECMakeSettings NO_POLICY_SCOPE)
23 24 25
include(FeatureSummary)
include(ECMInstallIcons)
include(ECMAddAppIcon)
26
include(ECMQtDeclareLoggingCategory)
27

28
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Gui Svg Network Test Widgets)
29
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS CoreAddons Completion Config Crash GlobalAccel
Michael Pyne's avatar
Michael Pyne committed
30 31
	I18n IconThemes DocTools KIO JobWidgets Notifications TextWidgets XmlGui Wallet
	WidgetsAddons WindowSystem)
32
find_package(Phonon4Qt5 4.6.60 REQUIRED NO_MODULE)
33

34
find_package(Taglib 1.6 REQUIRED)
35

36
include_directories(${CMAKE_BINARY_DIR} ${PHONON_INCLUDES})
Laurent Montel's avatar
Laurent Montel committed
37

Dirk Mueller's avatar
Dirk Mueller committed
38
add_subdirectory( doc )
39
add_subdirectory( tests )
40
add_subdirectory( pics )
41

42
set_package_properties(FEATURE PROPERTIES DESCRIPTION "A library for developing MusicBrainz enabled tagging applications" URL "http://www.musicbrainz.org/products/tunepimp" TYPE OPTIONAL PURPOSE "Provides MusicBrainz tagging in Juk.")
43 44 45 46

# TODO: tunepimp is fully unsupported, replace this when tunepimp is replaced
# with whatever is actually current this decade.
set(HAVE_TUNEPIMP 0)
47

48 49
########### next target ###############

Michael Pyne's avatar
Michael Pyne committed
50
include_directories( ${TAGLIB_INCLUDES} )
Michael Pyne's avatar
Michael Pyne committed
51
add_definitions(-DQT_STL -DQT_NO_URL_CAST_FROM_STRING)
52

53
# Look for Ogg Opus support in taglib (not released yet)
54
cmake_push_check_state()
55 56
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${TAGLIB_INCLUDES})
check_include_file_cxx(opusfile.h TAGLIB_HAS_OPUSFILE)
57
cmake_pop_check_state()
58 59 60

configure_file (config-juk.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-juk.h )

61 62 63
set(tunepimp_SRCS)
if(TUNEPIMP_FOUND)
	set(tunepimp_SRCS trackpickerdialog.cpp)
64
	include_directories( ${TUNEPIMP_INCLUDE_DIR} )
65 66
endif(TUNEPIMP_FOUND)	

Laurent Montel's avatar
Laurent Montel committed
67
set(juk_SRCS  ${tunepimp_SRCS}
68
   advancedsearchdialog.cpp
69 70 71
   slider.cpp
   svghandler.cpp
   volumepopupbutton.cpp
72 73 74 75 76 77 78 79
   actioncollection.cpp
   cache.cpp
   categoryreaderinterface.cpp
   collectionlist.cpp
   coverdialog.cpp
   covericonview.cpp
   coverinfo.cpp
   covermanager.cpp
80
   coverproxy.cpp
81 82 83 84 85 86 87 88 89 90 91 92 93 94
   dbuscollectionproxy.cpp
   deletedialog.cpp
   directorylist.cpp
   dynamicplaylist.cpp
   exampleoptions.cpp
   folderplaylist.cpp
   filehandle.cpp
   filerenamer.cpp
   filerenameroptions.cpp
   filerenamerconfigdlg.cpp
   webimagefetcher.cpp
   historyplaylist.cpp
   juk.cpp
   keydialog.cpp
95
   lyricswidget.cpp
96 97
   main.cpp
   mediafiles.cpp
Michael Pyne's avatar
Michael Pyne committed
98 99 100
   mpris2/mediaplayer2.cpp
   mpris2/mediaplayer2player.cpp
   mpris2/mpris2.cpp
101 102 103 104 105 106 107 108 109
   musicbrainzquery.cpp
   nowplaying.cpp
   playermanager.cpp
   playlist.cpp
   playlistbox.cpp
   playlistcollection.cpp
   playlistinterface.cpp
   playlistitem.cpp
   playlistsearch.cpp
110
   playlistsharedsettings.cpp
111
   playlistsplitter.cpp
112
   scrobbler.cpp
113
   scrobbleconfigdlg.cpp
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
   searchplaylist.cpp
   searchwidget.cpp
   slideraction.cpp
   statuslabel.cpp
   stringshare.cpp
   systemtray.cpp
   tag.cpp
   tageditor.cpp
   tagguesser.cpp
   tagguesserconfigdlg.cpp
   tagrenameroptions.cpp
   tagtransactionmanager.cpp
   tracksequenceiterator.cpp
   tracksequencemanager.cpp
   treeviewitemplaylist.cpp
   upcomingplaylist.cpp
   ktrm.cpp
131 132
   viewmode.cpp )

133 134 135
ecm_qt_declare_logging_category(juk_SRCS HEADER juk_debug.h
                                IDENTIFIER JUK_LOG CATEGORY_NAME org.kde.juk)

136
qt5_add_dbus_adaptor( juk_SRCS org.kde.juk.collection.xml
137
    dbuscollectionproxy.h DBusCollectionProxy )
138 139
qt5_add_dbus_adaptor( juk_SRCS org.kde.juk.player.xml playermanager.h PlayerManager)
qt5_add_dbus_adaptor( juk_SRCS org.kde.juk.search.xml searchwidget.h SearchWidget)
Laurent Montel's avatar
Laurent Montel committed
140

141

142
ki18n_wrap_ui(juk_SRCS
143 144
	filerenamerbase.ui
	filerenameroptionsbase.ui
Laurent Montel's avatar
Laurent Montel committed
145 146 147
	directorylistbase.ui
	trackpickerdialogbase.ui
	tagguesserconfigdlgwidget.ui
148
	exampleoptionsbase.ui
Tim Beaulen's avatar
Tim Beaulen committed
149
	coverdialogbase.ui
150
	deletedialogbase.ui
151
	tageditor.ui
152 153
)

154 155 156
file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/*-apps-juk.png")
ecm_add_app_icon(juk_SRCS ICONS ${ICONS_SRCS})
add_executable(juk ${juk_SRCS})
157

158
kde_target_enable_exceptions(juk PRIVATE)
159
target_compile_definitions(juk PRIVATE QT_USE_QSTRINGBUILDER)
160

161
if(NOT MSVC AND NOT ( WIN32 AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel" ) )
Pau Garcia i Quiles's avatar
Pau Garcia i Quiles committed
162
    set( LIBMATH m )
163
endif()
Pau Garcia i Quiles's avatar
Pau Garcia i Quiles committed
164

165
target_link_libraries(juk ${LIBMATH} Qt5::Gui Qt5::Svg Qt5::Widgets
166
    Qt5::Network KF5::ConfigCore KF5::CoreAddons KF5::Completion KF5::Crash KF5::GlobalAccel
Michael Pyne's avatar
Michael Pyne committed
167
    KF5::KIOCore KF5::KIOWidgets KF5::KIOFileWidgets KF5::JobWidgets KF5::Notifications
168
    KF5::I18n KF5::IconThemes KF5::TextWidgets KF5::XmlGui KF5::WindowSystem
Michael Pyne's avatar
Michael Pyne committed
169
    KF5::WidgetsAddons KF5::Wallet Phonon::phonon4qt5 ${TAGLIB_LIBRARIES})
170

171
if(TUNEPIMP_FOUND)
172
    target_link_libraries(juk ${TUNEPIMP_LIBRARIES})
173 174
endif(TUNEPIMP_FOUND)

175
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
176

Laurent Montel's avatar
Laurent Montel committed
177
install(TARGETS juk  ${INSTALL_TARGETS_DEFAULT_ARGS} )
178 179 180 181


########### install files ###############

182
install( PROGRAMS org.kde.juk.desktop  DESTINATION  ${XDG_APPS_INSTALL_DIR} )
183
install( FILES juk.notifyrc jukui.rc jukui-rtl.rc  DESTINATION  ${KXMLGUI_INSTALL_DIR}/juk )
Rex Dieter's avatar
Rex Dieter committed
184
install( FILES org.kde.juk.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR} )
185 186
install( FILES jukservicemenu.desktop  DESTINATION
${SERVICES_INSTALL_DIR}/ServiceMenus )
187
install( FILES org.kde.juk.collection.xml org.kde.juk.player.xml org.kde.juk.search.xml DESTINATION ${DBUS_INTERFACES_INSTALL_DIR} )
188

189 190 191 192 193 194 195 196 197
ecm_install_icons(ICONS
    128-apps-juk.png
    16-apps-juk.png
    32-apps-juk.png
    48-apps-juk.png
    64-apps-juk.png
    DESTINATION ${ICON_INSTALL_DIR}
    THEME hicolor
)