You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.5 KiB
58 lines
1.5 KiB
cmake_minimum_required(VERSION 3.13)
|
|
|
|
if (NOT C6416_SDK_PATH)
|
|
set(C6416_SDK_PATH ${CMAKE_CURRENT_LIST_DIR})
|
|
endif()
|
|
|
|
get_filename_component(C6416_SDK_PATH "${C6416_SDK_PATH}" REALPATH BASE_DIR "${CMAKE_BINARY_DIR}")
|
|
set(C6416_SDK_PATH ${CMAKE_CURRENT_LIST_DIR} CACHE PATH "Path to C6416 SDK" FORCE)
|
|
|
|
# set a default build type if none was specified
|
|
if (NOT DEFINED CMAKE_BUILD_TYPE)
|
|
set(CMAKE_BUILD_TYPE "Release")
|
|
endif()
|
|
|
|
if (DEFINED PLAT)
|
|
set(PLATFORMS ${PLAT})
|
|
else()
|
|
set(PLATFORMS "dsk" "S01")
|
|
endif()
|
|
|
|
# add cmake to module path
|
|
set(C6416_SDK_PATH ${CMAKE_CURRENT_LIST_DIR})
|
|
|
|
list(APPEND CMAKE_MODULE_PATH ${C6416_SDK_PATH}/cmake)
|
|
|
|
if (NOT DEFINED CMAKE_TOOLCHAIN_FILE)
|
|
set(CMAKE_TOOLCHAIN_FILE ${C6416_SDK_PATH}/cmake/c6400-toolchain.cmake)
|
|
endif()
|
|
|
|
project(c6416_sdk C ASM)
|
|
|
|
set(CMAKE_EXECUTABLE_SUFFIX .elf)
|
|
set(CMAKE_STATIC_LIBRARY_SUFFIX .lib)
|
|
set(CMAKE_STATIC_LIBRARY_PREFIX "")
|
|
|
|
set(CMAKE_C_STANDARD 11)
|
|
|
|
set(tgt_name "cs6416_sdk")
|
|
|
|
add_library(${tgt_name} STATIC)
|
|
|
|
target_include_directories(${tgt_name} PUBLIC
|
|
${C6416_SDK_PATH}/include)
|
|
|
|
add_subdirectory(${C6416_SDK_PATH}/csl)
|
|
add_subdirectory(${C6416_SDK_PATH}/dsplib)
|
|
add_subdirectory(${C6416_SDK_PATH}/imglib)
|
|
add_subdirectory(${C6416_SDK_PATH}/src)
|
|
|
|
foreach (plt IN LISTS PLATFORMS)
|
|
add_subdirectory(${C6416_SDK_PATH}/platforms/${plt})
|
|
endforeach()
|
|
|
|
add_custom_command(TARGET ${tgt_name} POST_BUILD
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory ${C6416_SDK_PATH}/lib
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${tgt_name}.lib ${C6416_SDK_PATH}/lib
|
|
COMMENT "Copy ${tgt_name}.lib to ${C6416_SDK_PATH}/lib")
|
|
|
|
|