Giter Club home page Giter Club logo

cmake-qt-vcpkg-vulkan's Introduction

CMake + Qt + Vcpkg + Vulkan

Cloning

git clone --recurse-submodules https://github.com/mehmetoguzderin/cmake-qt-vcpkg-vulkan

Building

Prerequisites

  • CMake 3.20

  • C++20 compiler

  • Clangd

  • Clang-Format

  • Clang-Tidy

  • Conda

The following subsections only contain installs for packages that cause errors during build without clear instructions, especially from localization and windowing libraries. Please closely follow vcpkg outputs for any potential additional dependencies that may be necessary, as some packages can have specific requirements depending on the platform.

macOS

  • brew install autoconf-archive automake libtool

  • Vulkan SDK

    export CPATH=/usr/local/include:$CPATH
    export C_INCLUDE_PATH=/usr/local/include:$C_INCLUDE_PATH
    export CPLUS_INCLUDE_PATH=/usr/local/include:$CPLUS_INCLUDE_PATH
    ln -s "$(brew --prefix llvm)/bin/clang-tidy" "/usr/local/bin/clang-tidy"

Ubuntu

  • sudo apt install autoconf autoconf-archive automake libegl1-mesa-dev libgl-dev libgl1-mesa-dev libtool libvulkan-dev libvulkan1 libwayland-dev libx11-dev libx11-xcb-dev libxcb-randr0-dev libxcb-xinerama0-dev libxcb-xtest0-dev libxcb1 libxcb1-dev libxcursor-dev libxi-dev libxinerama-dev libxkbcommon-dev libxkbcommon-x11-dev libxrandr-dev xcb-proto

  • sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libx11\* libxi-dev libxkbcommon-dev libxkbcommon-x11-dev libegl1-mesa-dev

Configure

conda env create --prefix ./.conda -f environment.yml
conda activate ./.conda
cmake -G Ninja -DCMAKE_MAKE_PROGRAM=ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build

Windows

The configuration can deprive the system of resources due to vcpkg builds during configuration and cause cryptic fail messages. On such occasions, please either try again directly or close other applications before trying again.

conda env create --prefix ./.conda -f environment.yml
conda activate ./.conda
cmake -A x64 -G "Visual Studio 17 2022" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -DVCPKG_TARGET_TRIPLET=x64-windows -S ./ -B ./build

Compile

cmake --build ./build --config Release

Run

./build/MainCxx

Install

cmake --install ./build --config Release --prefix $PWD/install/

Notes

  • Devcontainer configuration to run Docker with GPUs

    "runArgs": [
        "--gpus",
        "all"
    ]
  • Conda environment for versioning Python

    conda create --prefix .conda python=3.12
    conda activate ./.conda
    conda env export > environment.yml
    conda env create --prefix ./.conda -f environment.yml
    conda activate ./.conda
  • If there is a problematic package within transitive dependencies, you can check for it with the help of jq using the following command (please replace liblzma with the package name you are looking for):

    jq -r '.dependencies[] | if type == "object" then .name + (if .features then "[" + (.features | join(",")) + "]" else "" end) else . end' vcpkg.jsonc | while read pkg; do
        echo "Checking $pkg for liblzma dependency..."
        if ./vcpkg/vcpkg depend-info $pkg 2>&1 | grep -q 'liblzma'; then
            echo "$pkg directly or indirectly depends on liblzma."
        else
            echo "$pkg does not depend on liblzma."
        fi
    done
  • Reincorporation of following packages depends on liblzma to become available again:

    • boost[mpi]

    • boost-python

    • python3

    • tiff

cmake-qt-vcpkg-vulkan's People

Contributors

mehmetoguzderin avatar

Watchers

 avatar

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.