|
| 1 | +# Windows (Qt6) |
| 2 | + |
| 3 | +Instructions for building the Qt6 GUI of this project on Windows. |
| 4 | + |
| 5 | +## 1. Prerequisites |
| 6 | + |
| 7 | +These dependencies must be installed before building the project. This tutorial assumes that Qt6 has been installed to the default location (`C:\Qt`). |
| 8 | + |
| 9 | +- [Visual Studio 2022](https://visualstudio.microsoft.com/vs/) |
| 10 | + - Workload: Desktop development with C++ |
| 11 | +- [winget-cli](https://github.com/microsoft/winget-cli) |
| 12 | +- [Qt6](https://www.qt.io/download) |
| 13 | + - Component: Qt6 with MSVC 2022 64-bit |
| 14 | + - Component: Qt Creator |
| 15 | + |
| 16 | +## 1. Clone the Repository |
| 17 | + |
| 18 | +```bash |
| 19 | +# Install Git if not already installed |
| 20 | +winget install -e --id=Git.Git |
| 21 | + |
| 22 | +# Clone the repository |
| 23 | +git clone --recurse-submodules https://github.com/k4yt3x/video2x-qt6.git |
| 24 | +cd video2x-qt6 |
| 25 | +``` |
| 26 | + |
| 27 | +## 2. Install Dependencies |
| 28 | + |
| 29 | +You need to have the `libvideo2x` shared library built before building the Qt6 GUI. Put the built binaries in `third_party/libvideo2x-shared`. |
| 30 | + |
| 31 | +```bash |
| 32 | +# Versions of manually installed dependencies |
| 33 | +$ffmpegVersion = "7.1" |
| 34 | + |
| 35 | +# Download and extract FFmpeg |
| 36 | +curl -Lo ffmpeg-shared.zip "https://github.com/GyanD/codexffmpeg/releases/download/$ffmpegVersion/ffmpeg-$ffmpegVersion-full_build-shared.zip" |
| 37 | +Expand-Archive -Path ffmpeg-shared.zip -DestinationPath third_party |
| 38 | +Rename-Item -Path "third_party/ffmpeg-$ffmpegVersion-full_build-shared" -NewName ffmpeg-shared |
| 39 | +``` |
| 40 | + |
| 41 | +## 3. Build the Project |
| 42 | + |
| 43 | +1. Open the `CMakeLists.txt` file in Qt Creator as the project file. |
| 44 | +2. Click on the hammer icon at the bottom left of the window to build the project. |
| 45 | +3. Built binaries will be located in the `build` directory. |
| 46 | + |
| 47 | +After the build finishes, you will need to copy the Qt6 DLLs and other dependencies to the build directory to run the application. Before you run the following commands, remove everything in the release directory except for `video2x-qt6.exe` and the `.qm` files as they are not required for running the application. Then, run the following command to copy the Qt6 runtime DLLs: |
| 48 | + |
| 49 | +```bash |
| 50 | +C:\Qt\6.8.0\msvc2022_64\bin\windeployqt.exe --release --compiler-runtime .\build\Desktop_Qt_6_8_0_MSVC2022_64bit-Release\video2x-qt6.exe |
| 51 | +``` |
| 52 | + |
| 53 | +You will also need to copy the `libvideo2x` shared library to the build directory. Copy all files under `third_party/libvideo2x-shared` to the release directory except for `include`, `libvideo2x.lib`, and `video2x.exe`. |
| 54 | + |
| 55 | +Now you should be able to run the application by double-clicking on `video2x-qt6.exe`. |
0 commit comments