BUG: Improve check for usage of ConfigurePrerequisites component

This commit ensures that no false error will happen by checking if
the variable CMAKE_PROJECT_NAME (set only by the project() command)
 is defined.

More particularly, this will avoid getting error while build the
VMTK extension.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23180 3bd1e089-480b-0410-8dfb-8563597acbee