summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Whiting <jpwhiting@kde.org>2015-09-03 21:43:41 (GMT)
committerJeremy Whiting <jpwhiting@kde.org>2015-09-03 21:43:41 (GMT)
commit619b57c56e583f8b0f5db0cc50449b63de91c4bf (patch)
treeaba245870a74e717bd55cf3d84c4f61947647725
parent46f8c6a334a3007fb370e541ed7748d1b532255f (diff)
Initial port to Qt5/KF5 and Phonon4Qt5
-rw-r--r--CMakeLists.txt40
-rw-r--r--phonon_interface.cpp10
2 files changed, 37 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 030a1b1..49803c0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,19 +1,40 @@
-project(libkcompactdisc)
+cmake_minimum_required(VERSION 2.8.12)
-find_package(KDE4 REQUIRED)
-include(KDE4Defaults)
-include(MacroLibrary)
+project(libkcompactdisc)
-add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
+include(FeatureSummary)
+find_package(Qt5 REQUIRED COMPONENTS Core Qml Quick OpenGL)
+
+find_package(ECM 1.7.0 NO_MODULE REQUIRED)
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
+
+include(ECMAddAppIcon)
+include(KDEInstallDirs)
+include(KDECMakeSettings)
+include(KDECompilerSettings)
+include(ECMInstallIcons)
+include(ECMAddAppIcon)
+
+find_package(KF5 REQUIRED COMPONENTS
+ I18n
+ Crash
+ CoreAddons
+ DocTools
+ KIO
+ Solid
+ KDELibs4Support
+)
+find_package(Phonon4Qt5 CONFIG REQUIRED)
+include_directories (${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} )
## Compiler flags
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_C_FLAGS "-std=c99") ## ALSA no longer compiles with -std=c90, see https://bugzilla.novell.com/show_bug.cgi?id=817077
endif()
+
find_package(Alsa)
alsa_configure_file(${CMAKE_CURRENT_BINARY_DIR}/config-alsa.h)
-include_directories(${KDE4_INCLUDES})
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
@@ -61,13 +82,16 @@ if (USE_WMLIB)
add_definitions(-DUSE_WMLIB=1)
endif (USE_WMLIB)
-kde4_add_library(kcompactdisc SHARED ${kcompactdisc_LIB_SRCS})
+add_library(kcompactdisc SHARED ${kcompactdisc_LIB_SRCS})
-target_link_libraries(kcompactdisc ${KDE4_KDECORE_LIBS} ${KDE4_PHONON_LIBS} ${KDE4_SOLID_LIBS})
+target_link_libraries(kcompactdisc
+ KF5::KDELibs4Support
+ Phonon::phonon4qt5 )
if (HAVE_LIBASOUND2)
target_link_libraries(kcompactdisc ${ASOUND_LIBRARY})
endif (HAVE_LIBASOUND2)
if (USE_WMLIB)
+ find_package(Threads)
target_link_libraries(kcompactdisc ${CMAKE_THREAD_LIBS_INIT})
endif (USE_WMLIB)
diff --git a/phonon_interface.cpp b/phonon_interface.cpp
index 61893a6..5bda8df 100644
--- a/phonon_interface.cpp
+++ b/phonon_interface.cpp
@@ -26,11 +26,11 @@
#include <kdebug.h>
#include <klocale.h>
-#include <Phonon/Global>
-#include <Phonon/MediaObject>
-#include <Phonon/AudioOutput>
-#include <Phonon/Path>
-#include <Phonon/MediaController>
+#include <phonon/Global>
+#include <phonon/MediaObject>
+#include <phonon/AudioOutput>
+#include <phonon/Path>
+#include <phonon/MediaController>
#include <solid/device.h>
#include <solid/opticaldrive.h>