summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xutil/cmake/pro2cmake.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py
index 48bb8b7d88..f62d24a15c 100755
--- a/util/cmake/pro2cmake.py
+++ b/util/cmake/pro2cmake.py
@@ -3287,8 +3287,8 @@ def write_example(
example_install_dir = scope.expandString("target.path")
if not example_install_dir:
- example_install_dir = "examples"
- example_install_dir = example_install_dir.replace("$$[QT_INSTALL_EXAMPLES]", "examples")
+ example_install_dir = "${INSTALL_EXAMPLESDIR}"
+ example_install_dir = example_install_dir.replace("$$[QT_INSTALL_EXAMPLES]", "${INSTALL_EXAMPLESDIR}")
cm_fh.write(
"cmake_minimum_required(VERSION 3.14)\n"
@@ -3297,6 +3297,9 @@ def write_example(
"set(CMAKE_AUTOMOC ON)\n"
"set(CMAKE_AUTORCC ON)\n"
"set(CMAKE_AUTOUIC ON)\n\n"
+ "if(NOT DEFINED INSTALL_EXAMPLESDIR)\n"
+ " set(INSTALL_EXAMPLESDIR \"examples\")\n"
+ "endif()\n\n"
f'set(INSTALL_EXAMPLEDIR "{example_install_dir}")\n\n'
)