commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 02/04: cmake: fix FindPortaudio to reject u


From: git
Subject: [Commit-gnuradio] [gnuradio] 02/04: cmake: fix FindPortaudio to reject unsupported API version
Date: Fri, 16 May 2014 23:49:29 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch maint
in repository gnuradio.

commit 7f783624dc36b55ba3b217c13e1bdb09ebdf198b
Author: Peter A. Bigot <address@hidden>
Date:   Sat May 10 07:53:06 2014 -0500

    cmake: fix FindPortaudio to reject unsupported API version
    
    portaudio18 passes the generic test for locating portaudio, but will
    fail when building gr-audio.  Test for the failure before accepting the
    portaudio that was found.
    
    Signed-off-by: Peter A. Bigot <address@hidden>
---
 cmake/Modules/FindPortaudio.cmake | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/cmake/Modules/FindPortaudio.cmake 
b/cmake/Modules/FindPortaudio.cmake
index e28858b..20145ea 100644
--- a/cmake/Modules/FindPortaudio.cmake
+++ b/cmake/Modules/FindPortaudio.cmake
@@ -31,5 +31,22 @@ find_library(PORTAUDIO_LIBRARIES
 
 mark_as_advanced(PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES)
 
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(PORTAUDIO DEFAULT_MSG PORTAUDIO_INCLUDE_DIRS 
PORTAUDIO_LIBRARIES)
+# Found PORTAUDIO, but it may be version 18 which is not acceptable.
+if(EXISTS ${PORTAUDIO_INCLUDE_DIRS}/portaudio.h)
+  include(CheckCXXSourceCompiles)
+  include(CMakePushCheckState)
+  cmake_push_check_state()
+  set(CMAKE_REQUIRED_INCLUDES ${PORTAUDIO_INCLUDE_DIRS})
+  CHECK_CXX_SOURCE_COMPILES(
+    "#include <portaudio.h>\nPaDeviceIndex pa_find_device_by_name(const char 
*name); int main () {return 0;}"
+    PORTAUDIO2_FOUND)
+  cmake_pop_check_state()
+  if(PORTAUDIO2_FOUND)
+    INCLUDE(FindPackageHandleStandardArgs)
+    FIND_PACKAGE_HANDLE_STANDARD_ARGS(PORTAUDIO DEFAULT_MSG 
PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES)
+  else(PORTAUDIO2_FOUND)
+    message(STATUS
+      "  portaudio.h not compatible (requires API 2.0)")
+    set(PORTAUDIO_FOUND FALSE)
+  endif(PORTAUDIO2_FOUND)
+endif()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]