From 088e34740e562bb5301b803c534713c7c3a321c9 Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Mon, 26 Jul 2021 13:25:06 +0200 Subject: [PATCH] Fix messed up wx find procedure --- src/CMakeLists.txt | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 385625161..bbade8a97 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -57,31 +57,13 @@ if (SLIC3R_GUI) include(${wxWidgets_USE_FILE}) - find_package(JPEG QUIET REQUIRED) - find_package(TIFF QUIET REQUIRED) + find_package(JPEG QUIET) + find_package(TIFF QUIET) string(REGEX MATCH "wxpng" WX_PNG_BUILTIN ${wxWidgets_LIBRARIES}) - if (NOT WX_PNG_BUILTIN) - find_package(JPEG QUIET) - if (PNG_FOUND) - list(FILTER wxWidgets_LIBRARIES EXCLUDE REGEX png) - list(APPEND wxWidgets_LIBRARIES ${PNG_LIBRARIES}) - endif () - endif () - - string(REGEX MATCH "wxtiff" WX_TIFF_BUILTIN ${wxWidgets_LIBRARIES}) - if (NOT WX_TIFF_BUILTIN) - find_package(TIFF QUIET) - if (TIFF_FOUND) - list(FILTER wxWidgets_LIBRARIES EXCLUDE REGEX tiff) - list(APPEND wxWidgets_LIBRARIES ${TIFF_LIBRARIES}) - endif () - endif () - - string(REGEX MATCH "wxjpeg" WX_JPEG_BUILTIN ${wxWidgets_LIBRARIES}) - if (TIFF_FOUND AND NOT WX_JPEG_BUILTIN) - list(FILTER wxWidgets_LIBRARIES EXCLUDE REGEX jpeg) - list(APPEND wxWidgets_LIBRARIES ${JPEG_LIBRARIES}) + if (PNG_FOUND AND NOT WX_PNG_BUILTIN) + list(FILTER wxWidgets_LIBRARIES EXCLUDE REGEX png) + list(APPEND wxWidgets_LIBRARIES ${PNG_LIBRARIES}) endif () string(REGEX MATCH "wxtiff" WX_TIFF_BUILTIN ${wxWidgets_LIBRARIES}) @@ -91,7 +73,7 @@ if (SLIC3R_GUI) endif () string(REGEX MATCH "wxjpeg" WX_JPEG_BUILTIN ${wxWidgets_LIBRARIES}) - if (TIFF_FOUND AND NOT WX_JPEG_BUILTIN) + if (JPEG_FOUND AND NOT WX_JPEG_BUILTIN) list(FILTER wxWidgets_LIBRARIES EXCLUDE REGEX jpeg) list(APPEND wxWidgets_LIBRARIES ${JPEG_LIBRARIES}) endif () @@ -101,6 +83,7 @@ if (SLIC3R_GUI) list(FILTER wxWidgets_LIBRARIES EXCLUDE REGEX expat) list(APPEND wxWidgets_LIBRARIES ${EXPAT_LIBRARIES}) endif () + # This is an issue in the new wxWidgets cmake build, doesn't deal with librt find_library(LIBRT rt) if(LIBRT)