STM32CubeMX 6.15 generates broken CMAKE project for STM32U5F7VJT6
I have tried to generate a project with the STM32U5F7VJT6 and ThreadX, the generation fails saying the cmake project generation had failed. Checking the cmake file, it is full of placeholders.
cmake_minimum_required(VERSION 3.22)
{{sr:Enable_CMake_lanuages}}
# STM32CubeMX generated symbols (macros)
set(MX_Defines_Syms{{sr:symbols_c_SYMB}}
$<$<CONFIG:Debug>:DEBUG>
)
# STM32CubeMX generated include paths
set(MX_Include_Dirs{{sr:include_c_DIRS}}
)
# STM32CubeMX generated application sources
{{sr:STM32_Application_ToReplace}}
# STM32 HAL/LL Drivers
{{sr:STM32_Drivers_ToReplace}}
# Drivers Midllewares
{{sr:drivers_midllewares}}
# Link directories setup
set(MX_LINK_DIRS
{{sr:link_DIRS}}
)
# Project static libraries
set(MX_LINK_LIBS {{sr:link_LIBS}}
STM32_Drivers
${TOOLCHAIN_LINK_LIBRARIES}
{{sr:list_library}}
)
# Interface library for includes and symbols
add_library(stm32cubemx INTERFACE)
target_include_directories(stm32cubemx INTERFACE ${MX_Include_Dirs})
target_compile_definitions(stm32cubemx INTERFACE ${MX_Defines_Syms})
# Create STM32_Drivers static library
add_library(STM32_Drivers OBJECT)
target_sources(STM32_Drivers PRIVATE ${STM32_Drivers_Src})
target_link_libraries(STM32_Drivers PUBLIC stm32cubemx)
{{sr:Verify_CPP_STD}}
{{sr:add_library_ToReplace}}
# Add STM32CubeMX generated application sources to the project
target_sources(${CMAKE_PROJECT_NAME} PRIVATE ${MX_Application_Src})
# Link directories setup
target_link_directories(${CMAKE_PROJECT_NAME} PRIVATE ${MX_LINK_DIRS})
# Add libraries to the project
target_link_libraries(${CMAKE_PROJECT_NAME} ${MX_LINK_LIBS})
# Add the map file to the list of files to be removed with 'clean' target
set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES ADDITIONAL_CLEAN_FILES ${CMAKE_PROJECT_NAME}.map)
# Validate that STM32CubeMX code is compatible with C standard
if((CMAKE_C_STANDARD EQUAL 90) OR (CMAKE_C_STANDARD EQUAL 99))
message(ERROR "Generated code requires C11 or higher")
endif()

