From af7b0534c6d6c42c949a802952dab981d64d1f6f Mon Sep 17 00:00:00 2001 From: Leander Beernaert Date: Wed, 9 Oct 2019 11:23:03 +0200 Subject: [PATCH] Correct Examples install directory Set the example install directory based on the path specified in target.path qmake property. Change-Id: Ia791995a3241fbf2f5ea1e48f2b9f93a90f1c3d7 Reviewed-by: Alexandru Croitor Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 46c70cca918..2ced79af854 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -2921,6 +2921,11 @@ def write_example( binary_name = scope.TARGET assert binary_name + example_install_dir = scope.get_string('target.path') + if not example_install_dir: + example_install = 'examples' + example_install_dir = example_install_dir.replace('$$[QT_INSTALL_EXAMPLES]', 'examples') + cm_fh.write( "cmake_minimum_required(VERSION 3.14)\n" f"project({binary_name} LANGUAGES CXX)\n\n" @@ -2928,7 +2933,7 @@ def write_example( "set(CMAKE_AUTOMOC ON)\n" "set(CMAKE_AUTORCC ON)\n" "set(CMAKE_AUTOUIC ON)\n\n" - 'set(INSTALL_EXAMPLEDIR "examples")\n\n' + f'set(INSTALL_EXAMPLEDIR "{example_install_dir}")\n\n' ) (public_libs, private_libs) = extract_cmake_libraries(scope)