diff --git a/Config.cmake.in b/Config.cmake.in index 6f840d2a3..274c9fc80 100644 --- a/Config.cmake.in +++ b/Config.cmake.in @@ -142,7 +142,11 @@ foreach(component ${@PROJECT_NAME@_FIND_COMPONENTS}) if(@PROJECT_NAME@_${component}_FOUND) message(STATUS "@PROJECT_NAME@: ${component} found.") else() - message(STATUS "@PROJECT_NAME@: ${component} not found.") + if(@PROJECT_NAME@_FIND_REQUIRED_${component}) + message(FATAL_ERROR "@PROJECT_NAME@: ${component} not found.") + else() + message(STATUS "@PROJECT_NAME@: ${component} not found.") + endif() endif() endforeach() check_required_components("@PROJECT_NAME@")