shiva
Search…
How to create a project through the CLI tools and build it

Using the CLI

Prerequisites

  • You should install shiva with vcpkg or with a regular installation before following this tutorial.
  • VCPKG_ROOT env variable set to the root directory of your installation of VCPKG
  • Python 3.6

Create a project and build it

If you use VCPKG:

Windows

Open powershell and type:
1
cd "$($env:VCPKG_ROOT)/installed/x64-Windows/share/shiva/tools"
2
##! syntax
3
./cli_shiva.py --project_name project_name --project_renderer renderer_name --output_directory path
4
##! for example
5
./cli_shiva.py --project_name bomberman --project_renderer sfml --output_directory D:/game_project/bomberman
6
7
cd D:/game_project/bomberman
8
mkdir build
9
cd build
10
##! Replace Release by Debug if you prefer Debug
11
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_TOOLCHAIN_FILE="$($env:VCPKG_ROOT)/scripts/buildsystems/vcpkg.cmake" -DCMAKE_BUILD_TYPE=Release ..
12
cmake --build . --config Release
Copied!
Linux or OSX
Open bash and type:
1
##! Linux
2
cd $VCPKG_ROOT/installed/x64-linux/share/shiva/tools
3
4
##! OSX
5
cd $VCPKG_ROOT/installed/x64-osx/share/shiva/tools
6
7
##! syntax
8
./cli_shiva.py --project_name project_name --project_renderer renderer_name --output_directory path
9
##! for example
10
./cli_shiva.py --project_name bomberman --project_renderer sfml --output_directory ~/Documents/bomberman
11
12
cd ~/Documents/bomberman
13
mkdir build
14
cd build
15
16
##! Linux (Replace Release by Debug if you need)
17
cmake -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE="Release" -DCMAKE_CXX_COMPILER=g++-8 -DCMAKE_C_COMPILER=gcc-8 ..
18
19
##! OSX (Replace Release by Debug if you need)
20
cmake -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE="Release" -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang ..
21
22
make
Copied!

Run the binary

1
cd bin
2
./bomberman
Copied!
You should see a window appear, you can leave with escape
This entire tutorial used the sfml rendering module, but when other module will be available you can replace sfml with what you want, Ogre, SDL2, Vulkan, bgfx