Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cmake_minimum_required(VERSION 3.16)
- message(STATUS "CMAKE_CURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}")
- set(STM32_TOOLCHAIN_PATH /Applications/STMicroelectronics/STM32CubeIDE.app/Contents/Eclipse/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.macos64_1.0.0.202111181127/tools/bin)
- set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/extern/stm32-cmake/cmake/stm32_gcc.cmake)
- set( STM32_CUBE_L4_PATH ${CMAKE_CURRENT_SOURCE_DIR}/extern/STM32CubeL4)
- project(TESTCMAKE20221004 C CXX ASM)
- set(CMSIS_COMP_LIST
- STM32L431RC
- STM32L4_M4
- RTOS_V2
- )
- set(HAL_COMP_LIST
- STM32L4
- CORTEX
- DMA
- EXTI
- FLASH
- GPIO
- I2C
- IWDG
- PWR
- RCC
- TIM
- UART
- )
- set(FREERTOS_COMP_LIST
- ARM_CM4F
- STM32L4
- )
- find_package(CMSIS COMPONENTS "${CMSIS_COMP_LIST}" REQUIRED)
- find_package(HAL COMPONENTS "${HAL_COMP_LIST}" REQUIRED)
- find_package(FreeRTOS COMPONENTS "${FREERTOS_COMP_LIST}" REQUIRED)
- set(PROJECT_SOURCES
- Core/Src/dma.c
- Core/Src/freertos.c
- Core/Src/gpio.c
- Core/Src/iwdg.c
- Core/Src/main.c
- Core/Src/stm32l4xx_hal_msp.c
- Core/Src/stm32l4xx_hal_timebase_tim.c
- Core/Src/stm32l4xx_it.c
- Core/Src/syscalls.c
- Core/Src/sysmem.c
- #Core/Src/system_stm32l4xx.c
- Core/Src/usart.c
- )
- add_executable(TESTCMAKE20221004 ${PROJECT_SOURCES})
- target_include_directories(TESTCMAKE20221004 PRIVATE Core/Inc)
- target_link_libraries(TESTCMAKE20221004
- CMSIS::STM32::L431RC
- HAL::STM32::L4::CORTEX
- HAL::STM32::L4::DMA
- HAL::STM32::L4::EXTI
- HAL::STM32::L4::FLASH
- HAL::STM32::L4::GPIO
- HAL::STM32::L4::I2C
- HAL::STM32::L4::IWDG
- HAL::STM32::L4::PWR
- HAL::STM32::L4::PWREx
- HAL::STM32::L4::RCC
- HAL::STM32::L4::RCCEx
- HAL::STM32::L4::TIM
- HAL::STM32::L4::TIMEx
- HAL::STM32::L4::UART
- HAL::STM32::L4::UARTEx
- STM32::NoSys
- FreeRTOS::STM32::L4::Timers
- FreeRTOS::STM32::L4::Heap::4
- FreeRTOS::STM32::L4::ARM_CM4F
- CMSIS::STM32::L4::RTOS_V2
- )
- stm32_print_size_of_target(TESTCMAKE20221004)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement