Building the Demos
The SIL Kit Demos are not available as pre-built binaries and have to be compiled from source first.
If you plan to use the demos as a starting point for further development, start by cloning the SIL Kit git repository. Don’t forget to call
git submodule update --init --recursive
after cloning the repository for the first time. Using the build instructions below will build the complete SIL Kit library including the Demos.If you just want to try out the demos, download a SIL Kit release package which also includes all sources. Using the build instructions below will only build the SIL Kit Demos and use the precompiled library of the package.
Building the Demos from the installation folder of the SIL Kit MSI Installer is strongly discouraged, as all involved tools require administrative privileges if the default installation directory is used.
There are several options to build the demos, all require the installation of a C++ compiler and CMake.
Note
If you don’t have any experience with setting up C++ / CMake projects, we recommend using VS Code and a SIL Kit release package. VS Code is free to use, and the prerequisites can be quickly set up using the recommended VS Code extensions.
VS Code
Install the VS Code extensions
C/C++
andCMake
Open the folder with VS Code
For the git repository: open the root folder of the repository
For a SIL Kit package: open the
SilKit-Demos
folder
Opening the folder automatically starts the CMake configuration step. You can also manually call this step in the CMake extension page under
Project Status | Configure
.In the CMake extension page, build the project under
Project Status | Build
Locate the binaries
For the git repository: The binaries reside in
_build/<build config>/<build type, e.g. Debug, Release>/
For a SIL Kit package: The binaries reside in
<package folder>/SilKit/bin
Visual Studio
Make sure Visual Studio is set up for C++ and CMake is installed
Open the folder with Visual Studio
For the git repository: open the root folder of the repository
For a SIL Kit package: open the
SilKit-Demos
folder
Opening the folder automatically starts the CMake configuration step. You can also manually call this step under
Project | Configure Cache
.Build the project with
Build | Build All
Locate the binaries
For the git repository: The binaries reside in
_build/<build config>/<build type, e.g. Debug, Release>/
For a SIL Kit package: The binaries reside in
<package folder>/SilKit/bin
From command line
Make sure a C++ compiler and CMake is installed
Open a terminal
For the git repository: navigate to the root folder of the repository
For a SIL Kit package: navigate to
<package folder>/SilKit-Demos
Run the following commands:
mkdir build
cd build
cmake ..
cmake --build .
Locate the binaries
For the git repository: The binaries reside in
build/<build config>/<build type, e.g. Debug, Release>/
For a SIL Kit package: The binaries reside in
<package folder>/SilKit/bin
Due to the large variety of terminals, different operating systems and availability of environment variables, the previous instruction can fail for several reasons.
Usually, the configuration step performed in cmake ..
will give useful hints of what went wrong.
Advanced CMake configuration
- Build the Demos from a SIL Kit package against your own target library
The distributed Demos, as packaged by CPack, are preconfigured to build against a copy of the SIL Kit binaries in
../SilKit/
. This can be overridden by providing your ownSilKit
CMake target library, before the demos are configured by CMake. Or by changing thefind_package(SilKit ... PATHS path/to/SilKit)
statement directly in the./SilKit-Demos/CMakeLists.txt
directory.