diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2019-03-18 19:15:22 +0100 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2019-03-20 10:45:04 +0000 |
commit | 88549c28551538277a944d9ba690b19533a14e36 (patch) | |
tree | 82e703e79f1c0e9830b18f4812c54ab37cad176a /util | |
parent | 347261aaf64ce30f5dc45f2b16c7bc7a693cdea3 (diff) |
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 <alexandru.croitor@qt.io>
Diffstat (limited to 'util')
-rwxr-xr-x | util/cmake/pro2cmake.py | 10 |
1 files changed, 9 insertions, 1 deletions
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', }) |