cmake_minimum_required(VERSION 3.13) if (NOT DEFINED CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release") endif() list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/lib/cmake) if (NOT DEFINED CMAKE_TOOLCHAIN_FILE) set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/lib/cmake/c6400-toolchain.cmake) endif() set(tgt_name "c6416_template") project(${tgt_name} C ASM) set(CMAKE_EXECUTABLE_SUFFIX .out) set(CMAKE_C_STANDARD 11) add_executable(${tgt_name}) target_include_directories(${tgt_name} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/include ${CMAKE_CURRENT_LIST_DIR}/include/csl ${CMAKE_CURRENT_LIST_DIR}/include/imglib ${CMAKE_CURRENT_LIST_DIR}/include/dsplib) target_link_directories(${tgt_name} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/lib) target_link_libraries(${tgt_name} PRIVATE c6416_sdk.lib platform_dsk.lib) target_link_options(${tgt_name} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/C6416.cmd) set(tgt_srcs main.c) target_sources(${tgt_name} PRIVATE ${tgt_srcs}) add_custom_command(TARGET ${tgt_name} POST_BUILD COMMAND ${C6X_HEX6X} hex2bin.hexcmd $ VERBATIM WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/bin COMMENT "convert coff to binary")