Skip to content

Instantly share code, notes, and snippets.

@MightyPork
Created November 22, 2017 11:35
Show Gist options
  • Save MightyPork/5b56015b9b9b94a6f5ddd58482175c54 to your computer and use it in GitHub Desktop.
Save MightyPork/5b56015b9b9b94a6f5ddd58482175c54 to your computer and use it in GitHub Desktop.
cmake_minimum_required(VERSION 3.9)
project(PotkanF103)
set(CMAKE_CXX_STANDARD 11)
add_definitions(
-DUSE_HAL_DRIVER
-DSTM32F103xB
-D__weak=__attribute__\(\(weak\)\)
-D__packed=__attribute__\(\(__packed__\)\)
-D__COUNTER__=__LINE__
-DUSBD_SUPPORT_USER_STRING=1
-DVERBOSE_ASSERT
-DDEBUG_VFS
-DUSE_FULL_ASSERT
)
FILE(GLOB_RECURSE SOURCE_FILES
Inc/*.h
Drivers/*.c
Drivers/*.h
Middlewares/*.c
Middlewares/*.h
User/*.c
User/*.h
Src/*.c
Src/*.h
)
include_directories(
# System includes folder
/usr/arm-none-eabi/include/
# CMSIS + HAL
Drivers/CMSIS/Include
Drivers/CMSIS/Device/ST/STM32F1xx/Include
Drivers/STM32F1xx_HAL_Driver/Inc
Drivers/STM32F1xx_HAL_Driver/Inc/Legacy
# USB Library
Middlewares/ST/STM32_USB_Device_Library/Core/Inc
# USB Device Classes
Middlewares/ST/STM32_USB_Device_Library/Class/AUDIO/Inc
Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc
Middlewares/ST/STM32_USB_Device_Library/Class/CustomHID/Inc
Middlewares/ST/STM32_USB_Device_Library/Class/DFU/Inc
Middlewares/ST/STM32_USB_Device_Library/Class/HID/Inc
Middlewares/ST/STM32_USB_Device_Library/Class/MSC/Inc
Middlewares/ST/STM32_USB_Device_Library/Class/MSC_CDC
# Other vendor libraries
Middlewares/ST/STM32_TouchSensing_Library/inc
# FreeRTOS
Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS
Middlewares/Third_Party/FreeRTOS/Source/include
Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM3
# Application
User
User/USB
User/USB/MSC_CDC
User/utils
User/TinyFrame
Inc
)
add_executable(main ${SOURCE_FILES})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment