import re


def matchProjectName(line):
  """
  Attempts to match and return the value of PROJECT_NAME in a line like
  SET(PROJECT_NAME <name>)
  If no match can be made, None is returned.
  """
  matchRegex = r'\s*[Ss][Ee][Tt]\s*\(\s*PROJECT_NAME\s+([^\)\s]*)\s*\).*'
  match = re.search(matchRegex, line)
  if match:
    return match.group(1)
  else:
    return None