From 53af811530cc2814b630d1f684eb60db78ec143f Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Fri, 16 Nov 2018 20:23:10 +0000 Subject: [PATCH] cmake: emit warnings about unsupported options if turned ON only --- cmake/OpenCVUtils.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/OpenCVUtils.cmake b/cmake/OpenCVUtils.cmake index 969ce61e00..6847715bc1 100644 --- a/cmake/OpenCVUtils.cmake +++ b/cmake/OpenCVUtils.cmake @@ -605,7 +605,9 @@ macro(OCV_OPTION variable description value) option(${variable} "${description}" ${__value}) endif() else() - if(DEFINED ${variable} AND NOT OPENCV_HIDE_WARNING_UNSUPPORTED_OPTION) + if(DEFINED ${variable} AND "${${variable}}" # emit warnings about turned ON options only. + AND NOT (OPENCV_HIDE_WARNING_UNSUPPORTED_OPTION OR "$ENV{OPENCV_HIDE_WARNING_UNSUPPORTED_OPTION}") + ) message(WARNING "Unexpected option: ${variable} (=${${variable}})\nCondition: IF (${__condition})") endif() if(OPENCV_UNSET_UNSUPPORTED_OPTION)