Skip to content
Snippets Groups Projects
Commit 9159a555 authored by Kai Koehne's avatar Kai Koehne
Browse files

Replace also versioned commands

parent cf4e57f6
No related branches found
No related tags found
No related merge requests found
...@@ -22,8 +22,11 @@ def simplify(content): ...@@ -22,8 +22,11 @@ def simplify(content):
# Remove CMAKE_INCLUDE_CURRENT_DIR # Remove CMAKE_INCLUDE_CURRENT_DIR
content = re.sub(r"set\(CMAKE_INCLUDE_CURRENT_DIR ON\)\n\n", "", content) content = re.sub(r"set\(CMAKE_INCLUDE_CURRENT_DIR ON\)\n\n", "", content)
# Use non-versioned commands
content = re.sub(r"qt6_(\w+\()", r"qt_\1", content)
# Combine find_package(Qt6 calls) # Combine find_package(Qt6 calls)
find_package_regex = re.compile(r"find_package\(Qt6 COMPONENTS (.*)\)") find_package_regex = re.compile(r"find_package\(Qt6 COMPONENTS (.*)(?:REQUIRED)?\)")
qt_components = " ".join(find_package_regex.findall(content)) qt_components = " ".join(find_package_regex.findall(content))
qt_components = " ".join(sorted(qt_components.split())) qt_components = " ".join(sorted(qt_components.split()))
content = find_package_regex.sub(r"find_package(Qt6 REQUIRED COMPONENTS {})".format(qt_components), content, count=1) content = find_package_regex.sub(r"find_package(Qt6 REQUIRED COMPONENTS {})".format(qt_components), content, count=1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment