-
Notifications
You must be signed in to change notification settings - Fork 1
Building and developing the TMC plugin for Qt Creator on Windows
Please refer to the instructions for Compiling Qt and Qt Creator on Windows at the Qt Creator GitHub README.
To set up your development environment, you will need to set up the following:
- Download and install Perl version 5.10 or later
- Download and install Qt Creator Community Edition from qt.io
- As a result you will have installed a C++ compiler (MingW) and Qt when installing the CE
- Download and compile Qt Creator from GitHub (master or latest version)
Please note that we will refer to Qt Creator Community Edition as Qt Creator CE and the Qt Creator you compiled as Qt Creator SA to avoid confusion between the two.
The README instructs you to download and build Qt and MingW separately. This is not required if you download and install the Qt Creator CE. Due to the build time for Qt, we do not recommend downloading and building Qt separately. Please make sure when installing the Qt Creator CE that you also installed Qt and MingW. We have used MingW exclusively as our C++ compiler when working on this project on Windows. The instructions will reflect this choice and if choosing to use Microsoft Visual Studio you are on your own.
The Qt Creator CE IDE will be your development environment IDE. The Qt Creator SA IDE will be your deployment/target IDE.
As instructed in the Qt Creator README, for convenience it is recommended to create a shell prompt with
the correct environment variables set for running Qt Creator. We will refer to this file as the qtvars.bat
file.
set PATH= <path_to_qt>\bin; <path_to_mingw>\bin; <working_directory>\creator\bin;%PATH%
set QMAKESPEC=win32-g++
set QTC_BUILD= <path_to_Qt_Creator_SA>
set QTC_SOURCE= <path_to_Qt_Creator_SA>
<path_to_Qt_Creator_CE>
Here is an example of what your qtvars.bat
file should look like:
set PATH=C:\Qt\5.9.1\mingw53_32\bin;C:\Qt\Tools\mingw530_32\bin;D:\qtcreator\qt-creator\bin;%PATH%
set QMAKESPEC=win32-g++
set QTC_BUILD=D:/qtcreator/qt-creator_SA
set QTC_SOURCE=D:/qtcreator/qt-creator_SA
D:/qtcreator/qt-creator/bin/qtcreator
You will use the qtvars.bat
file to start your development environment IDE.
Please take note that the QTC_SOURCE
variable needs to be referring to a directory where the source code for Qt Creator can be found.
To build the TMC plugin, please open the TMC plugin project in your development environment.
Select whether you want to build the "Release" or "Debug" version of the plugin.
After building, your .dll
file will be located in the plugin directory under your specified QTC_BUILD
directory
(for example D:/qtcreator/qt-creator_SA/lib/qtcreator/plugins
) under the name TestMyCode4.dll
if built as "Release" and TestMyCode4d.dll
if built as "Debug".
NB: For running the "Release" version of the plugin you will require a "Release" build Qt Creator SA, and for running the "Debug" version of the plugin you will require a "Debug" build Qt Creator SA. We were unable to get the "Debug" build version of Qt Creator to run properly on Windows, so all our work on Windows has been done using the "Release" build Qt Creator SA and compiling the plugin as "Release" build.
Prerequisites for running the TMC plugin are:
- User has the Java JRE installed and set the environment variables required for running the command
java
in PowerShell/Command Prompt. - User has the executable
tmc-langs-cli
.jar
file from the tmc-langs repository (for example,tmc-langs-cli-0.7.7-SNAPSHOT.jar
or newer) located on their hard drive. - User has the Qt Creator IDE installed and set up deployment/target IDE.
After building the plugin using your Qt Creator CE, you will now be able to run the project in your IDE. This will start an instance of Qt Creator SA using the TMC plugin for Qt Creator.
As of writing, local TMC-testing is done using TMC-cli.
There is a possibility that the the local testing will be done using the Qt Creator plugin autotest
instead of TMC-cli in a future iteration and this documentation should be updated to reflect the changes when that happens.