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

  1. Install the VS Code extensions C/C++ and CMake

  2. Open the folder with VS Code

    1. For the git repository: open the root folder of the repository

    2. For a SIL Kit package: open the SilKit-Demos folder

  3. 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.

  4. In the CMake extension page, build the project under Project Status | Build

  5. Locate the binaries

    1. For the git repository: The binaries reside in _build/<build config>/<build type, e.g. Debug, Release>/

    2. For a SIL Kit package: The binaries reside in <package folder>/SilKit/bin

Visual Studio

  1. Make sure Visual Studio is set up for C++ and CMake is installed

  2. Open the folder with Visual Studio

    1. For the git repository: open the root folder of the repository

    2. For a SIL Kit package: open the SilKit-Demos folder

  3. Opening the folder automatically starts the CMake configuration step. You can also manually call this step under Project | Configure Cache.

  4. Build the project with Build | Build All

  5. Locate the binaries

    1. For the git repository: The binaries reside in _build/<build config>/<build type, e.g. Debug, Release>/

    2. For a SIL Kit package: The binaries reside in <package folder>/SilKit/bin

From command line

  1. Make sure a C++ compiler and CMake is installed

  2. Open a terminal

    1. For the git repository: navigate to the root folder of the repository

    2. For a SIL Kit package: navigate to <package folder>/SilKit-Demos

  3. Run the following commands:

    • mkdir build

    • cd build

    • cmake ..

    • cmake --build .

  4. Locate the binaries

    1. For the git repository: The binaries reside in build/<build config>/<build type, e.g. Debug, Release>/

    2. 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 own SilKit CMake target library, before the demos are configured by CMake. Or by changing the find_package(SilKit ... PATHS path/to/SilKit) statement directly in the ./SilKit-Demos/CMakeLists.txt directory.