|
From: Yoda-JM <yo...@us...> - 2011-01-19 09:32:08
|
Module: editor
Branch: master
Commit: 1ae340bdbb7a0b2d9802bea189860f440198fafc
Author: Vincent Le Ligeour <yo...@us...>
Date: Wed Jan 19 10:31:31 2011 +0100
Added standalone Phonon detection
---
CMakeLists.txt | 15 ++++++++++++---
cmake/FindPhonon.cmake | 28 ++++++++++++++++++++++++++++
2 files changed, 40 insertions(+), 3 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 860dd55..714c48e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,9 +28,18 @@ find_package(Boost 1.36 REQUIRED COMPONENTS thread regex filesystem system)
include_directories(${Boost_INCLUDE_DIRS})
list(APPEND LIBS ${Boost_LIBRARIES})
-find_package(Qt4 COMPONENTS QtCore QtGui QtXml Phonon REQUIRED)
-include(${QT_USE_FILE})
-list(APPEND LIBS ${QT_LIBRARIES})
+find_package(Phonon)
+if(Phonon_FOUND)
+ include_directories(${Phonon_INCLUDE_DIRS})
+ list(APPEND LIBS ${Phonon_LIBRARIES})
+ find_package(Qt4 COMPONENTS QtCore QtGui QtXml REQUIRED)
+ include(${QT_USE_FILE})
+ list(APPEND LIBS ${QT_LIBRARIES})
+else(Phonon_FOUND)
+ find_package(Qt4 COMPONENTS QtCore QtGui QtXml Phonon REQUIRED)
+ include(${QT_USE_FILE})
+ list(APPEND LIBS ${QT_LIBRARIES})
+endif(Phonon_FOUND)
# Headers that need MOC need to be defined separately
file(GLOB MOC_HEADER_FILES "editorapp.hh" "notelabel.hh" "notegraphwidget.hh")
diff --git a/cmake/FindPhonon.cmake b/cmake/FindPhonon.cmake
new file mode 100644
index 0000000..c3da1a6
--- /dev/null
+++ b/cmake/FindPhonon.cmake
@@ -0,0 +1,28 @@
+# - Try to find Phonon
+# Once done, this will define
+#
+# Phonon_FOUND - system has Phonon
+# Phonon_INCLUDE_DIRS - the Phonon include directories
+# Phonon_LIBRARIES - link these to use Phonon
+#
+# See documentation on how to write CMake scripts at
+# http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries
+
+include(LibFindMacros)
+
+libfind_pkg_check_modules(Phonon_PKGCONF phonon)
+
+find_path(Phonon_INCLUDE_DIR
+ NAMES phonon/Global
+ PATHS ${Phonon_PKGCONF_INCLUDE_DIRS}
+)
+
+find_library(Phonon_LIBRARY
+ NAMES phonon
+ PATHS ${Phonon_PKGCONF_LIBRARY_DIRS}
+)
+
+set(Phonon_PROCESS_INCLUDES Phonon_INCLUDE_DIR)
+set(Phonon_PROCESS_LIBS Phonon_LIBRARY)
+libfind_process(Phonon)
+
|