summaryrefslogtreecommitdiff
path: root/src/FindMad.cmake
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@lavabit.com>2009-02-01 13:35:50 +0100
committerLars-Dominik Braun <PromyLOPh@lavabit.com>2009-02-01 13:35:50 +0100
commitc9e23f4e29f08fc53b2306311fa70b1cf4b78b0c (patch)
treecc0f87e31f8528d5eca1b2882449a7071d3cb92e /src/FindMad.cmake
parent516bc854369243b2f1ba4f1c019aca06cbbd736e (diff)
downloadpianobar-c9e23f4e29f08fc53b2306311fa70b1cf4b78b0c.tar.gz
pianobar-c9e23f4e29f08fc53b2306311fa70b1cf4b78b0c.tar.bz2
pianobar-c9e23f4e29f08fc53b2306311fa70b1cf4b78b0c.zip
mp3 playback support
Now libfaad and/or libmad are used for playback. There's currently no remaining time displayed for mp3 playback.
Diffstat (limited to 'src/FindMad.cmake')
-rw-r--r--src/FindMad.cmake35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/FindMad.cmake b/src/FindMad.cmake
new file mode 100644
index 0000000..f05f469
--- /dev/null
+++ b/src/FindMad.cmake
@@ -0,0 +1,35 @@
+# MAD_INCLUDE_DIRS - where to find curl/curl.h, etc.
+# MAD_LIBRARIES - List of libraries when using curl.
+# MAD_FOUND - True if curl found.
+
+# Look for the header file.
+FIND_PATH(MAD_INCLUDE_DIR NAMES mad.h)
+MARK_AS_ADVANCED(MAD_INCLUDE_DIR)
+
+# Look for the library.
+FIND_LIBRARY(MAD_LIBRARY NAMES mad)
+MARK_AS_ADVANCED(MAD_LIBRARY)
+
+# Copy the results to the output variables.
+IF(MAD_INCLUDE_DIR AND MAD_LIBRARY)
+ SET(MAD_FOUND 1)
+ SET(MAD_LIBRARIES ${MAD_LIBRARY})
+ SET(MAD_INCLUDE_DIRS ${MAD_INCLUDE_DIR})
+ELSE(MAD_INCLUDE_DIR AND MAD_LIBRARY)
+ SET(MAD_FOUND 0)
+ SET(MAD_LIBRARIES)
+ SET(MAD_INCLUDE_DIRS)
+ENDIF(MAD_INCLUDE_DIR AND MAD_LIBRARY)
+
+# Report the results.
+IF(NOT MAD_FOUND)
+ SET(MAD_DIR_MESSAGE
+ "libmad was not found. Make sure MAD_LIBRARY and MAD_INCLUDE_DIR are set.")
+ IF(NOT MAD_FIND_QUIETLY)
+ MESSAGE(STATUS "${MAD_DIR_MESSAGE}")
+ ELSE(NOT MAD_FIND_QUIETLY)
+ IF(MAD_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "${MAD_DIR_MESSAGE}")
+ ENDIF(MAD_FIND_REQUIRED)
+ ENDIF(NOT MAD_FIND_QUIETLY)
+ENDIF(NOT MAD_FOUND)