Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
helperscripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kai Koehne
helperscripts
Commits
9159a555
Commit
9159a555
authored
3 years ago
by
Kai Koehne
Browse files
Options
Downloads
Patches
Plain Diff
Replace also versioned commands
parent
cf4e57f6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
qt_example_cmakelists_cleanup.py
+4
-1
4 additions, 1 deletion
qt_example_cmakelists_cleanup.py
with
4 additions
and
1 deletion
qt_example_cmakelists_cleanup.py
+
4
−
1
View file @
9159a555
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment