GithubHelp home page GithubHelp logo

upupming / vscode-qt-qml-vcpkg-template Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 4.0 44 KB

VSCode Qt (QML) vcpkg template with CI integration

Home Page: https://upupming.site/2021/04/03/vcpkg-best-practice/

CMake 53.84% C++ 16.39% QML 2.30% Batchfile 27.47%
vcpkg qt qt5 qml

vscode-qt-qml-vcpkg-template's Introduction

vscode-qt-qml-vcpkg-template

Windows Build

Template usage

We use the manifest mode vcpkg.json to declare dependencies, just like package.json for npm. Clone the repo with vcpkg submodules using:

git clone --recurse-submodules https://github.com/upupming/vscode-qt-qml-vcpkg-template.git

Or run the following command after cloned the repo:

git submodule update --init

Advantages

  • Debugging, Intelligence & Code formatting on VSCode is much more faster
  • Run windeployqt on the fly.
  • Automatically build Release zip with GitHub Actions.
  • Cache all packages and get faster package installing speed on CI.
  • Use Ninja generator for faster build time, just as faster as the Qt Creator.

Disadvantages

  • No QML intelligence on VSCode, you can still use Qt Creator to write QML files.

Getting started

  1. Clone the repo.

    git clone --recurse-submodules https://github.com/upupming/vscode-qt-qml-vcpkg-template.git
  2. Install latest visual studio 2019 with msvc compiler.

  3. Download Qt Installer and install latest Qt (current is 5.15.2 & msvc2019_64). qt5 installed with vcpkg cannot build QML app now, so we manually install Qt.

  4. Global search vscode-qt-qml-vcpkg-template, C:/Qt/5.15.2/msvc2019_64 and Microsoft Visual Studio/2019/Community etc., ans replace them according your own condition.

  5. Run the CMake Configure task or CMake Tools' Configure command.

  6. If you build the exe for the first time, you must run Run windeployqt task to copy all necessary Qt libraries to the exe folder. Or the exe will crash on launch!

  7. Change the main.cpp and use F5 or debug button on the left side bar to see the results. VSCode will run CMake to build the exe on each debug session.

    • We use CMake Build task to build the exe. CMake Tools' Build command (F7) is the same.
  8. Run the release.bat to build and get a release zip file at any time.

vscode-qt-qml-vcpkg-template's People

Contributors

upupming avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vscode-qt-qml-vcpkg-template's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.