2026-03-29 11:08 PM - last edited on 2026-04-15 7:59 AM by Sara BEN HADJ YAHYA
when generating cmake file from CubeMX2, CMakeLists.txt states:
cmake_minimum_required(VERSION 3.20)
but in fact you need a minimum version of 3.3:
2026-03-30 3:25 AM
Hello @av500
Thank you for bringing this issue to our attention.
I reported this internally.
Internal ticket number: CDM0060487
2026-04-22 6:08 AM
Hello @av500
The issue is caused by the following lines in stm32c5xx_dfp/CMakeLists.txt:
# Include RTE_Components.h globally if needed
if(CMSIS_Tcompiler STREQUAL "IAR")
target_compile_options(STMicroelectronics_stm32c5xx_dfp_2_0_0 INTERFACE "SHELL:--preinclude $<QUOTE>${CMAKE_CURRENT_LIST_DIR}/RTE_Components.h$<QUOTE>")
else()
target_compile_options(STMicroelectronics_stm32c5xx_dfp_2_0_0 INTERFACE "SHELL:-include $<QUOTE>${CMAKE_CURRENT_LIST_DIR}/RTE_Components.h$<QUOTE>")
endif()
It can be fixed quite simply by changing the lines slightly to use an escaped quote (\") instead of <QUOTE>. This keeps compatibility with older versions:
# Include RTE_Components.h globally if needed
if(CMSIS_Tcompiler STREQUAL "IAR")
target_compile_options(STMicroelectronics_stm32c5xx_dfp_2_0_0 INTERFACE "SHELL:--preinclude \"${CMAKE_CURRENT_LIST_DIR}/RTE_Components.h\"")
else()
target_compile_options(STMicroelectronics_stm32c5xx_dfp_2_0_0 INTERFACE "SHELL:-include \"${CMAKE_CURRENT_LIST_DIR}/RTE_Components.h\"")
endif()