Skip to content

Project Setup: Visual Studio Code

Vincent Feistel edited this page Oct 28, 2023 · 4 revisions

Firstly, ensure you have the following installed:

  • CMake - Check by seeing if you can execute the cmake command in your terminal
  • Doxygen - Check by trying to execute doxygen (Non-windows) or see if you have the doxywizard executable (Windows)

Initial Setup

Firstly, clone the repository:

git clone https://github.com/Questionable-Engineering-Decisions/Hortrog

Once the repository is cloned, open it in Visual Studio Code. After a short while it should prompt you to install the Recommended Extensions:

image

This will take you to the Extensions view, where you should install the recommended extensions:

image

When you open a .cpp file, the clangd extension should prompt you to install the language server (if not already installed):

image

Building

After installing CMake Tools it will prompt you to configure the project, which you should accept:

image

Depending on your platform, you will then be prompted so select a preset. Select whichever one is available to you:

image

NOTE: The windows preset requires the use of the MSVC compiler, which can be installed using the Visual Studio Installer

After this CMake will configure the project and setup all the dependencies. This may take a significant amount of time depending on your internet connection, so go have a coffee/tea while you wait :). Once configured, you should see something like this:

image

To compile the project, you can simply hit F7. This will compile both the main executable and the test executables and will also take quite a bit of time. image

Running

To run the final executable, press Shift+F5. On first use, you will be prompted to select which launch target to run. Select COS214_FinalProject

image

After a while it should build and execute the project and - if all went well - you should be greeted with a window:

image

Contributing

A couple of things to note:

  1. When you get an unresolved link error when compiling, this is most probably cause it didn't pick up a .cpp file. Just reconfigure the project (as seen above)
  2. When you add any asset files, be sure to rebuild the project (F7 by default). This copies the assets to the right folder before you execute the program

Testing

To run unit tests, go the Testing tab, where you should see a button to execute all the tests:

image

Clone this wiki locally