diff --git a/src/tools/sdktool/README.md b/src/tools/sdktool/README.md index a8e9a75f6d3..764fee53427 100644 --- a/src/tools/sdktool/README.md +++ b/src/tools/sdktool/README.md @@ -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. 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 available via command line switches. All operations will add any parameter -followed by another parameter in the form ":" to the +followed by another parameter in the form `:` to the configuration that they create. Currently supported types are int, bool, QString, QByteArray and QVariantList. 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: +====== + +``` +./sdktool --help Qt Creator SDK setup tool. - Usage:./sdktool + Usage: sdktool ARGS: --help|-h Print this help text @@ -26,109 +31,174 @@ ARGS: OPERATION: One of: 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 addTC add a tool chain to Qt Creator - findKey find a key in the settings of Qt Creator - find find a value in the settings of Qt Creator + addKit add a kit to Qt Creator 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 - rmKit remove a Kit from Qt Creator rmQt remove a Qt version 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: use "--help " 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: +================ + +``` ./sdktool addTC \ - --id "ProjectExplorer.ToolChain.Gcc:my_test_TC" \ - --name "Test TC" \ - --path /usr/bin/g++ \ + --id "ProjectExplorer.ToolChain.Gcc:company.product.toolchain.g++" \ + --language 2 + --name "GCC (C++, x86_64)" \ + --path /home/code/build/gcc-6.3/usr/bin/g++ \ --abi x86-linux-generic-elf-64bit \ --supportedAbis x86-linux-generic-elf-64bit,x86-linux-generic-elf-32bit \ ADDITIONAL_INTEGER_PARAMETER int:42 \ ADDITIONAL_STRING_PARAMETER "QString:some string" \ +``` Tricky parts: - - The id has to be in the form "ToolChainType:some_unique_part", where the - tool chain type must be one of (as of Qt Creator 2.6): - * ProjectExplorer.ToolChain.Msvc for Microsoft MSVC compilers + - language is one of: + * C + * 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 need to add it from the sdktool) - * ProjectExplorer.ToolChain.WinCE for Windows CE tool chain by - Microsoft (Note: This one will be autodetected anyway, so there - is little need to add it from the sdktool) - * ProjectExplorer.ToolChain.Gcc for a normal GCC (linux/mac) - * Qt4ProjectManager.ToolChain.Android for the Android tool chain - * ProjectExplorer.ToolChain.Clang for the Clang compiler - * ProjectExplorer.ToolChain.LinuxIcc for the LinuxICC compiler - * ProjectExplorer.ToolChain.Mingw for the Mingw compiler + * `ProjectExplorer.ToolChain.Gcc` for a normal GCC (linux/mac) + * `ProjectExplorer.ToolChain.Clang` for the Clang compiler + * `ProjectExplorer.ToolChain.LinuxIcc` for the LinuxICC compiler + * `ProjectExplorer.ToolChain.Mingw` for the Mingw compiler + * `ProjectExplorer.ToolChain.ClangCl` for the Clang/CL compiler + * `ProjectExplorer.ToolChain.Custom` for custom toolchain + * `Qt4ProjectManager.ToolChain.Android` for the Android tool chain + * `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. - 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. - - 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. -Add a Qt version: -./sdktool addQt \ - --id "my_test_Qt" \ - --name "Test Qt" \ - --qmake /home/code/build/qt4-4/bin/qmake \ - --type Qt4ProjectManager.QtVersion.Desktop \ +Add a debugger: +=============== + + +``` +./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: - - 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. - - 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): - * Qt4ProjectManager.QtVersion.Android for Android - * Qt4ProjectManager.QtVersion.Desktop for a desktop Qt - * RemoteLinux.EmbeddedLinuxQt for an embedded linux Qt - * Qt4ProjectManager.QtVersion.Maemo for an Maemo Qt - * Qt4ProjectManager.QtVersion.QNX.QNX for Qt on QNX - * Qt4ProjectManager.QtVersion.Simulator for Qt running in the Qt simulator - * Qt4ProjectManager.QtVersion.WinCE for Qt on WinCE + Currently these are (Qt Creator 4.6): + * `Qt4ProjectManager.QtVersion.Android` for Android + * `Qt4ProjectManager.QtVersion.Desktop` for a desktop Qt + * `Qt4ProjectManager.QtVersion.Ios` for iOS + * `Qt4ProjectManager.QtVersion.QNX.QNX` for QNX + * `RemoteLinux.EmbeddedLinuxQt` for Embedded Linux + * `WinRt.QtVersion.WindowsRuntime` for Windows RT + * `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 \ - --id "my_test_kit" \ - --name "Test Kit" \ - --debuggerengine 1 \ - --debugger /tmp/gdb-test \ - --devicetype Desktop \ + --id "company.product.kit" \ + --name "Qt %{Qt:Version} (company, product)" \ + --debuggerid "company.product.toolchain.gdb" \ + --devicetype GenericLinuxOsType \ --sysroot /tmp/sysroot \ - --toolchain "ProjectExplorer.ToolChain.Gcc:my_test_TC" \ - --qt "my_test_Qt" \ - --mkspec "testspec" \ + --Ctoolchain "ProjectExplorer.ToolChain.Gcc:company.product.toolchain.gcc" \ + --Cxxtoolchain "ProjectExplorer.ToolChain.Gcc:company.product.toolchain.g++" \ + --qt "company.product.qt" \ + --mkspec "devices/linux-mipsel-broadcom-97425-g++" \ +``` Tricky parts: - - debuggerengine is the integer used in the enum Debugger::DebuggerEngineType - 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() - - 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): - * Android.Device.Type for Android devices - * Desktop for code running on the local desktop - * HarmattanOsType for N9/N950 devices based on Harmattan - * Maemo5OsType for N900 devices based on Maemo + - `debuggerid` is one of the ids used when setting up toolchains with + `sdktool addDebugger`. - - toolchain is one of the ids used when setting up toolchains with sdktool addTC. + - `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. + - `` 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