cmake: emit warnings about unsupported options if turned ON only

This commit is contained in:
Alexander Alekhin 2018-11-16 20:23:10 +00:00
parent b58a8729c2
commit 53af811530

View File

@ -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)