aboutsummaryrefslogtreecommitdiff
path: root/modules/FindFlac.cmake
diff options
context:
space:
mode:
authorAllen Winter <allen.winter@kdab.com>2011-06-28 17:13:05 -0400
committerAllen Winter <allen.winter@kdab.com>2011-06-28 17:13:05 -0400
commite15ffacc69242c89107afbfda6f8ece9f2b56633 (patch)
tree34bed177321c49f883d9d75616947a18f38c037f /modules/FindFlac.cmake
parent5c79bed7250cb2f854bfb4f20e4d266925d94b54 (diff)
parentc06badd8d431583071cad638fea082ca0776a0a3 (diff)
downloadextra-cmake-modules-e15ffacc69242c89107afbfda6f8ece9f2b56633.tar.gz
extra-cmake-modules-e15ffacc69242c89107afbfda6f8ece9f2b56633.tar.bz2
Merge branch 'allen' of /data/kde/trunk/KDE/kdelibs
Diffstat (limited to 'modules/FindFlac.cmake')
-rw-r--r--modules/FindFlac.cmake34
1 files changed, 34 insertions, 0 deletions
diff --git a/modules/FindFlac.cmake b/modules/FindFlac.cmake
new file mode 100644
index 00000000..208e3fc3
--- /dev/null
+++ b/modules/FindFlac.cmake
@@ -0,0 +1,34 @@
+# - Try to find Flac, the Free Lossless Audio Codec
+# Once done this will define
+#
+# FLAC_FOUND - system has Flac
+# FLAC_INCLUDE_DIR - the Flac include directory
+# FLAC_LIBRARIES - Link these to use Flac
+# FLAC_OGGFLAC_LIBRARIES - Link these to use OggFlac
+#
+# No version checking is done - use FLAC_API_VERSION_CURRENT to
+# conditionally compile version-dependent code
+
+# Copyright (c) 2006, Laurent Montel, <montel@kde.org>
+# Copyright (c) 2006, 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.
+
+FIND_PATH(FLAC_INCLUDE_DIR FLAC/metadata.h)
+
+FIND_LIBRARY(FLAC_LIBRARIES NAMES FLAC )
+
+FIND_LIBRARY(FLAC_OGG_LIBRARY NAMES OggFLAC)
+
+
+IF(FLAC_LIBRARIES AND FLAC_OGG_LIBRARY)
+ SET(FLAC_OGGFLAC_LIBRARIES ${FLAC_OGG_LIBRARY} ${FLAC_LIBRARIES})
+ENDIF(FLAC_LIBRARIES AND FLAC_OGG_LIBRARY)
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Flac REQUIRED_VARS FLAC_LIBRARIES FLAC_INCLUDE_DIR)
+
+# show the FLAC_INCLUDE_DIR and FLAC_LIBRARIES variables only in the advanced view
+MARK_AS_ADVANCED(FLAC_INCLUDE_DIR FLAC_LIBRARIES FLAC_OGG_LIBRARY)
+