[cmake-developers] inappropriate use of PATH_SUFFIXES in FindALSA?

Philip Lowman philip at yhbt.com
Sat Feb 11 08:14:05 EST 2012


On Thu, Feb 9, 2012 at 8:57 AM, Brad King <brad.king at kitware.com> wrote:
>> To summarize, if the C code actually includes alsa/asoundlib.h, then
>> wouldn't it
>> be appropriate to use exactly the same path, alsa/asoundlib.h, with
>> find_path
>> like this:
>> find_path(ALSA_INCLUDE_DIR NAMES alsa/asoundlib.h
>>           DOC "The ALSA (asound) include directory"
>> )
>
> I think so.  Philip?

When I wrote that code the alsa project had somewhat recently started
putting it's 'asoundlib.h' header files in <PREFIX>/include/alsa, but
earlier releases had them in <PREFIX>/include directly.  So the
PATH_SUFFIXES was put there for compatibility reasons.

I apologize for not adding a comment for this in the module.  Is the
PATH_SUFFIXES causing any problems?  Is there any reason we should
convert to "NAMES alsa/asoundlib.h asoundlib.h"?

I'll add a comment regardless of what we end up doing, but I don't see
the behavior as a bug.  If the user has either
/usr/local/include/asoundlib.h OR /usr/local/include/alsa/asoundlib.h,
CMake will find /usr/local/include for the path.

==

Here is something on their wiki showing a make install output:
http://www.alsa-project.org/alsa-doc/alsa-lib/files.html
Here is somebodies autoconf script where they check for an alsa header
in include & include/alsa:
http://marchdown.xenoethics.org/src/emacs/configure.in

-- 
Philip Lowman



More information about the cmake-developers mailing list