1 # Find the system's SpanDSP includes and library
3 # SPANDSP_INCLUDE_DIRS - where to find spandsp.h
4 # SPANDSP_LIBRARIES - List of libraries when using SpanDSP
5 # SPANDSP_FOUND - True if SpanDSP found
6 # SPANDSP_DLL_DIR - (Windows) Path to the SpanDSP DLL
7 # SPANDSP_DLL - (Windows) Name of the SpanDSP DLL
9 include( FindWSWinLibs )
10 FindWSWinLibs( "spandsp-.*" "SPANDSP_HINTS" )
12 if( NOT USE_REPOSITORY)
13 find_package(PkgConfig)
14 pkg_search_module(SPANDSP spandsp)
16 # spandsp.h might include tiffio.h.
17 find_package(TIFF QUIET)
21 find_path( SPANDSP_INCLUDE_DIR
24 "${SPANDSP_INCLUDEDIR}"
25 "${SPANDSP_HINTS}/include"
26 PATHS /usr/local/include /usr/include
29 find_library( SPANDSP_LIBRARY
35 "${SPANDSP_HINTS}/lib"
36 PATHS /usr/local/lib /usr/lib
39 include( FindPackageHandleStandardArgs )
40 find_package_handle_standard_args( SPANDSP DEFAULT_MSG SPANDSP_LIBRARY SPANDSP_INCLUDE_DIR )
43 set( SPANDSP_INCLUDE_DIRS ${SPANDSP_INCLUDE_DIR} )
45 list(APPEND SPANDSP_INCLUDE_DIRS ${TIFF_INCLUDE_DIR})
47 set( SPANDSP_LIBRARIES ${SPANDSP_LIBRARY} )
49 set ( SPANDSP_DLL_DIR "${SPANDSP_HINTS}/bin"
50 CACHE PATH "Path to SpanDSP DLL"
52 file( GLOB _spandsp_dll RELATIVE "${SPANDSP_DLL_DIR}"
53 "${SPANDSP_DLL_DIR}/libspandsp-*.dll"
55 set ( SPANDSP_DLL ${_spandsp_dll}
56 # We're storing filenames only. Should we use STRING instead?
57 CACHE FILEPATH "SpanDSP DLL file name"
59 mark_as_advanced( SPANDSP_DLL_DIR SPANDSP_DLL )
62 set( SPANDSP_INCLUDE_DIRS )
63 set( SPANDSP_LIBRARIES )
66 mark_as_advanced( SPANDSP_LIBRARIES SPANDSP_INCLUDE_DIRS )