summaryrefslogtreecommitdiffstats
path: root/util/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'util/cmake')
-rwxr-xr-xutil/cmake/pro2cmake.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py
index 97f92d7614..ffb36324cd 100755
--- a/util/cmake/pro2cmake.py
+++ b/util/cmake/pro2cmake.py
@@ -2710,8 +2710,14 @@ def write_main_part(
# Check for DESTDIR override
destdir = scope.get_string("DESTDIR")
if destdir:
- destdir = replace_path_constants(destdir, scope)
- extra_lines.append(f'OUTPUT_DIRECTORY "{destdir}"')
+ already_added = False
+ for line in extra_lines:
+ if line.startswith("OUTPUT_DIRECTORY"):
+ already_added = True
+ break
+ if not already_added:
+ destdir = replace_path_constants(destdir, scope)
+ extra_lines.append(f'OUTPUT_DIRECTORY "{destdir}"')
cm_fh.write(f"{spaces(indent)}{cmake_function}({name}\n")
for extra_line in extra_lines: