cmake: added logic for building a tagged commit
cmake: added logic for building a tagged commit

* If the HEAD is 0 away from a tag, i.e. if it has just been tagged,
  removes commit number from version

Signed-off-by: Thomas Ingleby <cea8b9d820e871fd22532c955ca84ff867a004a3@intel.com>

nitirohilla/upm,Jon-ICS/upm,spitfire88/upm,nitirohilla/upm,andreivasiliu2211/upm,skiselev/upm,g-vidal/upm,spitfire88/upm,whbruce/upm,0xD34D/upm,g-vidal/upm,skiselev/upm,Vaghesh/upm,yoyojacky/upm,kissbac/upm,tripzero/upm,rafaneri/upm,sasmita/upm,Propanu/upm,intel-iot-devkit/upm,arfoll/upm,whbruce/upm,Jon-ICS/upm,fieldhawker/upm,jontrulson/upm,srware/upm,rafaneri/upm,mircea/upm,ShawnHymel/upm,skiselev/upm,MakerCollider/upm,Vaghesh/upm,sasmita/upm,ShawnHymel/upm,mircea/upm,whbruce/upm,tripzero/upm,tripzero/upm,fieldhawker/upm,arfoll/upm,GSmurf/upm,sasmita/upm,stefan-andritoiu/upm,spitfire88/upm,GSmurf/upm,tylergibson/upm,izard/upm,Vaghesh/upm,MakerCollider/upm,afmckinney/upm,arfoll/upm,stefan-andritoiu/upm,afmckinney/upm,izard/upm,ShawnHymel/upm,afmckinney/upm,malikabhi05/upm,Jon-ICS/upm,pylbert/upm,nitirohilla/upm,pylbert/upm,g-vidal/upm,yoyojacky/upm,yoyojacky/upm,rafaneri/upm,intel-iot-devkit/upm,Jon-ICS/upm,stefan-andritoiu/upm,jontrulson/upm,GSmurf/upm,Vaghesh/upm,intel-iot-devkit/upm,kissbac/upm,malikabhi05/upm,nitirohilla/upm,mircea/upm,yoyojacky/upm,mircea/upm,noahchense/upm,tylergibson/upm,kissbac/upm,stefan-andritoiu/upm,noahchense/upm,0xD34D/upm,arfoll/upm,izard/upm,Propanu/upm,g-vidal/upm,whbruce/upm,Jon-ICS/upm,jontrulson/upm,jontrulson/upm,tripzero/upm,tripzero/upm,andreivasiliu2211/upm,pylbert/upm,GSmurf/upm,sasmita/upm,kissbac/upm,andreivasiliu2211/upm,malikabhi05/upm,MakerCollider/upm,kissbac/upm,pylbert/upm,spitfire88/upm,MakerCollider/upm,pylbert/upm,tylergibson/upm,srware/upm,rafaneri/upm,arfoll/upm,srware/upm,andreivasiliu2211/upm,Propanu/upm,nitirohilla/upm,stefan-andritoiu/upm,tylergibson/upm,rafaneri/upm,fieldhawker/upm,malikabhi05/upm,pylbert/upm,Propanu/upm,spitfire88/upm,malikabhi05/upm,tylergibson/upm,g-vidal/upm,0xD34D/upm,fieldhawker/upm,skiselev/upm,mircea/upm,whbruce/upm,Propanu/upm,afmckinney/upm,intel-iot-devkit/upm,sasmita/upm,intel-iot-devkit/upm,andreivasiliu2211/upm,afmckinney/upm,stefan-andritoiu/upm,0xD34D/upm,g-vidal/upm,intel-iot-devkit/upm,malikabhi05/upm,yoyojacky/upm,MakerCollider/upm,Propanu/upm,srware/upm,ShawnHymel/upm,noahchense/upm,ShawnHymel/upm,srware/upm,skiselev/upm,skiselev/upm,jontrulson/upm,noahchense/upm