summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-01-23 00:59:57 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-22 23:42:57 +0000
commit4ffe2e1ec9df05b92a2ad5746fb0ca6d218fd77e (patch)
tree7cbbd201b6c0f33f20fb65eff794e6f059162228
parent6c6baf6aa1823b8b20123f505e45c2768a193ad5 (diff)
downloadopenembedded-core-contrib-4ffe2e1ec9df05b92a2ad5746fb0ca6d218fd77e.tar.gz
openembedded-core-contrib-4ffe2e1ec9df05b92a2ad5746fb0ca6d218fd77e.tar.bz2
openembedded-core-contrib-4ffe2e1ec9df05b92a2ad5746fb0ca6d218fd77e.zip
recipetool: create: strip quotes from values extracted from CMakeLists.txt
Quoting is optional in CMakeLists.txt and is occasionally used, so strip out quotes if they are present. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--scripts/lib/recipetool/create_buildsys.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/scripts/lib/recipetool/create_buildsys.py b/scripts/lib/recipetool/create_buildsys.py
index 6afb5de1c2..ba393a840d 100644
--- a/scripts/lib/recipetool/create_buildsys.py
+++ b/scripts/lib/recipetool/create_buildsys.py
@@ -142,6 +142,9 @@ class CmakeRecipeHandler(RecipeHandler):
subdir_re = re.compile('add_subdirectory\s*\(\s*([^)\s]*)\s*([^)\s]*)\s*\)', re.IGNORECASE)
dep_re = re.compile('([^ ><=]+)( *[<>=]+ *[^ ><=]+)?')
+ def interpret_value(value):
+ return value.strip('"')
+
def parse_cmake_file(fn, paths=None):
searchpaths = (paths or []) + [os.path.dirname(fn)]
logger.debug('Parsing file %s' % fn)
@@ -166,13 +169,13 @@ class CmakeRecipeHandler(RecipeHandler):
continue
res = proj_re.match(line)
if res:
- extravalues['PN'] = res.group(1).split()[0]
+ extravalues['PN'] = interpret_value(res.group(1).split()[0])
continue
res = pkgcm_re.match(line)
if res:
res = dep_re.findall(res.group(2))
if res:
- pcdeps.extend([x[0] for x in res])
+ pcdeps.extend([interpret_value(x[0]) for x in res])
inherits.append('pkgconfig')
continue
res = pkgsm_re.match(line)
@@ -180,7 +183,7 @@ class CmakeRecipeHandler(RecipeHandler):
res = dep_re.findall(res.group(2))
if res:
# Note: appending a tuple here!
- item = tuple((x[0] for x in res))
+ item = tuple((interpret_value(x[0]) for x in res))
if len(item) == 1:
item = item[0]
pcdeps.append(item)
@@ -189,7 +192,7 @@ class CmakeRecipeHandler(RecipeHandler):
res = findpackage_re.match(line)
if res:
origpkg = res.group(1)
- pkg = origpkg.lower()
+ pkg = interpret_value(origpkg.lower())
if pkg == 'gettext':
inherits.append('gettext')
elif pkg == 'perl':
@@ -209,7 +212,7 @@ class CmakeRecipeHandler(RecipeHandler):
continue
res = checklib_re.match(line)
if res:
- lib = res.group(1)
+ lib = interpret_value(res.group(1))
if not lib.startswith('$'):
libdeps.append(lib)
if line.lower().startswith('useswig'):