From 48dcd29f62751a1e4c050c33cf1b5e70d80e651c Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Mon, 24 Feb 2014 20:02:45 +0100 Subject: [PATCH] CMake: check PolarSSL version --- CMakeTests/FindPolarSSL.cmake | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/CMakeTests/FindPolarSSL.cmake b/CMakeTests/FindPolarSSL.cmake index 0c8eb67c80..bbf09624bb 100644 --- a/CMakeTests/FindPolarSSL.cmake +++ b/CMakeTests/FindPolarSSL.cmake @@ -30,14 +30,18 @@ if (POLARSSL_FOUND) message (STATUS "Found the polarssl headers at ${POLARSSL_INCLUDE_DIR}") endif (NOT POLARSSL_FIND_QUIETLY) - message(STATUS "Checking to see if system version contains necessary methods") - set(CMAKE_REQUIRED_INCLUDES ${POLARSSL_INCLUDE_DIR}) set(CMAKE_REQUIRED_LIBRARIES ${POLARSSL_LIBRARY}) + unset(POLARSSL_WORKS CACHE) check_cxx_source_compiles(" - #include #include #include + #include + + #if POLARSSL_VERSION_NUMBER < 0x01030000 + #error \"Shared PolarSSL version is too old\" + #endif + int main() { ssl_context ctx; @@ -56,10 +60,9 @@ if (POLARSSL_FOUND) return 0; }" POLARSSL_WORKS) - else () message (STATUS "Could not find polarssl") endif () -MARK_AS_ADVANCED(POLARSSL_INCLUDE_DIR POLARSSL_LIBRARY) +mark_as_advanced(POLARSSL_INCLUDE_DIR POLARSSL_LIBRARY)