From 76b5a6b95e89f1a75ffddc532d235d5ddfc2ba59 Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Mon, 24 Feb 2014 19:07:24 +0100 Subject: [PATCH] PolarSSL/CMake: validate cached values --- CMakeTests/FindPolarSSL.cmake | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/CMakeTests/FindPolarSSL.cmake b/CMakeTests/FindPolarSSL.cmake index c55b2bb958..0c8eb67c80 100644 --- a/CMakeTests/FindPolarSSL.cmake +++ b/CMakeTests/FindPolarSSL.cmake @@ -6,14 +6,20 @@ # POLARSSL_WORKS, this is true if polarssl is found and contains the methods # needed by dolphin-emu -if(POLARSSL_INCLUDE_DIR AND POLARSSL_LIBRARY) - # Already in cache, be silent +# validate cached values (but use them as hints) +set(POLARSSL_INCLUDE_DIR_HINT POLARSSL_INCLUDE_DIR) +set(POLARSSL_LIBRARY_HINT POLARSSL_LIBRARY) +unset(POLARSSL_INCLUDE_DIR CACHE) +unset(POLARSSL_LIBRARY CACHE) +find_path(POLARSSL_INCLUDE_DIR polarssl/ssl.h HINTS ${POLARSSL_INCLUDE_DIR_HINT}) +find_library(POLARSSL_LIBRARY polarssl HINTS ${POLARSSL_LIBRARY_HINT}) + +if(POLARSSL_INCLUDE_DIR STREQUAL POLARSSL_INCLUDE_DIR_HINT AND + POLARSSL_LIBRARY STREQUAL POLARSSL_LIBRARY_HINT) + # using cached values, be silent set(POLARSSL_FIND_QUIETLY TRUE) endif() -find_path(POLARSSL_INCLUDE_DIR polarssl/ssl.h) -find_library(POLARSSL_LIBRARY polarssl) - if (POLARSSL_INCLUDE_DIR AND POLARSSL_LIBRARY) set (POLARSSL_FOUND TRUE) endif ()