find_dependency: Unset temporary variables before returning

This commit is contained in:
Brad King
2022-11-17 16:06:30 -05:00
parent 591b75ee17
commit 5fbda0f572

View File

@@ -53,11 +53,12 @@ macro(find_dependency dep)
set_property(GLOBAL PROPERTY _CMAKE_${dep}_TRANSITIVE_DEPENDENCY TRUE)
endif()
unset(cmake_fd_alreadyTransitive)
unset(cmake_fd_quiet_arg)
unset(cmake_fd_required_arg)
if (NOT ${dep}_FOUND)
set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "${CMAKE_FIND_PACKAGE_NAME} could not be found because dependency ${dep} could not be found.")
set(${CMAKE_FIND_PACKAGE_NAME}_FOUND False)
return()
endif()
set(cmake_fd_required_arg)
set(cmake_fd_quiet_arg)
endmacro()