From accb9f2fe8fd8f6a1e114adac5b15304b0e0012d Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 20 Jul 2011 19:04:32 -0700 Subject: gr: squashed cmakelists.txt into one commit --- cmake/Modules/FindJack.cmake | 87 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 cmake/Modules/FindJack.cmake (limited to 'cmake/Modules/FindJack.cmake') diff --git a/cmake/Modules/FindJack.cmake b/cmake/Modules/FindJack.cmake new file mode 100644 index 000000000..44417deb3 --- /dev/null +++ b/cmake/Modules/FindJack.cmake @@ -0,0 +1,87 @@ +# - Try to find jack-2.6 +# Once done this will define +# +# JACK_FOUND - system has jack +# JACK_INCLUDE_DIRS - the jack include directory +# JACK_LIBRARIES - Link these to use jack +# JACK_DEFINITIONS - Compiler switches required for using jack +# +# Copyright (c) 2008 Andreas Schneider +# Modified for other libraries by Lasse Kärkkäinen +# +# Redistribution and use is allowed according to the terms of the New +# BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# + +if (JACK_LIBRARIES AND JACK_INCLUDE_DIRS) + # in cache already + set(JACK_FOUND TRUE) +else (JACK_LIBRARIES AND JACK_INCLUDE_DIRS) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) + include(UsePkgConfig) + pkgconfig(jack _JACK_INCLUDEDIR _JACK_LIBDIR _JACK_LDFLAGS _JACK_CFLAGS) + else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) + find_package(PkgConfig) + if (PKG_CONFIG_FOUND) + pkg_check_modules(_JACK jack) + endif (PKG_CONFIG_FOUND) + endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) + find_path(JACK_INCLUDE_DIR + NAMES + jack/jack.h + PATHS + ${_JACK_INCLUDEDIR} + /usr/include + /usr/local/include + /opt/local/include + /sw/include + ) + + find_library(JACK_LIBRARY + NAMES + jack + PATHS + ${_JACK_LIBDIR} + /usr/lib + /usr/local/lib + /opt/local/lib + /sw/lib + ) + + if (JACK_LIBRARY) + set(JACK_FOUND TRUE) + endif (JACK_LIBRARY) + + 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) + + if (JACK_FOUND) + if (NOT JACK_FIND_QUIETLY) + message(STATUS "Found jack: ${JACK_LIBRARY}") + endif (NOT JACK_FIND_QUIETLY) + else (JACK_FOUND) + if (JACK_FIND_REQUIRED) + message(FATAL_ERROR "Could not find JACK") + endif (JACK_FIND_REQUIRED) + endif (JACK_FOUND) + + # show the JACK_INCLUDE_DIRS and JACK_LIBRARIES variables only in the advanced view + mark_as_advanced(JACK_INCLUDE_DIRS JACK_LIBRARIES) + +endif (JACK_LIBRARIES AND JACK_INCLUDE_DIRS) + -- cgit From f919f9dcbb54a08e6e26d6c229ce92fb784fa1b2 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Fri, 13 Apr 2012 18:36:53 -0400 Subject: Removed whitespace and added dtools/bin/remove-whitespace as a tool to do this in the future. The sed script was provided by Moritz Fischer. --- cmake/Modules/FindJack.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmake/Modules/FindJack.cmake') diff --git a/cmake/Modules/FindJack.cmake b/cmake/Modules/FindJack.cmake index 44417deb3..c6810c011 100644 --- a/cmake/Modules/FindJack.cmake +++ b/cmake/Modules/FindJack.cmake @@ -39,7 +39,7 @@ else (JACK_LIBRARIES AND JACK_INCLUDE_DIRS) /opt/local/include /sw/include ) - + find_library(JACK_LIBRARY NAMES jack -- cgit From 4ab1b7f46894074b33937a21f64fc9b797b22d99 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sat, 14 Apr 2012 17:12:49 -0400 Subject: This patch enables JACK only when both a library and include files are available in the system. This change helps to build gnuradio on systems which have a libjack.so library available for compatibility purposes without the header files (like gentoo where libjack.so is part of app-emulation/emul-linux-x86-soundlibs). Signed-off-by: Maciej Grela --- cmake/Modules/FindJack.cmake | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'cmake/Modules/FindJack.cmake') diff --git a/cmake/Modules/FindJack.cmake b/cmake/Modules/FindJack.cmake index 44417deb3..a39fd6347 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) -- cgit