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

3
project(juk)
4

5
find_package(ECM 5.38 REQUIRED NO_MODULE)
6 7 8 9 10 11
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

include(CMakePushCheckState)
include(CheckIncludeFileCXX)
include(KDEInstallDirs)
include(KDECompilerSettings NO_POLICY_SCOPE)
12
include(KDECMakeSettings NO_POLICY_SCOPE)
13 14 15 16 17
include(FeatureSummary)
include(ECMInstallIcons)
include(ECMAddAppIcon)

find_package(Qt5 5.2 REQUIRED COMPONENTS Gui Svg Network Test Widgets)
18 19 20
find_package(KF5 REQUIRED COMPONENTS CoreAddons Completion GlobalAccel
	I18n IconThemes DocTools TextWidgets XmlGui Wallet
	WidgetsAddons WindowSystem KDELibs4Support)
21
find_package(Phonon4Qt5 4.6.60 REQUIRED NO_MODULE)
22

23
find_package(Taglib 1.6 REQUIRED)
24

25
include_directories( ${PHONON_INCLUDES} ${KDE4_INCLUDES} ${QT_INCLUDES} )
Laurent Montel's avatar
Laurent Montel committed
26

Dirk Mueller's avatar
Dirk Mueller committed
27
add_subdirectory( doc )
28
add_subdirectory( tests )
29
add_subdirectory( pics )
30

31 32
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.")
33 34 35 36 37 38 39 40 41 42 43
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)	
44

45 46
########### next target ###############

Michael Pyne's avatar
Michael Pyne committed
47
include_directories( ${TAGLIB_INCLUDES} )
48
add_definitions(-DQT_STL)
49

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

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

58 59 60
set(tunepimp_SRCS)
if(TUNEPIMP_FOUND)
	set(tunepimp_SRCS trackpickerdialog.cpp)
61
	include_directories( ${TUNEPIMP_INCLUDE_DIR} )
62 63
endif(TUNEPIMP_FOUND)	

Laurent Montel's avatar
Laurent Montel committed
64
set(juk_SRCS  ${tunepimp_SRCS}
65
   advancedsearchdialog.cpp
66 67 68
   slider.cpp
   svghandler.cpp
   volumepopupbutton.cpp
69 70 71 72 73 74 75 76
   actioncollection.cpp
   cache.cpp
   categoryreaderinterface.cpp
   collectionlist.cpp
   coverdialog.cpp
   covericonview.cpp
   coverinfo.cpp
   covermanager.cpp
77
   coverproxy.cpp
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
   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
   k3bexporter.cpp
   keydialog.cpp
93
   lyricswidget.cpp
94 95
   main.cpp
   mediafiles.cpp
Michael Pyne's avatar
Michael Pyne committed
96 97 98
   mpris2/mediaplayer2.cpp
   mpris2/mediaplayer2player.cpp
   mpris2/mpris2.cpp
99 100 101 102 103 104 105 106 107 108 109
   musicbrainzquery.cpp
   nowplaying.cpp
   playermanager.cpp
   playlist.cpp
   playlistbox.cpp
   playlistcollection.cpp
   playlistexporter.cpp
   playlistinterface.cpp
   playlistitem.cpp
   playlistsearch.cpp
   playlistsplitter.cpp
110
   scrobbler.cpp
111
   scrobbleconfigdlg.cpp
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
   searchplaylist.cpp
   searchwidget.cpp
   slideraction.cpp
   sortedstringlist.cpp
   splashscreen.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
qt5_add_dbus_adaptor( juk_SRCS org.kde.juk.collection.xml
134
    dbuscollectionproxy.h DBusCollectionProxy )
135 136
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
137

138

139
qt5_wrap_ui(juk_SRCS
140 141
	filerenamerbase.ui
	filerenameroptionsbase.ui
Laurent Montel's avatar
Laurent Montel committed
142 143 144
	directorylistbase.ui
	trackpickerdialogbase.ui
	tagguesserconfigdlgwidget.ui
145
	exampleoptionsbase.ui
Tim Beaulen's avatar
Tim Beaulen committed
146
	coverdialogbase.ui
147
	deletedialogbase.ui
148
	tageditor.ui
149 150
)

151 152 153
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})
154

155 156
kde_target_enable_exceptions(juk PRIVATE)

157
if(NOT MSVC AND NOT ( WIN32 AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel" ) )
Pau Garcia i Quiles's avatar
Pau Garcia i Quiles committed
158
    set( LIBMATH m )
159
endif()
Pau Garcia i Quiles's avatar
Pau Garcia i Quiles committed
160

161 162 163
target_link_libraries(juk ${LIBMATH} Qt5::Gui Qt5::Svg Qt5::Widgets
    Qt5::Network KF5::CoreAddons KF5::Completion KF5::GlobalAccel
    KF5::I18n KF5::IconThemes KF5::TextWidgets KF5::XmlGui KF5::WindowSystem
164
    KF5::WidgetsAddons KF5::Wallet KF5::KDELibs4Support ${PHONON_LIBRARY} ${TAGLIB_LIBRARIES})
165 166 167 168
if(TUNEPIMP_FOUND)
	target_link_libraries(juk ${TUNEPIMP_LIBRARIES})
endif(TUNEPIMP_FOUND)

169

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


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

175
install( PROGRAMS org.kde.juk.desktop  DESTINATION  ${XDG_APPS_INSTALL_DIR} )
176
install( FILES juk.notifyrc jukui.rc jukui-rtl.rc  DESTINATION  ${KXMLGUI_INSTALL_DIR}/juk )
177
install( FILES org.kde.juk.appdata.xml DESTINATION ${SHARE_INSTALL_PREFIX}/metainfo )
178 179
install( FILES jukservicemenu.desktop  DESTINATION
${SERVICES_INSTALL_DIR}/ServiceMenus )
180
install( FILES org.kde.juk.collection.xml org.kde.juk.player.xml org.kde.juk.search.xml DESTINATION ${DBUS_INTERFACES_INSTALL_DIR} )
181

182
ecm_install_icons( ${ICON_INSTALL_DIR}   )