Warning, /multimedia/kwave/cmake/KwaveLibaudiofileSupport.cmake is written in an unsupported language. File is not indexed.

0001 #############################################################################
0002 ##    Kwave                - cmake/KwaveLibaudiofileSupport.txt
0003 ##                           -------------------
0004 ##    begin                : Tue May 22 2007
0005 ##    copyright            : (C) 2007 by Thomas Eschenbacher
0006 ##    email                : Thomas.Eschenbacher@gmx.de
0007 #############################################################################
0008 #
0009 #############################################################################
0010 #                                                                           #
0011 # Redistribution and use in source and binary forms, with or without        #
0012 # modification, are permitted provided that the following conditions        #
0013 # are met:                                                                  #
0014 #                                                                           #
0015 # 1. Redistributions of source code must retain the above copyright         #
0016 #    notice, this list of conditions and the following disclaimer.          #
0017 # 2. Redistributions in binary form must reproduce the above copyright      #
0018 #    notice, this list of conditions and the following disclaimer in the    #
0019 #    documentation and/or other materials provided with the distribution.   #
0020 #                                                                           #
0021 # For details see the accompanying cmake/COPYING-CMAKE-SCRIPTS file.        #
0022 #                                                                           #
0023 #############################################################################
0024 
0025 INCLUDE(CheckLibraryExists)
0026 INCLUDE(FindPkgConfig)
0027 INCLUDE(UsePkgConfig)
0028 INCLUDE(CheckTypeSize)
0029 
0030 PKG_CHECK_MODULES(LIBAUDIOFILE REQUIRED audiofile>=0.3.0)
0031 
0032 #############################################################################
0033 ### check if the system has audiofile.h                                   ###
0034 
0035 FIND_PATH(HAVE_AUDIOFILE_H audiofile.h)
0036 FIND_PATH(HAVE_AFS_VFS_H   af_vfs.h)
0037 
0038 #############################################################################
0039 ### system libaudiofile can be used & header exists: check for functions  ###
0040 
0041 IF (HAVE_AUDIOFILE_H AND HAVE_AFS_VFS_H)
0042     CHECK_LIBRARY_EXISTS(audiofile afOpenVirtualFile ${LIBAUDIOFILE_LIBDIR} HAVE_AF_OPEN_VIRTUAL_FILE)
0043 ENDIF (HAVE_AUDIOFILE_H AND HAVE_AFS_VFS_H)
0044 
0045 # check for compression types
0046 SET(CMAKE_EXTRA_INCLUDE_FILES "audiofile.h")
0047 CHECK_TYPE_SIZE("sizeof(AF_COMPRESSION_FLAC)" AF_COMPRESSION_FLAC)
0048 CHECK_TYPE_SIZE("sizeof(AF_COMPRESSION_ALAC)" AF_COMPRESSION_ALAC)
0049 SET(CMAKE_EXTRA_INCLUDE_FILES)
0050 
0051 #############################################################################
0052 ### some verbose output of the result                                     ###
0053 
0054 IF (HAVE_AF_OPEN_VIRTUAL_FILE)
0055     # system libaudiofile is ok and will be used
0056     MESSAGE(STATUS "Found libaudiofile")
0057 ELSE (HAVE_AF_OPEN_VIRTUAL_FILE)
0058     # system libaudiofile should be used but is not ok -> FAIL
0059     MESSAGE(FATAL_ERROR "system libaudiofile is missing or cannot be used")
0060 ENDIF (HAVE_AF_OPEN_VIRTUAL_FILE)
0061 
0062 SET(HAVE_LIBAUDIOFILE ON)
0063 
0064 #############################################################################
0065 #############################################################################