From d9228403d41eada7cfce4c7f1d269a784d413f34 Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Mon, 16 Dec 2013 09:29:06 +0100 Subject: [PATCH] OpmFind.cmake: also check for CAPITALIZED found variables thanks to @rolk for catching this --- cmake/Modules/OpmFind.cmake | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cmake/Modules/OpmFind.cmake b/cmake/Modules/OpmFind.cmake index f7f1e186a..58501ba9d 100644 --- a/cmake/Modules/OpmFind.cmake +++ b/cmake/Modules/OpmFind.cmake @@ -137,7 +137,7 @@ macro (find_and_append_package_to prefix name) # using config mode is better than using module (aka. find) mode # because then the package has already done all its probes and # stored them in the config file for us - if (NOT DEFINED ${name}_FOUND) + if (NOT DEFINED ${name}_FOUND AND NOT DEFINED ${NAME}_FOUND) if (${name}_DIR) message (STATUS "Finding package ${name} using config mode") find_package (${name} ${ARGN} NO_MODULE PATHS ${${name}_DIR} NO_DEFAULT_PATH) @@ -146,8 +146,11 @@ macro (find_and_append_package_to prefix name) find_package (${name} ${ARGN}) endif () endif () - if (NOT ${name}_FOUND) - set (${name}_FOUND "0") + if (NOT DEFINED ${name}_FOUND) + set (${name}_FOUND "${${NAME}_FOUND}") + endif () + if (NOT DEFINED ${NAME}_FOUND) + set (${NAME}_FOUND "${${name}_FOUND}") endif () endif ()