sdktool: Update README and convert it to markdown

Change-Id: I4ea36841e51138c4feed85d8146a07f8824ee853
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Christian Gagneraud
2017-10-01 18:41:31 +13:00
committed by Orgad Shaneh
parent 49ed91b205
commit e8d7a1f21e

View File

@@ -1,4 +1,4 @@
The SDK tool can be used to set up Qt versions, tool chains and kits The SDK tool can be used to set up Qt versions, tool chains, devices and kits
in Qt Creator. in Qt Creator.
There still is a lot of knowledge about Qt Creator internals required There still is a lot of knowledge about Qt Creator internals required
@@ -6,18 +6,23 @@ to use this tool!
Note that some tool chains/Qt versions/kits may require settings not Note that some tool chains/Qt versions/kits may require settings not
available via command line switches. All operations will add any parameter available via command line switches. All operations will add any parameter
followed by another parameter in the form "<TYPE>:<VALUE>" to the followed by another parameter in the form `<TYPE>:<VALUE>` to the
configuration that they create. configuration that they create.
Currently supported types are int, bool, QString, QByteArray and QVariantList. Currently supported types are int, bool, QString, QByteArray and QVariantList.
Dependencies: Dependencies:
The SDK tool depends on the Utils library of Qt Creator and Qt itself. =============
Please make sure both libraries are found by setting PATH/LD_LIBRARY_PATH.
The SDK tool depends only on Qt core library.
Usage: Usage:
======
```
./sdktool --help
Qt Creator SDK setup tool. Qt Creator SDK setup tool.
Usage:./sdktool <ARGS> <OPERATION> <OPERATION_ARGS> Usage: sdktool <ARGS> <OPERATION> <OPERATION_ARGS>
ARGS: ARGS:
--help|-h Print this help text --help|-h Print this help text
@@ -26,109 +31,174 @@ ARGS:
OPERATION: OPERATION:
One of: One of:
addKeys add settings to Qt Creator configuration addKeys add settings to Qt Creator configuration
addKit add a Kit to Qt Creator addCMake add a CMake tool to Qt Creator
addDebugger add a debugger to Qt Creator
addDev add a device to Qt Creator
addQt add a Qt version to Qt Creator addQt add a Qt version to Qt Creator
addTC add a tool chain to Qt Creator addTC add a tool chain to Qt Creator
findKey find a key in the settings of Qt Creator addKit add a kit to Qt Creator
find find a value in the settings of Qt Creator
get get settings from Qt Creator configuration get get settings from Qt Creator configuration
rmCMake remove a CMake tool from Qt Creator
rmKit remove a kit from Qt Creator
rmDebugger remove a debugger from Qt Creator
rmDev remove a device from Qt Creator
rmKeys remove settings from Qt Creator configuration rmKeys remove settings from Qt Creator configuration
rmKit remove a Kit from Qt Creator
rmQt remove a Qt version from Qt Creator rmQt remove a Qt version from Qt Creator
rmTC remove a tool chain from Qt Creator rmTC remove a tool chain from Qt Creator
findKey find a key in the settings of Qt Creator
find find a value in the settings of Qt Creator
OPERATION_ARGS: OPERATION_ARGS:
use "--help <OPERATION>" to get help on the arguments required for an operation. use "--help <OPERATION>" to get help on the arguments required for an operation.
```
Help for individual operations can be retrieved using
./sdktool --help addKit
Examples:
Add a tool chain: Add a tool chain:
================
```
./sdktool addTC \ ./sdktool addTC \
--id "ProjectExplorer.ToolChain.Gcc:my_test_TC" \ --id "ProjectExplorer.ToolChain.Gcc:company.product.toolchain.g++" \
--name "Test TC" \ --language 2
--path /usr/bin/g++ \ --name "GCC (C++, x86_64)" \
--path /home/code/build/gcc-6.3/usr/bin/g++ \
--abi x86-linux-generic-elf-64bit \ --abi x86-linux-generic-elf-64bit \
--supportedAbis x86-linux-generic-elf-64bit,x86-linux-generic-elf-32bit \ --supportedAbis x86-linux-generic-elf-64bit,x86-linux-generic-elf-32bit \
ADDITIONAL_INTEGER_PARAMETER int:42 \ ADDITIONAL_INTEGER_PARAMETER int:42 \
ADDITIONAL_STRING_PARAMETER "QString:some string" \ ADDITIONAL_STRING_PARAMETER "QString:some string" \
```
Tricky parts: Tricky parts:
- The id has to be in the form "ToolChainType:some_unique_part", where the - language is one of:
tool chain type must be one of (as of Qt Creator 2.6): * C
* ProjectExplorer.ToolChain.Msvc for Microsoft MSVC compilers * Cxx
- `id` has to be in the form `ToolChainType:some_unique_part`, where the
tool chain type can be one of the following, or other toolchains that plugins provide:
* `ProjectExplorer.ToolChain.Msvc` for Microsoft MSVC compilers
(Note: This one will be autodetected anyway, so there is little (Note: This one will be autodetected anyway, so there is little
need to add it from the sdktool) need to add it from the sdktool)
* ProjectExplorer.ToolChain.WinCE for Windows CE tool chain by * `ProjectExplorer.ToolChain.Gcc` for a normal GCC (linux/mac)
Microsoft (Note: This one will be autodetected anyway, so there * `ProjectExplorer.ToolChain.Clang` for the Clang compiler
is little need to add it from the sdktool) * `ProjectExplorer.ToolChain.LinuxIcc` for the LinuxICC compiler
* ProjectExplorer.ToolChain.Gcc for a normal GCC (linux/mac) * `ProjectExplorer.ToolChain.Mingw` for the Mingw compiler
* Qt4ProjectManager.ToolChain.Android for the Android tool chain * `ProjectExplorer.ToolChain.ClangCl` for the Clang/CL compiler
* ProjectExplorer.ToolChain.Clang for the Clang compiler * `ProjectExplorer.ToolChain.Custom` for custom toolchain
* ProjectExplorer.ToolChain.LinuxIcc for the LinuxICC compiler * `Qt4ProjectManager.ToolChain.Android` for the Android tool chain
* ProjectExplorer.ToolChain.Mingw for the Mingw compiler * `Qnx.QccToolChain` for the Qnx QCC tool chain
Check the classes derived from ProjectExplorer::ToolChain for their Check the classes derived from `ProjectExplorer::ToolChain` for their
Ids. Ids.
The some_unique_part can be anything. Creator uses GUIDs by default, The `some_unique_part` can be anything. Qt Creator uses GUIDs by default,
but any string is fine for the SDK to use. but any string is fine for the SDK to use.
- The ABI needs to be in a format that ProjectExplorer::Abi::fromString(...) - `abi` needs to be in a format that `ProjectExplorer::Abi::fromString(...)`
can parse. can parse.
Add a Qt version: Add a debugger:
./sdktool addQt \ ===============
--id "my_test_Qt" \
--name "Test Qt" \
--qmake /home/code/build/qt4-4/bin/qmake \ ```
--type Qt4ProjectManager.QtVersion.Desktop \ ./sdktool addDebugger \
--id "company.product.toolchain.gdb" \
--name "GDB (company, product)" \
--engine 1 \
--binary /home/code/build/gdb-7.12/bin/gdb \
--abis arm-linux-generic-elf-32 \
```
Tricky parts: Tricky parts:
- The id can be any unique string. In creator this is set as the autodetection - `id` can be any unique string. In Qt Creator this is set as the autodetection
source of the Qt version.
TODO: is it use in any special way?
- `engine` is the integer used in the enum `Debugger::DebuggerEngineType`
Currently these are (Qt Creator 4.6):
* 1 for gdb
* 4 for cdb
* 8 for pdb
* 256 for lldb
- `binary` can be a absolute path, the value `auto` or an ABI.
This is used to find the appropriate debugger for MSVC toolchains
where Creator does not know the binary path itself.
Add a Qt version:
=================
```
./sdktool addQt \
--id "company.product.qt" \
--name "Custom Qt" \
--qmake /home/code/build/qt-5.9/bin/qmake \
--type Qt4ProjectManager.QtVersion.Desktop \
```
Tricky parts:
- `id` can be any unique string. In Qt Creator this is set as the autodetection
source of the Qt version. source of the Qt version.
- type must be the string returned by BaseQtVersion::type(). - `type` must be the string returned by `BaseQtVersion::type()`.
Currently these are (Qt Creator 2.6): Currently these are (Qt Creator 4.6):
* Qt4ProjectManager.QtVersion.Android for Android * `Qt4ProjectManager.QtVersion.Android` for Android
* Qt4ProjectManager.QtVersion.Desktop for a desktop Qt * `Qt4ProjectManager.QtVersion.Desktop` for a desktop Qt
* RemoteLinux.EmbeddedLinuxQt for an embedded linux Qt * `Qt4ProjectManager.QtVersion.Ios` for iOS
* Qt4ProjectManager.QtVersion.Maemo for an Maemo Qt * `Qt4ProjectManager.QtVersion.QNX.QNX` for QNX
* Qt4ProjectManager.QtVersion.QNX.QNX for Qt on QNX * `RemoteLinux.EmbeddedLinuxQt` for Embedded Linux
* Qt4ProjectManager.QtVersion.Simulator for Qt running in the Qt simulator * `WinRt.QtVersion.WindowsRuntime` for Windows RT
* Qt4ProjectManager.QtVersion.WinCE for Qt on WinCE * `WinRt.QtVersion.WindowsPhone` for Windows RT phone
Add a Kit using the newly set up tool chain and Qt version: Add a kit:
==========
Using the newly set up tool chain and Qt version:
```
./sdktool addKit \ ./sdktool addKit \
--id "my_test_kit" \ --id "company.product.kit" \
--name "Test Kit" \ --name "Qt %{Qt:Version} (company, product)" \
--debuggerengine 1 \ --debuggerid "company.product.toolchain.gdb" \
--debugger /tmp/gdb-test \ --devicetype GenericLinuxOsType \
--devicetype Desktop \
--sysroot /tmp/sysroot \ --sysroot /tmp/sysroot \
--toolchain "ProjectExplorer.ToolChain.Gcc:my_test_TC" \ --Ctoolchain "ProjectExplorer.ToolChain.Gcc:company.product.toolchain.gcc" \
--qt "my_test_Qt" \ --Cxxtoolchain "ProjectExplorer.ToolChain.Gcc:company.product.toolchain.g++" \
--mkspec "testspec" \ --qt "company.product.qt" \
--mkspec "devices/linux-mipsel-broadcom-97425-g++" \
```
Tricky parts: Tricky parts:
- debuggerengine is the integer used in the enum Debugger::DebuggerEngineType - `devicetype` is the string returned IDevice::type()
The most important type is 1 for GDB.
- debugger can be a absolute path or the value: 'auto'
- devicetype is the string returned IDevice::type() Currently these are (Qt Creator 4.6):
* `Android.Device.Type` for Android devices
* `Desktop` for code running on the local desktop
* `Ios.Device.Type` for an iOS device
* `Ios.Simulator.Type` for an iOS simulator
* `GenericLinuxOsType` for an embedded Linux device
* `WinRt.Device.Local` for Windows RT (local)
* `WinRt.Device.Emulator` for a Windows RT emulator
* `WinRt.Device.Phone` for a Windows RT phone
Currently these are (Qt Creator 2.6): - `debuggerid` is one of the ids used when setting up toolchains with
* Android.Device.Type for Android devices `sdktool addDebugger`.
* Desktop for code running on the local desktop
* HarmattanOsType for N9/N950 devices based on Harmattan
* Maemo5OsType for N900 devices based on Maemo
- toolchain is one of the ids used when setting up toolchains with sdktool addTC. - `<Lang>toolchain` is one of the ids used when setting up toolchains with
`sdktool addTC`.
- qt is one of the ids used when setting up Qt versions with sdktool addQt. - `<Lang>` is one of (options can be extended by plugins):
* C, Cxx, Nim
- `qt` is one of the ids used when setting up Qt versions with `sdktool addQt`.
Add a device:
=============
TODO
Add a CMake:
============
TODO