From d5fed5e998288eceaaef231b8624ab41ccfa9120 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Wed, 23 Oct 2019 16:13:25 +0200 Subject: [PATCH] Fix #5669: If cairo is detected as part of other dependencies ignore it If WITH_CAIRO=OFF it was still used when the library was detected as part of some other dependency. With this commit the dependency is only added if WITH_CAIRO=ON --- libfreerdp/CMakeLists.txt | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/libfreerdp/CMakeLists.txt b/libfreerdp/CMakeLists.txt index 05cc54d90..534991db4 100644 --- a/libfreerdp/CMakeLists.txt +++ b/libfreerdp/CMakeLists.txt @@ -89,20 +89,18 @@ if (WITH_CAIRO) find_package(Cairo REQUIRED) endif(WITH_CAIRO) -if (SWScale_FOUND) +# Prefer SWScale over Cairo, both at the same time are not possible. +if (WITH_SWSCALE) add_definitions(-DSWSCALE_FOUND=1) include_directories(${SWScale_INCLUDE_DIR}) freerdp_library_add(${SWScale_LIBRARY}) -else(SWScale_FOUND) - - if (CAIRO_FOUND) - add_definitions(-DCAIRO_FOUND=1) - include_directories(${CAIRO_INCLUDE_DIR}) - freerdp_library_add(${CAIRO_LIBRARY}) - else(CAIRO_FOUND) - message(WARNING "neither swscale nor libcairo detected, compiling without image scaling support!") - endif(CAIRO_FOUND) -endif(SWScale_FOUND) +elseif (WITH_CAIRO) + add_definitions(-DCAIRO_FOUND=1) + include_directories(${CAIRO_INCLUDE_DIR}) + freerdp_library_add(${CAIRO_LIBRARY}) +else() + message(WARNING "neither swscale nor libcairo detected, compiling without image scaling support!") +endif() set(${MODULE_PREFIX}_SUBMODULES utils