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)