diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-12-09 15:39:58 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-12-09 15:39:58 +0000 |
commit | 3eba0f7aca001bce201a934fcf7e033cfac29778 (patch) | |
tree | 48629a031ace2939406253f32809acc3e52faace | |
parent | 666ca13feef73dcf5f8eaf66fe28ce0b8f5334a7 (diff) | |
download | rspamd-3eba0f7aca001bce201a934fcf7e033cfac29778.tar.gz rspamd-3eba0f7aca001bce201a934fcf7e033cfac29778.zip |
[Minor] Check libgd before using
-rw-r--r-- | CMakeLists.txt | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2342048db..3e775f438 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -725,7 +725,22 @@ IF (ENABLE_GD MATCHES "ON") ProcessPackage(GD LIBRARY gd INCLUDE gd.h INCLUDE_SUFFIXES include/gd include/libgd ROOT ${GD_ROOT_DIR} MODULES gd) - SET(WITH_GD 1) + LIST(APPEND CMAKE_REQUIRED_INCLUDES "${GD_INCLUDE}") + LIST(APPEND CMAKE_REQUIRED_LIBRARIES "${GD_LIBRARY}") + + CHECK_SYMBOL_EXISTS(gdImageSetInterpolationMethod gd.h GD_INTERPOLATION) + CHECK_SYMBOL_EXISTS(gdImageScale gd.h GD_SCALE) + CHECK_SYMBOL_EXISTS(gdImageGrayScale gd.h GD_GRAYSCALE) + CHECK_SYMBOL_EXISTS(gdImageCreateFromJpegPtr gd.h GD_JPEG) + CHECK_SYMBOL_EXISTS(gdImageCreateFromPngPtr gd.h GD_PNG) + CHECK_SYMBOL_EXISTS(gdImageCreateFromJpegPtr gd.h GD_BMP) + CHECK_SYMBOL_EXISTS(gdImageCreateFromBmpPtr gd.h GD_GIF) + + IF(GD_INTERPOLATION AND GD_SCALE AND GD_GRAYSCALE AND GD_JPEG AND GD_PNG AND GD_GIF AND GD_BMP) + SET(WITH_GD 1) + ELSE() + MESSAGE(STATUS "Libgd is found but it is unusable") + ENDIF() ENDIF () #Check for openssl (required for dkim) |