|
|
@ -1639,7 +1639,7 @@ class CMakeDependency(ExternalDependency): |
|
|
|
|
|
|
|
|
|
|
|
self.targets[tline.args[0]] = CMakeTarget(tline.args[0], 'CUSTOM', {}) |
|
|
|
self.targets[tline.args[0]] = CMakeTarget(tline.args[0], 'CUSTOM', {}) |
|
|
|
|
|
|
|
|
|
|
|
def _cmake_set_property(self, tline: CMakeTraceLine): |
|
|
|
def _cmake_set_property(self, tline: CMakeTraceLine) -> None: |
|
|
|
# DOC: https://cmake.org/cmake/help/latest/command/set_property.html |
|
|
|
# DOC: https://cmake.org/cmake/help/latest/command/set_property.html |
|
|
|
args = list(tline.args) |
|
|
|
args = list(tline.args) |
|
|
|
|
|
|
|
|
|
|
@ -1649,8 +1649,10 @@ class CMakeDependency(ExternalDependency): |
|
|
|
|
|
|
|
|
|
|
|
append = False |
|
|
|
append = False |
|
|
|
targets = [] |
|
|
|
targets = [] |
|
|
|
while len(args) > 0: |
|
|
|
while args: |
|
|
|
curr = args.pop(0) |
|
|
|
curr = args.pop(0) |
|
|
|
|
|
|
|
# XXX: APPEND_STRING is specifically *not* supposed to create a |
|
|
|
|
|
|
|
# list, is treating them as aliases really okay? |
|
|
|
if curr == 'APPEND' or curr == 'APPEND_STRING': |
|
|
|
if curr == 'APPEND' or curr == 'APPEND_STRING': |
|
|
|
append = True |
|
|
|
append = True |
|
|
|
continue |
|
|
|
continue |
|
|
@ -1660,31 +1662,29 @@ class CMakeDependency(ExternalDependency): |
|
|
|
|
|
|
|
|
|
|
|
targets.append(curr) |
|
|
|
targets.append(curr) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if not args: |
|
|
|
|
|
|
|
raise self._gen_exception('CMake: set_property() faild to parse argument list\n{}'.format(tline)) |
|
|
|
|
|
|
|
|
|
|
|
if len(args) == 1: |
|
|
|
if len(args) == 1: |
|
|
|
# Tries to set property to nothing so nothing has to be done |
|
|
|
# Tries to set property to nothing so nothing has to be done |
|
|
|
return |
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
if len(args) < 2: |
|
|
|
identifier = args.pop(0) |
|
|
|
raise self._gen_exception('CMake: set_property() faild to parse argument list\n{}'.format(tline)) |
|
|
|
value = ' '.join(args).split(';') |
|
|
|
|
|
|
|
if not value: |
|
|
|
propName = args[0] |
|
|
|
|
|
|
|
propVal = list(itertools.chain(*map(lambda x: x.split(';'), args[1:]))) |
|
|
|
|
|
|
|
propVal = list(filter(lambda x: len(x) > 0, propVal)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(propVal) == 0: |
|
|
|
|
|
|
|
return |
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
for i in targets: |
|
|
|
for i in targets: |
|
|
|
if i not in self.targets: |
|
|
|
if i not in self.targets: |
|
|
|
raise self._gen_exception('CMake: set_property() TARGET {} not found\n{}'.format(i, tline)) |
|
|
|
raise self._gen_exception('CMake: set_property() TARGET {} not found\n{}'.format(i, tline)) |
|
|
|
|
|
|
|
|
|
|
|
if propName not in self.targets[i].properies: |
|
|
|
if identifier not in self.targets[i].properies: |
|
|
|
self.targets[i].properies[propName] = [] |
|
|
|
self.targets[i].properies[identifier] = [] |
|
|
|
|
|
|
|
|
|
|
|
if append: |
|
|
|
if append: |
|
|
|
self.targets[i].properies[propName] += propVal |
|
|
|
self.targets[i].properies[identifier] += value |
|
|
|
else: |
|
|
|
else: |
|
|
|
self.targets[i].properies[propName] = propVal |
|
|
|
self.targets[i].properies[identifier] = value |
|
|
|
|
|
|
|
|
|
|
|
def _cmake_set_target_properties(self, tline: CMakeTraceLine) -> None: |
|
|
|
def _cmake_set_target_properties(self, tline: CMakeTraceLine) -> None: |
|
|
|
# DOC: https://cmake.org/cmake/help/latest/command/set_target_properties.html |
|
|
|
# DOC: https://cmake.org/cmake/help/latest/command/set_target_properties.html |
|
|
|