diff options
Diffstat (limited to 'util/cmake/pro2cmake.py')
-rwxr-xr-x | util/cmake/pro2cmake.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 8378cd6228..97f92d7614 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1370,6 +1370,10 @@ class Scope(object): return re.sub(r"\.\./", "", target) @property + def TARGET_ORIGINAL(self) -> str: + return self.expandString("TARGET") or os.path.splitext(os.path.basename(self.file))[0] + + @property def _INCLUDED(self) -> List[str]: return self.get("_INCLUDED") @@ -2904,6 +2908,10 @@ def write_test(cm_fh: IO[str], scope: Scope, gui: bool = False, *, indent: int = for path in importpath: extra.append(f' "{path}"') + target_original = scope.TARGET_ORIGINAL + if target_original and target_original.startswith("../"): + extra.append("OUTPUT_DIRECTORY \"${CMAKE_CURRENT_BINARY_DIR}/../\"") + requires_content = expand_project_requirements(scope, skip_message=True) if requires_content: requires_content += "\n" |