'Set the dstSubfolderSpec and dstPath properties from path.
path may be specified in the same notation used for XCHierarchicalElements,
specifically, "$(DIR)/path".'

def SetDestination(self, path):

    path_tree_match = self.path_tree_re.search(path)
    if path_tree_match:
        path_tree = path_tree_match.group(1)
        relative_path = path_tree_match.group(3)
        if (path_tree in self.path_tree_to_subfolder):
            subfolder = self.path_tree_to_subfolder[path_tree]
            if (relative_path is None):
                relative_path = ''
        else:
            subfolder = 0
            relative_path = path
    elif path.startswith('/'):
        subfolder = 0
        relative_path = path[1:]
    else:
        raise ValueError(("Can't    use    path    %s    in    a    %s" % (path, self.__class__.__name__)))
    self._properties['dstPath'] = relative_path
    self._properties['dstSubfolderSpec'] = subfolder
