Fix wx linkage to tiff and jpeg

This commit is contained in:
tamasmeszaros 2021-03-23 20:42:22 +01:00
parent 02c6601281
commit eca331ea35

View File

@ -57,6 +57,9 @@ if (SLIC3R_GUI)
include(${wxWidgets_USE_FILE})
find_package(JPEG QUIET REQUIRED)
find_package(TIFF QUIET REQUIRED)
string(REGEX MATCH "wxpng" WX_PNG_BUILTIN ${wxWidgets_LIBRARIES})
if (NOT WX_PNG_BUILTIN)
find_package(JPEG QUIET)
@ -81,6 +84,18 @@ if (SLIC3R_GUI)
list(APPEND wxWidgets_LIBRARIES ${JPEG_LIBRARIES})
endif ()
string(REGEX MATCH "wxtiff" WX_TIFF_BUILTIN ${wxWidgets_LIBRARIES})
if (TIFF_FOUND AND NOT WX_TIFF_BUILTIN)
list(FILTER wxWidgets_LIBRARIES EXCLUDE REGEX tiff)
list(APPEND wxWidgets_LIBRARIES ${TIFF_LIBRARIES})
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})
endif ()
string(REGEX MATCH "wxexpat" WX_EXPAT_BUILTIN ${wxWidgets_LIBRARIES})
if (EXPAT_FOUND AND NOT WX_EXPAT_BUILTIN)
list(FILTER wxWidgets_LIBRARIES EXCLUDE REGEX expat)