1# SPDX-License-Identifier: Apache-2.0 2 3cmake_minimum_required(VERSION 3.20.0) 4find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) 5project(number_crunching) 6 7# defines targets and sources 8target_sources(app PRIVATE 9 src/main.c 10 src/math_ops.c 11) 12zephyr_include_directories(include) 13 14if(DEFINED ENV{LIB_LOCATION}) 15 message(STATUS "LIB_LOCATION environment variable defined") 16 17 # contains a "proprietary" library we will link to 18 # this should set the INCLUDE_DIR, LIB_DIR and LIB_NAME variables 19 add_subdirectory($ENV{LIB_LOCATION} ${CMAKE_CURRENT_BINARY_DIR}/proprietary) 20 21 # this is an example for NatureDSP backend 22 target_sources(app PRIVATE 23 src/nature_dsp_wrapper.c 24 ) 25 26 if(INCLUDE_DIR) 27 zephyr_include_directories($ENV{LIB_LOCATION}/${INCLUDE_DIR}) 28 endif() 29 30 if(LIB_DIR AND LIB_NAME) 31 zephyr_link_libraries($ENV{LIB_LOCATION}/${LIB_DIR}/${LIB_NAME}) 32 endif() 33else() 34 message(STATUS "LIB_LOCATION environment variable NOT defined") 35 # this is an example for CMSIS-DSP backend 36 target_sources(app PRIVATE 37 src/cmsis_dsp_wrapper.c 38 ) 39endif() 40