Cmake: Do not use variables if they are set to NOT-FOUND

Change-Id: I58c15c806756a4a06ad48ff3c6af03355e71b7cf