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

3
project(juk)
4

5 6 7 8
set(QT_MIN_VERSION "5.6.0")
set(KF5_MIN_VERSION "5.35.0")

find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
9 10 11 12 13 14
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

include(CMakePushCheckState)
include(CheckIncludeFileCXX)
include(KDEInstallDirs)
include(KDECompilerSettings NO_POLICY_SCOPE)
15
include(KDECMakeSettings NO_POLICY_SCOPE)
16 17 18
include(FeatureSummary)
include(ECMInstallIcons)
include(ECMAddAppIcon)
19
include(ECMQtDeclareLoggingCategory)
20

21
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Gui Svg Network Test Widgets)
22
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS CoreAddons Completion Config GlobalAccel
Michael Pyne's avatar
Michael Pyne committed
23 24
	I18n IconThemes DocTools KIO JobWidgets Notifications TextWidgets XmlGui Wallet
	WidgetsAddons WindowSystem)
25
find_package(Phonon4Qt5 4.6.60 REQUIRED NO_MODULE)
26

27
find_package(Taglib 1.6 REQUIRED)
28

29
include_directories(${CMAKE_BINARY_DIR} ${PHONON_INCLUDES})
Laurent Montel's avatar
Laurent Montel committed
30

Dirk Mueller's avatar
Dirk Mueller committed
31
add_subdirectory( doc )
32
add_subdirectory( tests )
33
add_subdirectory( pics )
34

35 36
find_package(TunePimp)
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.")
37 38 39 40 41 42 43 44 45 46 47
if(TUNEPIMP_FOUND)
	set(HAVE_TUNEPIMP 1)
	if(TUNEPIMP_FOUND_VERSION_4)
		set(HAVE_TUNEPIMP 4)
        endif(TUNEPIMP_FOUND_VERSION_4)	
        if(TUNEPIMP_FOUND_VERSION_5)
                set(HAVE_TUNEPIMP 5)
        endif(TUNEPIMP_FOUND_VERSION_5) 	
else(TUNEPIMP_FOUND)
	set(HAVE_TUNEPIMP 0)
endif(TUNEPIMP_FOUND)	
48

49 50
########### next target ###############

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

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

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

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

Laurent Montel's avatar
Laurent Montel committed
68
set(juk_SRCS  ${tunepimp_SRCS}
69
   advancedsearchdialog.cpp
70 71 72
   slider.cpp
   svghandler.cpp
   volumepopupbutton.cpp
73 74 75 76 77 78 79 80
   actioncollection.cpp
   cache.cpp
   categoryreaderinterface.cpp
   collectionlist.cpp
   coverdialog.cpp
   covericonview.cpp
   coverinfo.cpp
   covermanager.cpp
81
   coverproxy.cpp
82 83 84 85 86 87 88 89 90 91 92 93 94 95
   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
96
   lyricswidget.cpp
97 98
   main.cpp
   mediafiles.cpp
Michael Pyne's avatar
Michael Pyne committed
99 100 101
   mpris2/mediaplayer2.cpp
   mpris2/mediaplayer2player.cpp
   mpris2/mpris2.cpp
102 103 104 105 106 107 108 109 110 111
   musicbrainzquery.cpp
   nowplaying.cpp
   playermanager.cpp
   playlist.cpp
   playlistbox.cpp
   playlistcollection.cpp
   playlistinterface.cpp
   playlistitem.cpp
   playlistsearch.cpp
   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 131
   searchplaylist.cpp
   searchwidget.cpp
   slideraction.cpp
   sortedstringlist.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
132 133
   viewmode.cpp )

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

137
qt5_add_dbus_adaptor( juk_SRCS org.kde.juk.collection.xml
138
    dbuscollectionproxy.h DBusCollectionProxy )
139 140
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
141

142

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

155 156 157
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})
158

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

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

166
target_link_libraries(juk ${LIBMATH} Qt5::Gui Qt5::Svg Qt5::Widgets
167
    Qt5::Network KF5::ConfigCore KF5::CoreAddons KF5::Completion KF5::GlobalAccel
Michael Pyne's avatar
Michael Pyne committed
168
    KF5::KIOCore KF5::KIOWidgets KF5::KIOFileWidgets KF5::JobWidgets KF5::Notifications
169
    KF5::I18n KF5::IconThemes KF5::TextWidgets KF5::XmlGui KF5::WindowSystem
Michael Pyne's avatar
Michael Pyne committed
170
    KF5::WidgetsAddons KF5::Wallet Phonon::phonon4qt5 ${TAGLIB_LIBRARIES})
171 172 173 174
if(TUNEPIMP_FOUND)
	target_link_libraries(juk ${TUNEPIMP_LIBRARIES})
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 )
184
install( FILES org.kde.juk.appdata.xml DESTINATION ${SHARE_INSTALL_PREFIX}/metainfo )
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
)