cmake scripts: flake8 cleanup
At least setting the example install dir looks like a bug. Change-Id: Ibcced739d05de5445fa455e509cc6f42b9ed935b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
parent
6167031ecc
commit
174b17d65d
@ -37,7 +37,6 @@ import sys
|
||||
import re
|
||||
import io
|
||||
import glob
|
||||
import collections
|
||||
|
||||
from condition_simplifier import simplify_condition
|
||||
from condition_simplifier_cache import set_condition_simplified_cache_enabled
|
||||
@ -618,6 +617,7 @@ class AddOperation(Operation):
|
||||
def __repr__(self):
|
||||
return f"+({self._dump()})"
|
||||
|
||||
|
||||
class UniqueAddOperation(Operation):
|
||||
def process(
|
||||
self, key: str, sinput: List[str], transformer: Callable[[List[str]], List[str]]
|
||||
@ -631,6 +631,7 @@ class UniqueAddOperation(Operation):
|
||||
def __repr__(self):
|
||||
return f"*({self._dump()})"
|
||||
|
||||
|
||||
class ReplaceOperation(Operation):
|
||||
def process(
|
||||
self, key: str, sinput: List[str], transformer: Callable[[List[str]], List[str]]
|
||||
@ -663,6 +664,7 @@ class ReplaceOperation(Operation):
|
||||
def __repr__(self):
|
||||
return f"*({self._dump()})"
|
||||
|
||||
|
||||
class SetOperation(Operation):
|
||||
def process(
|
||||
self, key: str, sinput: List[str], transformer: Callable[[List[str]], List[str]]
|
||||
@ -1289,6 +1291,7 @@ _path_replacements = {
|
||||
"$$OUT_PWD": "${CMAKE_CURRENT_BINARY_DIR}",
|
||||
}
|
||||
|
||||
|
||||
def replace_path_constants(path: str, scope: Scope) -> str:
|
||||
""" Clean up DESTDIR and target.path """
|
||||
if path.startswith("./"):
|
||||
@ -1970,6 +1973,7 @@ def write_statecharts(cm_fh: IO[str], target: str, scope: Scope, indent: int = 0
|
||||
cm_fh.write(f"{spaces(indent)}{f}\n")
|
||||
cm_fh.write(")\n")
|
||||
|
||||
|
||||
def write_qlalrsources(cm_fh: IO[str], target: str, scope: Scope, indent: int = 0):
|
||||
sources = scope.get_files("QLALRSOURCES", use_vpath=True)
|
||||
if not sources:
|
||||
@ -1982,6 +1986,7 @@ def write_qlalrsources(cm_fh: IO[str], target: str, scope: Scope, indent: int =
|
||||
cm_fh.write(f"{spaces(indent)}\"\"\n")
|
||||
cm_fh.write(")\n")
|
||||
|
||||
|
||||
def write_repc_files(cm_fh: IO[str], target: str, scope: Scope, indent: int = 0):
|
||||
for t in ["SOURCE", "REPLICA", "MERGED"]:
|
||||
sources = scope.get_files("REPC_" + t, use_vpath=True)
|
||||
@ -1993,6 +1998,7 @@ def write_repc_files(cm_fh: IO[str], target: str, scope: Scope, indent: int = 0)
|
||||
cm_fh.write(f"{spaces(indent)}{f}\n")
|
||||
cm_fh.write(")\n")
|
||||
|
||||
|
||||
def expand_project_requirements(scope: Scope, skip_message: bool = False) -> str:
|
||||
requirements = ""
|
||||
for requirement in scope.get("_REQUIREMENTS"):
|
||||
@ -2637,7 +2643,7 @@ def write_example(
|
||||
|
||||
example_install_dir = scope.get_string('target.path')
|
||||
if not example_install_dir:
|
||||
example_install = 'examples'
|
||||
example_install_dir = 'examples'
|
||||
example_install_dir = example_install_dir.replace('$$[QT_INSTALL_EXAMPLES]', 'examples')
|
||||
|
||||
cm_fh.write(
|
||||
@ -2717,9 +2723,7 @@ def write_example(
|
||||
else:
|
||||
add_target = f'add_{"qt_gui_" if gui else ""}executable({binary_name}'
|
||||
|
||||
|
||||
write_all_source_file_lists(cm_fh, scope, add_target, indent=0)
|
||||
|
||||
cm_fh.write(")\n")
|
||||
|
||||
for scope in scopes:
|
||||
|
Loading…
x
Reference in New Issue
Block a user