Merge topic 'alsa_prefix_include_fix'

11cf52e FindALSA: Fix version detection after last commit
815485e FindALSA: Fix incorrect include path detection
This commit is contained in:
David Cole 2012-02-14 16:17:15 -05:00 committed by CMake Topic Stage
commit 4d278e4905
1 changed files with 5 additions and 6 deletions

View File

@ -12,8 +12,8 @@
# #
#============================================================================= #=============================================================================
# Copyright 2009 Kitware, Inc. # Copyright 2009-2011 Kitware, Inc.
# Copyright 2009 Philip Lowman <philip@yhbt.com> # Copyright 2009-2011 Philip Lowman <philip@yhbt.com>
# #
# Distributed under the OSI-approved BSD License (the "License"); # Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details. # see accompanying file Copyright.txt for details.
@ -25,8 +25,7 @@
# (To distribute this file outside of CMake, substitute the full # (To distribute this file outside of CMake, substitute the full
# License text for the above reference.) # License text for the above reference.)
find_path(ALSA_INCLUDE_DIR NAMES asoundlib.h find_path(ALSA_INCLUDE_DIR NAMES alsa/asoundlib.h
PATH_SUFFIXES alsa
DOC "The ALSA (asound) include directory" DOC "The ALSA (asound) include directory"
) )
@ -34,8 +33,8 @@ find_library(ALSA_LIBRARY NAMES asound
DOC "The ALSA (asound) library" DOC "The ALSA (asound) library"
) )
if(ALSA_INCLUDE_DIR AND EXISTS "${ALSA_INCLUDE_DIR}/version.h") if(ALSA_INCLUDE_DIR AND EXISTS "${ALSA_INCLUDE_DIR}/alsa/version.h")
file(STRINGS "${ALSA_INCLUDE_DIR}/version.h" alsa_version_str REGEX "^#define[\t ]+SND_LIB_VERSION_STR[\t ]+\".*\"") file(STRINGS "${ALSA_INCLUDE_DIR}/alsa/version.h" alsa_version_str REGEX "^#define[\t ]+SND_LIB_VERSION_STR[\t ]+\".*\"")
string(REGEX REPLACE "^.*SND_LIB_VERSION_STR[\t ]+\"([^\"]*)\".*$" "\\1" ALSA_VERSION_STRING "${alsa_version_str}") string(REGEX REPLACE "^.*SND_LIB_VERSION_STR[\t ]+\"([^\"]*)\".*$" "\\1" ALSA_VERSION_STRING "${alsa_version_str}")
unset(alsa_version_str) unset(alsa_version_str)