summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-02-11 14:13:29 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-11 12:33:03 +0000
commitd94c7e367ca19545d9f006ede77236abc43af54e (patch)
treea0e738e3ce2cd4a44b89a2cbff42b2c4ba10efc7 /scripts
parentddfe74447b3a50ae0b3533ace0e2b41e04a57bff (diff)
downloadpoky-d94c7e367ca19545d9f006ede77236abc43af54e.tar.gz
recipetool: create: support cmake find_library directive
CMake supports a find_library() directive to find named libraries, so detect dependencies from this. (From OE-Core rev: d0265bc67f797ee4b7760cf37335994133809abf) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/recipetool/create_buildsys.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/lib/recipetool/create_buildsys.py b/scripts/lib/recipetool/create_buildsys.py
index ba393a840d..4d11e0401e 100644
--- a/scripts/lib/recipetool/create_buildsys.py
+++ b/scripts/lib/recipetool/create_buildsys.py
@@ -137,6 +137,7 @@ class CmakeRecipeHandler(RecipeHandler):
137 pkgcm_re = re.compile('pkg_check_modules\s*\(\s*[a-zA-Z0-9-_]+\s*(REQUIRED)?\s+([^)\s]+)\s*\)', re.IGNORECASE) 137 pkgcm_re = re.compile('pkg_check_modules\s*\(\s*[a-zA-Z0-9-_]+\s*(REQUIRED)?\s+([^)\s]+)\s*\)', re.IGNORECASE)
138 pkgsm_re = re.compile('pkg_search_module\s*\(\s*[a-zA-Z0-9-_]+\s*(REQUIRED)?((\s+[^)\s]+)+)\s*\)', re.IGNORECASE) 138 pkgsm_re = re.compile('pkg_search_module\s*\(\s*[a-zA-Z0-9-_]+\s*(REQUIRED)?((\s+[^)\s]+)+)\s*\)', re.IGNORECASE)
139 findpackage_re = re.compile('find_package\s*\(\s*([a-zA-Z0-9-_]+)\s*.*', re.IGNORECASE) 139 findpackage_re = re.compile('find_package\s*\(\s*([a-zA-Z0-9-_]+)\s*.*', re.IGNORECASE)
140 findlibrary_re = re.compile('find_library\s*\(\s*[a-zA-Z0-9-_]+\s*(NAMES\s+)?([a-zA-Z0-9-_ ]+)\s*.*')
140 checklib_re = re.compile('check_library_exists\s*\(\s*([^\s)]+)\s*.*', re.IGNORECASE) 141 checklib_re = re.compile('check_library_exists\s*\(\s*([^\s)]+)\s*.*', re.IGNORECASE)
141 include_re = re.compile('include\s*\(\s*([^)\s]*)\s*\)', re.IGNORECASE) 142 include_re = re.compile('include\s*\(\s*([^)\s]*)\s*\)', re.IGNORECASE)
142 subdir_re = re.compile('add_subdirectory\s*\(\s*([^)\s]*)\s*([^)\s]*)\s*\)', re.IGNORECASE) 143 subdir_re = re.compile('add_subdirectory\s*\(\s*([^)\s]*)\s*([^)\s]*)\s*\)', re.IGNORECASE)
@@ -215,6 +216,15 @@ class CmakeRecipeHandler(RecipeHandler):
215 lib = interpret_value(res.group(1)) 216 lib = interpret_value(res.group(1))
216 if not lib.startswith('$'): 217 if not lib.startswith('$'):
217 libdeps.append(lib) 218 libdeps.append(lib)
219 res = findlibrary_re.match(line)
220 if res:
221 libs = res.group(2).split()
222 for lib in libs:
223 if lib in ['HINTS', 'PATHS', 'PATH_SUFFIXES', 'DOC', 'NAMES_PER_DIR'] or lib.startswith(('NO_', 'CMAKE_', 'ONLY_CMAKE_')):
224 break
225 lib = interpret_value(lib)
226 if not lib.startswith('$'):
227 libdeps.append(lib)
218 if line.lower().startswith('useswig'): 228 if line.lower().startswith('useswig'):
219 deps.append('swig-native') 229 deps.append('swig-native')
220 continue 230 continue