Chris@55: # - Try to find jack Chris@55: # Once done this will define Chris@55: # JACK_FOUND - System has jack Chris@55: # JACK_INCLUDE_DIRS - The jack include directories Chris@55: # JACK_LIBRARIES - The libraries needed to use jack Chris@55: # JACK_DEFINITIONS - Compiler switches required for using jack Chris@55: Chris@55: if (JACK_LIBRARIES AND JACK_INCLUDE_DIRS) Chris@55: Chris@55: # in cache already Chris@55: set(JACK_FOUND TRUE) Chris@55: Chris@55: else (JACK_LIBRARIES AND JACK_INCLUDE_DIRS) Chris@55: Chris@55: set(JACK_DEFINITIONS "") Chris@55: Chris@55: # Look for pkg-config and use it (if available) to find package Chris@55: find_package(PkgConfig QUIET) Chris@55: if (PKG_CONFIG_FOUND) Chris@55: pkg_search_module(JACK QUIET jack) Chris@55: endif (PKG_CONFIG_FOUND) Chris@55: Chris@55: if (NOT JACK_FOUND) Chris@55: Chris@55: find_path(JACK_INCLUDE_DIR jack/jack.h HINTS ${JACK_INCLUDEDIR} ${JACK_INCLUDE_DIRS} PATH_SUFFIXES jack) Chris@55: find_library(JACK_LIBRARY NAMES jack HINTS ${JACK_LIBDIR} ${JACK_LIBRARY_DIRS}) Chris@55: Chris@55: set(JACK_LIBRARIES ${JACK_LIBRARY}) Chris@55: set(JACK_INCLUDE_DIRS ${JACK_INCLUDE_DIR}) Chris@55: Chris@55: include(FindPackageHandleStandardArgs) Chris@55: Chris@55: # Set JACK_FOUND if the library and include paths were found Chris@55: find_package_handle_standard_args(jack DEFAULT_MSG JACK_LIBRARY JACK_INCLUDE_DIR) Chris@55: Chris@55: # Don't show include/library paths in cmake GUI Chris@55: mark_as_advanced(JACK_INCLUDE_DIR JACK_LIBRARY) Chris@55: Chris@55: endif (NOT JACK_FOUND) Chris@55: Chris@55: endif (JACK_LIBRARIES AND JACK_INCLUDE_DIRS)