Skip to content

Commit

Permalink
Evaluate conditions for CMake dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-reynolds committed Feb 20, 2021
1 parent a9672d7 commit e33c13a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmake/parse_package_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
from __future__ import print_function

import argparse
import os
import sys
from collections import OrderedDict

Expand All @@ -49,6 +50,8 @@ def _get_output(package):
:param package: Package object
:returns: list of str, lines to output
"""
package.evaluate_conditions(os.environ)

values = OrderedDict()
values['VERSION'] = '"%s"' % package.version

Expand Down Expand Up @@ -82,7 +85,7 @@ def _get_output(package):

def _get_dependency_values(key, depends):
values = OrderedDict()
values[key] = ' '.join(['"%s"' % str(d) for d in depends])
values[key] = ' '.join(['"%s"' % str(d) for d in depends if d.evaluated_condition is not False])
for d in depends:
comparisons = ['version_lt', 'version_lte', 'version_eq', 'version_gte', 'version_gt']
for comp in comparisons:
Expand Down

0 comments on commit e33c13a

Please sign in to comment.