aedi: make cmake project name matching more strict

This commit is contained in:
alexey.lysiuk 2021-08-13 10:19:17 +03:00
parent 5275d2a2fb
commit fe3b42d709

View file

@ -370,11 +370,11 @@ class CMakeTarget(BuildTarget):
project_name = None project_name = None
# Try to get project name without whitespaces in it # Try to get project name without whitespaces in it
match = re.search(r'project\s*\(\s*(\w[\w-]+)', line, re.IGNORECASE) match = re.search(r'^\s*project\s*\(\s*(\w[\w-]+)', line, re.IGNORECASE)
if not match: if not match:
# Try to get project name that contains whitespaces # Try to get project name that contains whitespaces
match = re.search(r'project\s*\(\s*"?(\w[\s\w-]+)"?', line, re.IGNORECASE) match = re.search(r'^\s*project\s*\(\s*"?(\w[\s\w-]+)"?', line, re.IGNORECASE)
if match: if match:
project_name = match.group(1) project_name = match.group(1)