From 88549c28551538277a944d9ba690b19533a14e36 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 18 Mar 2019 19:15:22 +0100 Subject: CMake: pro2cmake.py: Handle "target.path" and "INSTALLS = target" Add installation location information into CMakeLists.txt files if available in CMake. Change-Id: I498deac71b1cc33c7d30790e32da236afdcb23af Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index c5bd96b90b..a9d70ce84c 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1336,7 +1336,15 @@ def write_binary(cm_fh: typing.IO[str], scope: Scope, binary_name = scope.TARGET assert binary_name - extra = ['GUI', ] if gui else [] + extra = ['GUI',] if gui else[] + + target_path = scope.getString('target.path') + if target_path: + target_path = target_path.replace('$$[QT_INSTALL_EXAMPLES]', '${INSTALL_EXAMPLESDIR}') + extra.append('OUTPUT_DIRECTORY "{}"'.format(target_path)) + if 'target' in scope.get('INSTALLS'): + extra.append('INSTALL_DIRECTORY "{}"'.format(target_path)) + write_main_part(cm_fh, binary_name, 'Binary', 'add_qt_executable', scope, extra_lines=extra, indent=indent, known_libraries={'Qt::Core', }) -- cgit v1.2.3