CMakeLists.txt 5.92 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 "19")
6
set (KDE_APPLICATIONS_VERSION_MINOR "07")
7
set (KDE_APPLICATIONS_VERSION_MICRO "70")
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 Concurrent 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 ###############

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
set(juk_SRCS
62
   advancedsearchdialog.cpp
63 64 65
   slider.cpp
   svghandler.cpp
   volumepopupbutton.cpp
66 67 68 69 70 71 72 73
   actioncollection.cpp
   cache.cpp
   categoryreaderinterface.cpp
   collectionlist.cpp
   coverdialog.cpp
   covericonview.cpp
   coverinfo.cpp
   covermanager.cpp
74
   coverproxy.cpp
75 76 77
   dbuscollectionproxy.cpp
   deletedialog.cpp
   directorylist.cpp
78
   directoryloader.cpp
79 80 81 82 83 84 85 86 87 88 89
   dynamicplaylist.cpp
   exampleoptions.cpp
   folderplaylist.cpp
   filehandle.cpp
   filerenamer.cpp
   filerenameroptions.cpp
   filerenamerconfigdlg.cpp
   webimagefetcher.cpp
   historyplaylist.cpp
   juk.cpp
   keydialog.cpp
90
   lyricswidget.cpp
91 92
   main.cpp
   mediafiles.cpp
Michael Pyne's avatar
Michael Pyne committed
93 94 95
   mpris2/mediaplayer2.cpp
   mpris2/mediaplayer2player.cpp
   mpris2/mpris2.cpp
96 97 98 99 100 101 102 103
   nowplaying.cpp
   playermanager.cpp
   playlist.cpp
   playlistbox.cpp
   playlistcollection.cpp
   playlistinterface.cpp
   playlistitem.cpp
   playlistsearch.cpp
104
   playlistsharedsettings.cpp
105
   playlistsplitter.cpp
106
   scrobbler.cpp
107
   scrobbleconfigdlg.cpp
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
   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
124 125
   viewmode.cpp )

126 127 128
ecm_qt_declare_logging_category(juk_SRCS HEADER juk_debug.h
                                IDENTIFIER JUK_LOG CATEGORY_NAME org.kde.juk)

129
qt5_add_dbus_adaptor( juk_SRCS org.kde.juk.collection.xml
130
    dbuscollectionproxy.h DBusCollectionProxy )
131 132
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)
133

134

135
ki18n_wrap_ui(juk_SRCS
136 137
	filerenamerbase.ui
	filerenameroptionsbase.ui
Laurent Montel's avatar
Laurent Montel committed
138 139
	directorylistbase.ui
	tagguesserconfigdlgwidget.ui
140
	exampleoptionsbase.ui
141
	coverdialogbase.ui
142
	deletedialogbase.ui
143
	tageditor.ui
144 145
)

146 147 148
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})
149

150
kde_target_enable_exceptions(juk PRIVATE)
151
target_compile_definitions(juk PRIVATE QT_USE_QSTRINGBUILDER)
152

153
if(NOT MSVC AND NOT ( WIN32 AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel" ) )
Pau Garcia i Quiles's avatar
Pau Garcia i Quiles committed
154
    set( LIBMATH m )
155
endif()
Pau Garcia i Quiles's avatar
Pau Garcia i Quiles committed
156

157
target_link_libraries(juk ${LIBMATH} Qt5::Gui Qt5::Svg Qt5::Widgets
158
    Qt5::Network KF5::ConfigCore KF5::CoreAddons KF5::Completion KF5::Crash KF5::GlobalAccel
Michael Pyne's avatar
Michael Pyne committed
159
    KF5::KIOCore KF5::KIOWidgets KF5::KIOFileWidgets KF5::JobWidgets KF5::Notifications
160
    KF5::I18n KF5::IconThemes KF5::TextWidgets KF5::XmlGui KF5::WindowSystem
Michael Pyne's avatar
Michael Pyne committed
161
    KF5::WidgetsAddons KF5::Wallet Phonon::phonon4qt5 ${TAGLIB_LIBRARIES})
162

163
if(TUNEPIMP_FOUND)
164
    target_link_libraries(juk ${TUNEPIMP_LIBRARIES})
165 166
endif(TUNEPIMP_FOUND)

167
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
168

Laurent Montel's avatar
Laurent Montel committed
169
install(TARGETS juk  ${INSTALL_TARGETS_DEFAULT_ARGS} )
170 171 172 173


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

174
install( PROGRAMS org.kde.juk.desktop  DESTINATION  ${XDG_APPS_INSTALL_DIR} )
175
install( FILES juk.notifyrc jukui.rc jukui-rtl.rc  DESTINATION  ${KXMLGUI_INSTALL_DIR}/juk )
Rex Dieter's avatar
Rex Dieter committed
176
install( FILES org.kde.juk.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR} )
177 178
install( FILES jukservicemenu.desktop  DESTINATION
${SERVICES_INSTALL_DIR}/ServiceMenus )
179
install( FILES org.kde.juk.collection.xml org.kde.juk.player.xml org.kde.juk.search.xml DESTINATION ${DBUS_INTERFACES_INSTALL_DIR} )
180

181 182 183 184 185 186 187 188 189
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
)