2025-01-14 17:40:42 +01:00

99 lines
2.2 KiB
CMake

cmake_minimum_required(VERSION 3.22)
#
# This file is generated only once,
# and is not re-generated if converter is called multiple times.
#
# User is free to modify the file as much as necessary
#
# Setup compiler settings
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS ON)
# Define the build type
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
# Set the project name
set(CMAKE_PROJECT_NAME stm32f4-discovery-cc256x)
# Include toolchain file
include("cmake/gcc-arm-none-eabi.cmake")
# Enable compile command to ease indexing with e.g. clangd
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
# Enable CMake support for ASM and C languages
enable_language(C ASM)
# Core project settings
project(${CMAKE_PROJECT_NAME})
# Create an executable object type
add_executable(${CMAKE_PROJECT_NAME})
# Add STM32CubeMX generated sources
add_subdirectory(cmake/stm32cubemx)
# Select board
set(BSP STM32F4-Discovery)
set(BSP_COMPONENTS cs43l22 lis302dl lis3dsh)
# Include BSP
include(cmake/bsp.cmake)
set( EXAMPLES "a2dp_sink_demo" )
# ovewrite from environment if given
if( DEFINED ENV{EXAMPLES} )
set(EXAMPLES $ENV{EXAMPLES})
endif()
# Build information
message("Build: ${CMAKE_BUILD_TYPE}")
message("Example: ${EXAMPLES}\n")
# Include BTStack
include (cmake/btstack.cmake)
# Add CC256x Support and specify init script
set(CC256X_INIT_SCRIPT bluetooth_init_cc2564C_1.5.c)
include(${BTSTACK_ROOT}/chipset/cc256x/cc256x.cmake)
# Link directories setup
target_link_directories(${CMAKE_PROJECT_NAME} PRIVATE
# Add user defined library search paths
)
# Add sources to executable
target_sources(${CMAKE_PROJECT_NAME} PRIVATE
# Add user sources here
port/hal_audio_f4discovery.c
port/hal_flash_bank_stm32.c
port/port.c
${SOURCES_EXAMPLE}
)
# Add include paths
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE
# Add user defined include paths
port
)
# Add project symbols (macros)
target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE
# Add user defined symbols
)
# Add linked libraries
target_link_libraries(${CMAKE_PROJECT_NAME}
stm32cubemx
# Add user defined libraries
bsp
btstack
)