GithubHelp home page GithubHelp logo

hexdecimal / libtcod-vcpkg-template Goto Github PK

View Code? Open in Web Editor NEW
17.0 3.0 7.0 89 KB

A template for C++17 libtcod projects. This template uses Vcpkg to fetch dependencies.

License: The Unlicense

CMake 40.87% C++ 59.13%
libtcod template cpp17 cpp cmake emscripten vcpkg-template

libtcod-vcpkg-template's Introduction

How this works

This is a CMake project which uses Vcpkg for dependency management.

You need CMake and a compiler which CMake can recognize. Vcpkg is setup as a submodule and does not need to be installed separately.

Compiling this program from an IDE such as VSCode will invoke CMake which in turn invokes Vcpkg. Vcpkg fetches and builds all dependencies required by the project and CMake will compile and link them. This means you do not have to manually handle dependencies as they are all handled by the toolchain.

The src/ directory holds a hello world program. CMake has been configured to compile all *.cpp files in this directory to create a new program. You should edit or replace the sources in this directory to create your program. If you do not want to use this directory then you can modify which files are collected in CMakeLists.txt.

A workflow exists at .github/workflows/cmake.yml which automatically compiles the program for Windows, macOS, and Ubuntu Linux. The workflow simply invokes CMake directly, since this setup does not depend on a specific IDE to work. Actions which pass without fail will provide archived executables to test with, these are temporary and are downloaded from the passing action under automated-builds. To permanently publish these builds you can push an annotated tag named after the version of the build, such as 1.0.0 or 2000.12.30.

How to setup

  • Make sure you have the correct tools ready.
  • Create a new repository from ths template. You do not use the GitHub fork button unless you're contributing.
  • Clone your new repository.
  • Make sure to initialize the vcpkg submodule. If the vcpkg folder is empty or missing then the build process will fail.
    • The command to do this is: git submodule update --init
  • Load this project in VS Code and install any recommended plugins. Most importantly: C/C++, C++ Intellisense, and CMake Tools.
  • Using the CMake Tools plugin you can now build and run this project. Dependencies will automatically be installed via Vcpkg.
    • On Windows, when CMake Tools asks for a toolkit you should select Visual Studio Community ... - amd64.
    • When CMake Tools asks for a project select libtcod-vcpkg-template.
  • The project will now build and run with F5. You should edit the CMakeLists.txt script as needed to expand your project.

Now that you know the template works you'll want to take care the following:

Configuring submodules

After you run git submodule update --init you can setup the submodules by going into their initialized submodule directories and checking out the desired commits. See the Git Documentation on Submodules.

To update SDL, libtcod, or any other dependency fetched with vcpkg you should go into the vcpkg folder and then checkout and pull its master branch to get the most recent ports.

libtcod-vcpkg-template's People

Contributors

hexdecimal avatar itsmaxymoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

libtcod-vcpkg-template's Issues

Unexpected OpenGL error 1282 on MacOS

Hello, I was able to build this fine, however running the project gives:

terminate called after throwing an instance of 'std::runtime_error'
  what():  libtcod 1.20.1 <path to repo>/libtcod/src/libtcod/renderer_gl1.c:285
Unexpected OpenGL error 1282.
zsh: abort      ./build/bin/libtcod-vcpkg-template

on MacOS Big Sur 11.0.1. Do you know what I need to do to get this running? Thanks.

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.