Skip to content

Commit

Permalink
Emit a clear error when a component is not found in a required package
Browse files Browse the repository at this point in the history
  • Loading branch information
gergondet committed Oct 18, 2023
1 parent c1ac236 commit f764192
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -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@")
Expand Down

0 comments on commit f764192

Please sign in to comment.