Skip to content
decltype(auto) edited this page May 30, 2021 · 4 revisions

Welcome to the libSMCE wiki!

How to use

The supported way to use libSMCE is through CMake, either using a system-wide installation, or a local build tree. libSMCE exports a CMake package, which allows consumers to easily find use the library in their own projects.

Example:

cmake_minimum_required (VERSION 3.16)
project (smce_example)

find_package (SMCE REQUIRED)

add_executable (smce_example main.cpp)
target_compile_features (smce_example PUBLIC cxx_std_20)
target_link_libraries (smce_example PUBLIC SMCE::SMCE)

SMCE needs some extra files at runtime, which consumers are to place in a writable directory, which path is passed to smce::Toolchain's constructor. Since we want consumers to be free to package these runtime dependencies as they see fit, we simply zip them up using cmake -E tar.

You can get the path of that file, called SMCE_Resources.zip, using the following command:

get_target_property (<output-variable> SMCE::SMCE RESOURCES_ARCHIVE)
Clone this wiki locally