To build an application solution, specify the build settings in the CMakeLists.txt
file. The CMakeLists.txt
file must contain the following commands:
Specifies the minimum supported version of CMake. To build a project based on the Kaspersky Neuromorphic Platform, CMake version 3.25 or later is required.
Specifies the project name.
Specifies C++ 17 as the locale to use.
Specifies the directory containing the application to be built.
Specifies the executable file.
Specifies the Kaspersky Neuromorphic Platform libraries to be linked to your project. You can connect the following libraries: backends
, neuron_trits
, synapse_traits
, core
, meta
, devices
, and framework
.
Before building a project in Windows, define the Boost_ROOT
setting.
To configure the project build settings for the application solution in C++:
CMakeLists.txt
file. Example of the CMakeLists.txt file
cmake_minimum_required(VERSION 3.25)
# digits-recognition is a project name.
project(digits-recognition)
set(CMAKE_CXX_STANDARD 17)
# Runs CMake in the KNP directory and adds to the build all projects from the directory.
add_subdirectory(KNP)
# Adds a binary file with the source code to the main.cpp application file.
add_executable("${PROJECT_NAME}" main.cpp)
# Connects the framework and the single-thread CPU backend library to the digits-recognition project.
target_link_libraries("${PROJECT_NAME}" PRIVATE KNP::BaseFramework::Core KNP::Backends::CPUSingleThreaded)
If needed, you can load the framework dynamically.
CMakeLists.txt
file.