From: Pierre Ossman Date: Mon, 30 May 2022 08:52:23 +0000 (+0200) Subject: Fix up ffmpeg header and library handling X-Git-Tag: v1.12.90~33^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4cf31302a1dd887e72481ed4355a9f435d91eb6c;p=tigervnc.git Fix up ffmpeg header and library handling FFMPEG is needed by the RFB library, so all the details about it should only be applied there and not for other components. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index f8cacb9d..e5807def 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -189,7 +189,7 @@ if(ENABLE_H264) find_library(AVUTIL_LIBRARY avutil) find_path(SWSCALE_INCLUDE_DIR libswscale/swscale.h) find_library(SWSCALE_LIBRARY swscale) - include_directories(${AVCODEC_INCLUDE_DIR} ${AVUTIL_INCLUDE_DIR} ${SWSCALE_INCLUDE_DIR}) + set(H264_INCLUDE_DIRS ${AVCODEC_INCLUDE_DIRS} ${AVUTIL_INCLUDE_DIRS} ${SWSCALE_INCLUDE_DIRS}) set(H264_LIBRARIES ${AVCODEC_LIBRARY} ${AVUTIL_LIBRARY} ${SWSCALE_LIBRARY}) add_definitions("-D__STDC_CONSTANT_MACROS") add_definitions("-DHAVE_H264") diff --git a/common/rfb/CMakeLists.txt b/common/rfb/CMakeLists.txt index 1b43ed11..66014f3e 100644 --- a/common/rfb/CMakeLists.txt +++ b/common/rfb/CMakeLists.txt @@ -1,4 +1,4 @@ -include_directories(${CMAKE_SOURCE_DIR}/common ${JPEG_INCLUDE_DIR} ${PIXMAN_INCLUDE_DIRS}) +include_directories(${CMAKE_SOURCE_DIR}/common ${JPEG_INCLUDE_DIR} ${PIXMAN_INCLUDE_DIRS} ${H264_INCLUDE_DIRS}) add_library(rfb STATIC Blacklist.cxx @@ -75,6 +75,7 @@ if(ENABLE_H264 AND NOT H264_LIBS STREQUAL "NONE") elseif(H264_LIBS STREQUAL "WIN") target_sources(rfb PRIVATE H264WinDecoderContext.cxx) endif() + target_link_libraries(rfb ${H264_LIBRARIES}) endif() if(UNIX) diff --git a/tests/perf/CMakeLists.txt b/tests/perf/CMakeLists.txt index b4cff208..1b5e9f77 100644 --- a/tests/perf/CMakeLists.txt +++ b/tests/perf/CMakeLists.txt @@ -3,7 +3,6 @@ include_directories(${GETTEXT_INCLUDE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/common) add_library(test_util STATIC util.cxx) -target_link_libraries(test_util ${H264_LIBRARIES}) add_executable(convperf convperf.cxx) target_link_libraries(convperf test_util rfb) diff --git a/vncviewer/CMakeLists.txt b/vncviewer/CMakeLists.txt index 51b5f3ea..15eac661 100644 --- a/vncviewer/CMakeLists.txt +++ b/vncviewer/CMakeLists.txt @@ -50,7 +50,7 @@ else() target_sources(vncviewer PRIVATE Surface_X11.cxx) endif() -target_link_libraries(vncviewer rfb network rdr os ${FLTK_LIBRARIES} ${GETTEXT_LIBRARIES} ${H264_LIBRARIES}) +target_link_libraries(vncviewer rfb network rdr os ${FLTK_LIBRARIES} ${GETTEXT_LIBRARIES}) if(WIN32) target_link_libraries(vncviewer msimg32)