基质喷涂
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.

94 lines
3.8 KiB

3 weeks ago
  1. cmake_minimum_required(VERSION 3.22)
  2. project(stm32cubemx)
  3. add_library(stm32cubemx INTERFACE)
  4. # Enable CMake support for ASM and C languages
  5. enable_language(C ASM)
  6. target_compile_definitions(stm32cubemx INTERFACE
  7. USE_HAL_DRIVER
  8. STM32F429xx
  9. STM32_THREAD_SAFE_STRATEGY=4
  10. $<$<CONFIG:Debug>:DEBUG>
  11. )
  12. target_include_directories(stm32cubemx INTERFACE
  13. ../../Core/Inc
  14. ../../Drivers/STM32F4xx_HAL_Driver/Inc
  15. ../../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy
  16. ../../Middlewares/Third_Party/FreeRTOS/Source/include
  17. ../../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2
  18. ../../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F
  19. ../../Drivers/CMSIS/Device/ST/STM32F4xx/Include
  20. ../../Drivers/CMSIS/Include
  21. )
  22. target_sources(stm32cubemx INTERFACE
  23. ../../Core/Src/main.c
  24. ../../Core/Src/gpio.c
  25. ../../Core/Src/freertos.c
  26. ../../Core/Src/can.c
  27. ../../Core/Src/crc.c
  28. ../../Core/Src/i2c.c
  29. ../../Core/Src/iwdg.c
  30. ../../Core/Src/rng.c
  31. ../../Core/Src/spi.c
  32. ../../Core/Src/usart.c
  33. ../../Core/Src/stm32f4xx_it.c
  34. ../../Core/Src/stm32f4xx_hal_msp.c
  35. ../../Core/Src/stm32f4xx_hal_timebase_tim.c
  36. ../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_can.c
  37. ../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.c
  38. ../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_adc.c
  39. ../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.c
  40. ../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c
  41. ../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c
  42. ../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c
  43. ../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c
  44. ../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c
  45. ../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c
  46. ../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c
  47. ../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c
  48. ../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c
  49. ../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c
  50. ../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c
  51. ../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c
  52. ../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c
  53. ../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_crc.c
  54. ../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c
  55. ../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c_ex.c
  56. ../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_iwdg.c
  57. ../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rng.c
  58. ../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c
  59. ../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c
  60. ../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c
  61. ../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c
  62. ../../Core/Src/system_stm32f4xx.c
  63. ../../Middlewares/Third_Party/FreeRTOS/Source/croutine.c
  64. ../../Middlewares/Third_Party/FreeRTOS/Source/event_groups.c
  65. ../../Middlewares/Third_Party/FreeRTOS/Source/list.c
  66. ../../Middlewares/Third_Party/FreeRTOS/Source/queue.c
  67. ../../Middlewares/Third_Party/FreeRTOS/Source/stream_buffer.c
  68. ../../Middlewares/Third_Party/FreeRTOS/Source/tasks.c
  69. ../../Middlewares/Third_Party/FreeRTOS/Source/timers.c
  70. ../../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c
  71. ../../Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c
  72. ../../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c
  73. ../../Core/Src/sysmem.c
  74. ../../Core/Src/syscalls.c
  75. ../../startup_stm32f429xx.s
  76. )
  77. target_link_directories(stm32cubemx INTERFACE
  78. )
  79. target_link_libraries(stm32cubemx INTERFACE
  80. )
  81. # Validate that STM32CubeMX code is compatible with C standard
  82. if(CMAKE_C_STANDARD LESS 11)
  83. message(ERROR "Generated code requires C11 or higher")
  84. endif()