Merge pull request #13189 from alalek:cmake_options_warnings_update

This commit is contained in:
Alexander Alekhin 2018-11-17 00:36:15 +03:00 committed by GitHub
commit 954969dd74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)