|
|
@ -1290,9 +1290,9 @@ class CMakeDependency(ExternalDependency): |
|
|
|
|
|
|
|
|
|
|
|
# Failed to guess a target --> try the old-style method |
|
|
|
# Failed to guess a target --> try the old-style method |
|
|
|
if len(modules) == 0: |
|
|
|
if len(modules) == 0: |
|
|
|
incDirs = self.traceparser.get_cmake_var('PACKAGE_INCLUDE_DIRS') |
|
|
|
incDirs = [x for x in self.traceparser.get_cmake_var('PACKAGE_INCLUDE_DIRS') if x] |
|
|
|
defs = self.traceparser.get_cmake_var('PACKAGE_DEFINITIONS') |
|
|
|
defs = [x for x in self.traceparser.get_cmake_var('PACKAGE_DEFINITIONS') if x] |
|
|
|
libs = self.traceparser.get_cmake_var('PACKAGE_LIBRARIES') |
|
|
|
libs = [x for x in self.traceparser.get_cmake_var('PACKAGE_LIBRARIES') if x] |
|
|
|
|
|
|
|
|
|
|
|
# Try to use old style variables if no module is specified |
|
|
|
# Try to use old style variables if no module is specified |
|
|
|
if len(libs) > 0: |
|
|
|
if len(libs) > 0: |
|
|
@ -1340,39 +1340,37 @@ class CMakeDependency(ExternalDependency): |
|
|
|
mlog.debug(tgt) |
|
|
|
mlog.debug(tgt) |
|
|
|
|
|
|
|
|
|
|
|
if 'INTERFACE_INCLUDE_DIRECTORIES' in tgt.properies: |
|
|
|
if 'INTERFACE_INCLUDE_DIRECTORIES' in tgt.properies: |
|
|
|
incDirs += tgt.properies['INTERFACE_INCLUDE_DIRECTORIES'] |
|
|
|
incDirs += [x for x in tgt.properies['INTERFACE_INCLUDE_DIRECTORIES'] if x] |
|
|
|
|
|
|
|
|
|
|
|
if 'INTERFACE_COMPILE_DEFINITIONS' in tgt.properies: |
|
|
|
if 'INTERFACE_COMPILE_DEFINITIONS' in tgt.properies: |
|
|
|
tempDefs = list(tgt.properies['INTERFACE_COMPILE_DEFINITIONS']) |
|
|
|
compileDefinitions += ['-D' + re.sub('^-D', '', x) for x in tgt.properies['INTERFACE_COMPILE_DEFINITIONS'] if x] |
|
|
|
tempDefs = list(map(lambda x: '-D{}'.format(re.sub('^-D', '', x)), tempDefs)) |
|
|
|
|
|
|
|
compileDefinitions += tempDefs |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if 'INTERFACE_COMPILE_OPTIONS' in tgt.properies: |
|
|
|
if 'INTERFACE_COMPILE_OPTIONS' in tgt.properies: |
|
|
|
compileOptions += tgt.properies['INTERFACE_COMPILE_OPTIONS'] |
|
|
|
compileOptions += [x for x in tgt.properies['INTERFACE_COMPILE_OPTIONS'] if x] |
|
|
|
|
|
|
|
|
|
|
|
if 'IMPORTED_CONFIGURATIONS' in tgt.properies: |
|
|
|
if 'IMPORTED_CONFIGURATIONS' in tgt.properies: |
|
|
|
cfgs = tgt.properies['IMPORTED_CONFIGURATIONS'] |
|
|
|
cfgs = [x for x in tgt.properies['IMPORTED_CONFIGURATIONS'] if x] |
|
|
|
cfg = cfgs[0] |
|
|
|
cfg = cfgs[0] |
|
|
|
|
|
|
|
|
|
|
|
if 'RELEASE' in cfgs: |
|
|
|
if 'RELEASE' in cfgs: |
|
|
|
cfg = 'RELEASE' |
|
|
|
cfg = 'RELEASE' |
|
|
|
|
|
|
|
|
|
|
|
if 'IMPORTED_IMPLIB_{}'.format(cfg) in tgt.properies: |
|
|
|
if 'IMPORTED_IMPLIB_{}'.format(cfg) in tgt.properies: |
|
|
|
libraries += tgt.properies['IMPORTED_IMPLIB_{}'.format(cfg)] |
|
|
|
libraries += [x for x in tgt.properies['IMPORTED_IMPLIB_{}'.format(cfg)] if x] |
|
|
|
elif 'IMPORTED_IMPLIB' in tgt.properies: |
|
|
|
elif 'IMPORTED_IMPLIB' in tgt.properies: |
|
|
|
libraries += tgt.properies['IMPORTED_IMPLIB'] |
|
|
|
libraries += [x for x in tgt.properies['IMPORTED_IMPLIB'] if x] |
|
|
|
elif 'IMPORTED_LOCATION_{}'.format(cfg) in tgt.properies: |
|
|
|
elif 'IMPORTED_LOCATION_{}'.format(cfg) in tgt.properies: |
|
|
|
libraries += tgt.properies['IMPORTED_LOCATION_{}'.format(cfg)] |
|
|
|
libraries += [x for x in tgt.properies['IMPORTED_LOCATION_{}'.format(cfg)] if x] |
|
|
|
elif 'IMPORTED_LOCATION' in tgt.properies: |
|
|
|
elif 'IMPORTED_LOCATION' in tgt.properies: |
|
|
|
libraries += tgt.properies['IMPORTED_LOCATION'] |
|
|
|
libraries += [x for x in tgt.properies['IMPORTED_LOCATION'] if x] |
|
|
|
|
|
|
|
|
|
|
|
if 'INTERFACE_LINK_LIBRARIES' in tgt.properies: |
|
|
|
if 'INTERFACE_LINK_LIBRARIES' in tgt.properies: |
|
|
|
otherDeps += tgt.properies['INTERFACE_LINK_LIBRARIES'] |
|
|
|
otherDeps += [x for x in tgt.properies['INTERFACE_LINK_LIBRARIES'] if x] |
|
|
|
|
|
|
|
|
|
|
|
if 'IMPORTED_LINK_DEPENDENT_LIBRARIES_{}'.format(cfg) in tgt.properies: |
|
|
|
if 'IMPORTED_LINK_DEPENDENT_LIBRARIES_{}'.format(cfg) in tgt.properies: |
|
|
|
otherDeps += tgt.properies['IMPORTED_LINK_DEPENDENT_LIBRARIES_{}'.format(cfg)] |
|
|
|
otherDeps += [x for x in tgt.properies['IMPORTED_LINK_DEPENDENT_LIBRARIES_{}'.format(cfg)] if x] |
|
|
|
elif 'IMPORTED_LINK_DEPENDENT_LIBRARIES' in tgt.properies: |
|
|
|
elif 'IMPORTED_LINK_DEPENDENT_LIBRARIES' in tgt.properies: |
|
|
|
otherDeps += tgt.properies['IMPORTED_LINK_DEPENDENT_LIBRARIES'] |
|
|
|
otherDeps += [x for x in tgt.properies['IMPORTED_LINK_DEPENDENT_LIBRARIES'] if x] |
|
|
|
|
|
|
|
|
|
|
|
for j in otherDeps: |
|
|
|
for j in otherDeps: |
|
|
|
if j in self.traceparser.targets: |
|
|
|
if j in self.traceparser.targets: |
|
|
@ -1391,7 +1389,7 @@ class CMakeDependency(ExternalDependency): |
|
|
|
mlog.debug('Compiler Options: {}'.format(compileOptions)) |
|
|
|
mlog.debug('Compiler Options: {}'.format(compileOptions)) |
|
|
|
mlog.debug('Libraries: {}'.format(libraries)) |
|
|
|
mlog.debug('Libraries: {}'.format(libraries)) |
|
|
|
|
|
|
|
|
|
|
|
self.compile_args = compileOptions + compileDefinitions + list(map(lambda x: '-I{}'.format(x), incDirs)) |
|
|
|
self.compile_args = compileOptions + compileDefinitions + ['-I{}'.format(x) for x in incDirs] |
|
|
|
self.link_args = libraries |
|
|
|
self.link_args = libraries |
|
|
|
|
|
|
|
|
|
|
|
def _setup_cmake_dir(self, cmake_file: str) -> str: |
|
|
|
def _setup_cmake_dir(self, cmake_file: str) -> str: |
|
|
|