CMake: Fixup SpanDSP's TIFF includes.

Add TIFF_INCLUDE_DIR to SPANDSP_INCLUDE_DIRS, but only if TIFF has been
found.

Ping #17477.
This commit is contained in:
Gerald Combs 2021-07-14 09:10:09 -07:00
parent 1f9f287fba
commit 8834b470d0
4 changed files with 8 additions and 11 deletions

View File

@ -1249,7 +1249,6 @@ ws_find_package(NL ENABLE_NETLINK HAVE_LIBNL)
ws_find_package(SBC ENABLE_SBC HAVE_SBC)
# SpanDSP codec
find_package(TIFF QUIET)
ws_find_package(SPANDSP ENABLE_SPANDSP HAVE_SPANDSP)
ws_find_package(BCG729 ENABLE_BCG729 HAVE_BCG729)

View File

@ -14,6 +14,9 @@ if( NOT WIN32)
pkg_search_module(SPANDSP spandsp)
endif()
# spandsp.h includes tiffio.h.
find_package(TIFF QUIET)
find_path( SPANDSP_INCLUDE_DIR
NAMES spandsp.h
HINTS
@ -35,6 +38,9 @@ find_package_handle_standard_args( SPANDSP DEFAULT_MSG SPANDSP_LIBRARY SPANDSP_I
if( SPANDSP_FOUND )
set( SPANDSP_INCLUDE_DIRS ${SPANDSP_INCLUDE_DIR} )
if( TIFF_FOUND )
list(APPEND SPANDSP_INCLUDE_DIRS ${TIFF_INCLUDE_DIR})
endif()
set( SPANDSP_LIBRARIES ${SPANDSP_LIBRARY} )
if (WIN32)
set ( SPANDSP_DLL_DIR "${SPANDSP_HINTS}/bin"

View File

@ -38,11 +38,7 @@ target_include_directories(g722 PRIVATE ${CMAKE_SOURCE_DIR}/codecs)
target_link_libraries(g722 wsutil ${SPANDSP_LIBRARIES})
target_include_directories(g722
SYSTEM PRIVATE
${SPANDSP_INCLUDE_DIRS}
${TIFF_INCLUDE_DIR}
)
target_include_directories(g722 SYSTEM PRIVATE ${SPANDSP_INCLUDE_DIRS})
install_plugin(g722 codecs)

View File

@ -38,11 +38,7 @@ target_include_directories(g726 PRIVATE ${CMAKE_SOURCE_DIR}/codecs)
target_link_libraries(g726 wsutil ${SPANDSP_LIBRARIES})
target_include_directories(g726
SYSTEM PRIVATE
${SPANDSP_INCLUDE_DIRS}
${TIFF_INCLUDE_DIR}
)
target_include_directories(g726 SYSTEM PRIVATE ${SPANDSP_INCLUDE_DIRS})
install_plugin(g726 codecs)