CMake: Fix issue with HAVE_X safety checks falsely failing

This commit is contained in:
Sam Edwards 2020-01-08 20:13:34 -07:00
parent 1204de6e09
commit 3104bf3710

View File

@ -149,7 +149,8 @@ function(package_option name)
endif()
# If it was set by the user but not found, display an error.
if(HAVE_${name} AND NOT ${found_as}_FOUND)
string(TOUPPER "${found_as}" FOUND_AS)
if(HAVE_${name} AND NOT ${found_as}_FOUND AND NOT ${FOUND_AS}_FOUND)
message(SEND_ERROR "NOT FOUND: ${name}. Disable HAVE_${name} to continue.")
endif()
@ -209,8 +210,6 @@ function(package_option name)
endforeach(implib)
if(use_variables)
string(TOUPPER "${found_as}" FOUND_AS)
if(DEFINED ${found_as}_INCLUDE_DIRS)
set(includes ${${found_as}_INCLUDE_DIRS})
elseif(DEFINED ${found_as}_INCLUDE_DIR)