|
| 1 | +To build **TRIK Studio for Windows x32 from the command line**, you'll need the following tools and steps: |
| 2 | + |
| 3 | +## Prerequisites |
| 4 | +*Ensure that you select options for installing required versions of compilers and tools (in this case, **32-bit**).* |
| 5 | +1. [**Python**](https://www.python.org/downloads/windows/): version 3.8 or above; |
| 6 | +2. [**MSYS2**](https://www.msys2.org/): latest version; |
| 7 | +3. [**Qt for Windows**](https://www.qt.io/download-open-source): version 5.12. Qt Creator and development tools will also be installed during this process. |
| 8 | + |
| 9 | +## Install dependencies |
| 10 | +Open msys2, install packages `pkg-config`, `libusb`, `zlib`: |
| 11 | + ``` |
| 12 | + pacman -Su mingw-w64-i686-pkg-config mingw-w64-i686-libusb mingw-w64-i686-zlib |
| 13 | + ``` |
| 14 | + |
| 15 | +## Build steps |
| 16 | +1. **Configure Environment Variables**. |
| 17 | +* Make sure that your PATH contains the **C:\Windows\System32** path. |
| 18 | +* Add the Qt path to the PATH variable, such as **C:\Qt\5.x.x\mingwXX_32\bin** and **C:\Qt\Tools\mingwXX0_32**, where 5.x.x is the Qt version and mingwXX_32 is your MinGW version. |
| 19 | +* Add correct Python path to the PATH variable, for example, **C:\Python\Python3XX-32**, where 3XX is your Python version. |
| 20 | +* Add the MinGW paths to the PATH variable, for example, **C:\msys64\mingw32\bin** and **C:\msys64\usr\bin**. |
| 21 | + |
| 22 | +*Here is an example of building for a 32-bit version of Windows with Python 3.10, Qt 5.12.0 and MinGW 7.3.0 32bit:* |
| 23 | + ``` |
| 24 | + set PATH=C:\Windows\System32;C:\Qt\Tools\mingw730_32\bin;C:\Qt\5.12.0\mingw73_32\bin;C:\Python\Python310-32;C:\msys64\mingw32\bin;C:\msys64\usr\bin:%PATH% |
| 25 | + ``` |
| 26 | + |
| 27 | +2. **Clone repo**. |
| 28 | +Open Command Prompt, go to folder, where you want to locate TRIK Studio. Clone TRIK Studio Repository and all dependent modules: |
| 29 | + ``` |
| 30 | + git clone https://github.com/trikset/trik-studio.git |
| 31 | + cd trik-studio |
| 32 | + git submodule update --init --recursive |
| 33 | + ``` |
| 34 | + |
| 35 | +3. **Prepare folder**. |
| 36 | +Create and go to the folder where you want to build the project: |
| 37 | + ``` |
| 38 | + mkdir build |
| 39 | + cd build |
| 40 | + ``` |
| 41 | + |
| 42 | +4. **Configuring the environment**. |
| 43 | +Use the `qmake` command to configure the environment, set various configuration flags and generate build files. You need to add to command parameters the main configuration file - **studio.pro**. This file usually locates in root directory of TRIK Studio project. Also you need to add **PYTHON_PATH** with the path to Python version (that you added to PATH in step 1) to the command parameters. |
| 44 | + |
| 45 | +Here is an example of configuration, where TRIK Studio is located in folder **C:\trik-studio**: |
| 46 | + ``` |
| 47 | + qmake C:\trik-studio\studio.pro -spec win32-g++ "CONFIG+=qtquickcompiler" CONFIG+=no-sanitizers CONFIG+=force_debug_info PYTHON_PATH=C:\Python\Python310-32 CONFIG+=tests && mingw32-make qmake_all |
| 48 | + ``` |
| 49 | + |
| 50 | +5. **Building the TRIK Studio**. |
| 51 | +Call `mingw32-make` to actually build the project using generated build files: |
| 52 | + ``` |
| 53 | + mingw32-make -j 4 |
| 54 | + ``` |
| 55 | + |
| 56 | +6. **Launching the application**. |
| 57 | +After a successful build without errors, go to directory with the compiled application and launch TRIK Studio: |
| 58 | + ``` |
| 59 | + cd bin\release |
| 60 | + trik-studio.exe |
| 61 | + ``` |
| 62 | + |
| 63 | +*Now you have successfully built TRIK Studio under 32-bit Windows, ready to use. Good luck with your work!* |
0 commit comments