pro2cmake: Translate C++ standard version checks

Translate checks like
    contains(QT_CONFIG, c++11)
to
    cxx_std_11 IN_LIST CMAKE_CXX_COMPILE_FEATURES

Also allows contains(CONFIG, c++11) and different versions of course.

Change-Id: I0f51a1ee7c92df6b87c31d0fb64c22fdba2002ec
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Joerg Bornemann 2019-10-11 14:35:35 +02:00
parent dd57f99004
commit 9bd6cec74d

View File

@ -1227,6 +1227,7 @@ def map_condition(condition: str) -> str:
condition = unwrap_if(condition)
condition = re.sub(r"\bisEmpty\s*\((.*?)\)", r"\1_ISEMPTY", condition)
condition = re.sub(r"\bcontains\s*\(\s*(?:QT_)?CONFIG\s*,\s*c\+\+(\d+)\)", r"cxx_std_\1 IN_LIST CMAKE_CXX_COMPILE_FEATURES", condition)
condition = re.sub(r'\bcontains\s*\((.*?),\s*"?(.*?)"?\)', r"\1___contains___\2", condition)
condition = re.sub(r'\bequals\s*\((.*?),\s*"?(.*?)"?\)', r"\1___equals___\2", condition)
condition = re.sub(r'\bisEqual\s*\((.*?),\s*"?(.*?)"?\)', r"\1___equals___\2", condition)