diff --git a/FindBoost.cmake b/FindBoost.cmake
index 689b6c79c9c649f502ba6496c9d3ff596d0dfb78..36341830c02b64f4d27200b5dea8faf76c08c569 100644
--- a/FindBoost.cmake
+++ b/FindBoost.cmake
@@ -133,6 +133,7 @@ foreach(LIBNAME ${REQUESTED_BOOST_LIBS})
         message(FATAL_ERROR "Boost library ${LIBNAME} was NOT found!
                              Please, set variable BOOST_LIBRARYDIR to the correct path and check the library names
                              format in your Boost installation.")
+    endif()
 
     message("${LIBNAME} ${${LIBNAME}}")