summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorBen Reynwar2012-04-30 09:20:59 -0700
committerBen Reynwar2012-04-30 09:20:59 -0700
commit2817cf14147d6da2e7ef051fbbbf8228fd1c07ba (patch)
tree0695ce3bcdbd75784198c28e6cb963c99ae5d0f6 /cmake
parente7f45e3c513242706a9e4aa36e99e33e79e66d4f (diff)
parentd7ecbd12be995ad6db7a53a5d6dd3fcb205c07ea (diff)
downloadgnuradio-2817cf14147d6da2e7ef051fbbbf8228fd1c07ba.tar.gz
gnuradio-2817cf14147d6da2e7ef051fbbbf8228fd1c07ba.tar.bz2
gnuradio-2817cf14147d6da2e7ef051fbbbf8228fd1c07ba.zip
Merge branch 'master' of http://gnuradio.org/git/gnuradio
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/FindJack.cmake15
-rw-r--r--cmake/Modules/FindPortaudio.cmake128
-rw-r--r--cmake/Modules/GrPython.cmake11
3 files changed, 38 insertions, 116 deletions
diff --git a/cmake/Modules/FindJack.cmake b/cmake/Modules/FindJack.cmake
index c6810c011..4bdfe0a7e 100644
--- a/cmake/Modules/FindJack.cmake
+++ b/cmake/Modules/FindJack.cmake
@@ -51,24 +51,19 @@ else (JACK_LIBRARIES AND JACK_INCLUDE_DIRS)
/sw/lib
)
- if (JACK_LIBRARY)
+ if (JACK_LIBRARY AND JACK_INCLUDE_DIR)
set(JACK_FOUND TRUE)
- endif (JACK_LIBRARY)
- set(JACK_INCLUDE_DIRS
- ${JACK_INCLUDE_DIR}
- )
+ set(JACK_INCLUDE_DIRS
+ ${JACK_INCLUDE_DIR}
+ )
- if (JACK_FOUND)
set(JACK_LIBRARIES
${JACK_LIBRARIES}
${JACK_LIBRARY}
)
- endif (JACK_FOUND)
- if (JACK_INCLUDE_DIRS AND JACK_LIBRARIES)
- set(JACK_FOUND TRUE)
- endif (JACK_INCLUDE_DIRS AND JACK_LIBRARIES)
+ endif (JACK_LIBRARY AND JACK_INCLUDE_DIR)
if (JACK_FOUND)
if (NOT JACK_FIND_QUIETLY)
diff --git a/cmake/Modules/FindPortaudio.cmake b/cmake/Modules/FindPortaudio.cmake
index 4b7175438..61e4ae23a 100644
--- a/cmake/Modules/FindPortaudio.cmake
+++ b/cmake/Modules/FindPortaudio.cmake
@@ -4,104 +4,32 @@
# PORTAUDIO_FOUND - system has Portaudio
# PORTAUDIO_INCLUDE_DIRS - the Portaudio include directory
# PORTAUDIO_LIBRARIES - Link these to use Portaudio
-# PORTAUDIO_DEFINITIONS - Compiler switches required for using Portaudio
-# PORTAUDIO_VERSION - Portaudio version
-#
-# Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>
-#
-# Redistribution and use is allowed according to the terms of the New BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-#
-
-
-if (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
- # in cache already
- set(PORTAUDIO_FOUND TRUE)
-else (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
- if (NOT WIN32)
- include(FindPkgConfig)
- pkg_check_modules(PORTAUDIO2 portaudio-2.0)
- endif (NOT WIN32)
-
- if (PORTAUDIO2_FOUND)
- set(PORTAUDIO_INCLUDE_DIRS
- ${PORTAUDIO2_INCLUDE_DIRS}
- )
- if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
- set(PORTAUDIO_LIBRARIES "${PORTAUDIO2_LIBRARY_DIRS}/lib${PORTAUDIO2_LIBRARIES}.dylib")
- else (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
- set(PORTAUDIO_LIBRARIES
- ${PORTAUDIO2_LIBRARIES}
- )
- endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
- set(PORTAUDIO_VERSION
- 19
- )
- set(PORTAUDIO_FOUND TRUE)
- else (PORTAUDIO2_FOUND)
- find_path(PORTAUDIO_INCLUDE_DIR
- NAMES
- portaudio.h
- PATHS
- /usr/include
- /usr/local/include
- /opt/local/include
- /sw/include
- )
-
- find_library(PORTAUDIO_LIBRARY
- NAMES
- portaudio
- PATHS
- /usr/lib
- /usr/local/lib
- /opt/local/lib
- /sw/lib
- )
-
- find_path(PORTAUDIO_LIBRARY_DIR
- NAMES
- portaudio
- PATHS
- /usr/lib
- /usr/local/lib
- /opt/local/lib
- /sw/lib
- )
-
- set(PORTAUDIO_INCLUDE_DIRS
- ${PORTAUDIO_INCLUDE_DIR}
- )
- set(PORTAUDIO_LIBRARIES
- ${PORTAUDIO_LIBRARY}
- )
-
- set(PORTAUDIO_LIBRARY_DIRS
- ${PORTAUDIO_LIBRARY_DIR}
- )
-
- set(PORTAUDIO_VERSION
- 18
- )
-
- if (PORTAUDIO_INCLUDE_DIRS AND PORTAUDIO_LIBRARIES)
- set(PORTAUDIO_FOUND TRUE)
- endif (PORTAUDIO_INCLUDE_DIRS AND PORTAUDIO_LIBRARIES)
-
- if (PORTAUDIO_FOUND)
- if (NOT Portaudio_FIND_QUIETLY)
- message(STATUS "Found Portaudio: ${PORTAUDIO_LIBRARIES}")
- endif (NOT Portaudio_FIND_QUIETLY)
- else (PORTAUDIO_FOUND)
- if (Portaudio_FIND_REQUIRED)
- message(FATAL_ERROR "Could not find Portaudio")
- endif (Portaudio_FIND_REQUIRED)
- endif (PORTAUDIO_FOUND)
- endif (PORTAUDIO2_FOUND)
-
-
- # show the PORTAUDIO_INCLUDE_DIRS and PORTAUDIO_LIBRARIES variables only in the advanced view
- mark_as_advanced(PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES)
-
-endif (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
+include(FindPkgConfig)
+pkg_check_modules(PC_PORTAUDIO portaudio)
+
+find_path(PORTAUDIO_INCLUDE_DIRS
+ NAMES
+ portaudio.h
+ PATHS
+ /usr/local/include
+ /usr/include
+ HINTS
+ ${PC_PORTAUDIO_INCLUDE_DIR}
+)
+
+find_library(PORTAUDIO_LIBRARIES
+ NAMES
+ portaudio
+ PATHS
+ /usr/local/lib
+ /usr/lib
+ /usr/lib64
+ HINTS
+ ${PC_PORTAUDIO_LIBDIR}
+)
+
+mark_as_advanced(PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES)
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(PORTAUDIO DEFAULT_MSG PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES)
diff --git a/cmake/Modules/GrPython.cmake b/cmake/Modules/GrPython.cmake
index eff9cbcdc..14f2b29cd 100644
--- a/cmake/Modules/GrPython.cmake
+++ b/cmake/Modules/GrPython.cmake
@@ -76,12 +76,11 @@ macro(GR_PYTHON_CHECK_MODULE desc mod cmd have)
execute_process(
COMMAND ${PYTHON_EXECUTABLE} -c "
#########################################
-try: import ${mod}
-except:
- try: ${mod}
- except: exit(-1)
-try: assert ${cmd}
-except: exit(-1)
+try:
+ import ${mod}
+ assert ${cmd}
+except ImportError, AssertionError: exit(-1)
+except: pass
#########################################"
RESULT_VARIABLE ${have}
)