blob: af9e9c88c8ff51d4b51492f76f7406040b7457c9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
diff -urN phonon-backend-gstreamer-4.5.1.old/cmake/FindPhonon.cmake phonon-backend-gstreamer-4.5.1/cmake/FindPhonon.cmake
--- phonon-backend-gstreamer-4.5.1.old/cmake/FindPhonon.cmake 2011-05-04 06:34:52.000000000 +0200
+++ phonon-backend-gstreamer-4.5.1/cmake/FindPhonon.cmake 2011-12-30 12:22:03.623333200 +0100
@@ -1,53 +1,16 @@
# Find Phonon
# Copyright (c) 2010, Harald Sitter <sitter@kde.org>
+# Copyright (c) 2011, Alexander Neundorf <neundorf@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-if (NOT PHONON_BUILDSYSTEM_DIR)
- find_program(PC_EXECUTABLE NAMES pkg-config
- PATH_SUFFIXES bin
- HINTS
- ${CMAKE_INSTALL_PREFIX}
- ONLY_CMAKE_FIND_ROOT_PATH
- )
-
- if (NOT PC_EXECUTABLE)
- if (Phonon_FIND_REQUIRED)
- message(FATAL_ERROR "ERROR: Could not find pkg-config [required to find Phonon].")
- endif (Phonon_FIND_REQUIRED)
- endif (NOT PC_EXECUTABLE)
-
- if (PC_EXECUTABLE)
- execute_process(COMMAND "${PC_EXECUTABLE}" --variable=buildsystemdir phonon
- OUTPUT_VARIABLE _data_DIR
- ERROR_QUIET
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- file(TO_CMAKE_PATH "${_data_DIR}" _data_DIR)
- find_path(PHONON_BUILDSYSTEM_DIR FindPhononInternal.cmake HINTS ${_data_DIR})
- endif (PC_EXECUTABLE)
-endif (NOT PHONON_BUILDSYSTEM_DIR)
-
-if (PHONON_BUILDSYSTEM_DIR)
+find_package(Phonon NO_MODULE)
+if(PHONON_FOUND)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PHONON_BUILDSYSTEM_DIR})
+endif()
- if (Phonon_FIND_REQUIRED)
- set(_req REQUIRED)
- endif (Phonon_FIND_REQUIRED)
- if (PHONON_FIND_QUIETLY)
- set(_quiet QUIET)
- endif (PHONON_FIND_QUIETLY)
+include(FindPackageHandleStandardArgs)
- find_package(PhononInternal ${_req} ${_quiet})
-else (PHONON_BUILDSYSTEM_DIR)
- if (_data_DIR)
- if (Phonon_FIND_REQUIRED)
- message(FATAL_ERROR "ERROR: FindPhonon.cmake not found in ${_data_DIR}")
- endif (Phonon_FIND_REQUIRED)
- else (_data_DIR)
- if (Phonon_FIND_REQUIRED)
- message(FATAL_ERROR "ERROR: Either pkg-config can not find its phonon config, or you are not using a recent enough Phonon version.")
- endif (Phonon_FIND_REQUIRED)
- endif (_data_DIR)
-endif (PHONON_BUILDSYSTEM_DIR)
+find_package_handle_standard_args(Phonon DEFAULT_MSG Phonon_DIR )
|