build prog outside sdk


  • Staff

    you can use cmakelists like this to build your prog outside sdk

    cmake_minimum_required(VERSION 3.0)
    
    
    set(BUILDING_SDK "yes" CACHE INTERNAL "")
    
    include(${SDK_ROOT}/cmake/common.cmake)
    project(voice_image)
    
    # config self use headers
    include(${SDK_ROOT}/cmake/macros.internal.cmake)
    header_directories(${SDK_ROOT}/lib)
    # build library first
    add_subdirectory(${SDK_ROOT}/lib lib)
    
    
    # compile project
    add_source_files(src/${PROJ}/*.c src/${PROJ}/*.s src/${PROJ}/*.S src/${PROJ}/*.cpp)
    include(${SDK_ROOT}/cmake/executable.cmake)
    

    dir struct:

    /

    • build/
    • src/
      ** hello_world.c
    • CMakeLists.txt

    command

    cmake -DSDK_ROOT=/mnt/c/tools/kendryte-standalone-sdk -DTOOLCHAIN=/mnt/c/tools/kendryte-toolchain/bin ..
    


  • @manageryzy the dir struct is not clear.