From 815485e9333e07fbbac66bfc415fa2ae5cbe8a85 Mon Sep 17 00:00:00 2001 From: Philip Lowman Date: Sat, 11 Feb 2012 18:51:22 -0500 Subject: [PATCH 1/2] FindALSA: Fix incorrect include path detection This fixes a bug where the alsa include path was being detected incorrectly (e.g. /usr/local/include/alsa instead of /usr/local/include) --- Modules/FindALSA.cmake | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Modules/FindALSA.cmake b/Modules/FindALSA.cmake index ec6e3a882..41c4e305c 100644 --- a/Modules/FindALSA.cmake +++ b/Modules/FindALSA.cmake @@ -12,8 +12,8 @@ # #============================================================================= -# Copyright 2009 Kitware, Inc. -# Copyright 2009 Philip Lowman +# Copyright 2009-2011 Kitware, Inc. +# Copyright 2009-2011 Philip Lowman # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -25,8 +25,9 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -find_path(ALSA_INCLUDE_DIR NAMES asoundlib.h - PATH_SUFFIXES alsa +# Try to find asoundlib.h both in /include/alsa and /include +# since older versions of ALSA put it in include directly +find_path(ALSA_INCLUDE_DIR NAMES alsa/asoundlib.h asoundlib.h DOC "The ALSA (asound) include directory" ) From 11cf52ebce8ee9bef4e79cfee3043016387f75b0 Mon Sep 17 00:00:00 2001 From: Philip Lowman Date: Sat, 11 Feb 2012 20:37:48 -0500 Subject: [PATCH 2/2] FindALSA: Fix version detection after last commit Also, removed detection of header file from /include. Can't find any example in alsa source code where the library headers were installed outside of /include/alsa. --- Modules/FindALSA.cmake | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Modules/FindALSA.cmake b/Modules/FindALSA.cmake index 41c4e305c..4a0b69303 100644 --- a/Modules/FindALSA.cmake +++ b/Modules/FindALSA.cmake @@ -25,9 +25,7 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -# Try to find asoundlib.h both in /include/alsa and /include -# since older versions of ALSA put it in include directly -find_path(ALSA_INCLUDE_DIR NAMES alsa/asoundlib.h asoundlib.h +find_path(ALSA_INCLUDE_DIR NAMES alsa/asoundlib.h DOC "The ALSA (asound) include directory" ) @@ -35,8 +33,8 @@ find_library(ALSA_LIBRARY NAMES asound DOC "The ALSA (asound) library" ) -if(ALSA_INCLUDE_DIR AND EXISTS "${ALSA_INCLUDE_DIR}/version.h") - file(STRINGS "${ALSA_INCLUDE_DIR}/version.h" alsa_version_str REGEX "^#define[\t ]+SND_LIB_VERSION_STR[\t ]+\".*\"") +if(ALSA_INCLUDE_DIR AND EXISTS "${ALSA_INCLUDE_DIR}/alsa/version.h") + 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}") unset(alsa_version_str)