Build Extension Library Using CMake*

Inference Engine build infrastructure provides the Inference Engine Package for application development.

To build an extension library, use the following CMake script:

set(TARGET_NAME "template_extension")
find_package(ngraph REQUIRED)
find_package(InferenceEngine REQUIRED)
file(GLOB_RECURSE SRC *.cpp)
add_library(${TARGET_NAME} SHARED ${SRC})
target_link_libraries(${TARGET_NAME} PRIVATE ${InferenceEngine_LIBRARIES}

This CMake script finds the Inference Engine and nGraph using the find_package CMake command.

To build an extension library, run the commands below:

$ cd template_extension
$ mkdir build
$ cd build
$ cmake -DInferenceEngine_DIR=[IE_DIR] -Dngraph_DIR=[NGRAPH_DIR] ../
$ cmake --build .