elmot / clion-embedded-arm

OpenOCD + STM32CubeMX support for CLion
https://blog.jetbrains.com/clion/2017/12/clion-for-embedded-development-part-ii
Other
170 stars 29 forks source link

Wrap CMakeLists template to respect maximum line width #125

Closed johnthagen closed 6 years ago

johnthagen commented 6 years ago

Wrap CMakeLists template so that the generated file better respects a 100 max line width. This allows the generated CMakeLists.txt file to be easier to view side by side with other files in CLion.

This PR does not solve all of the problems, however, since some of the template is, well, templated, and items put into the template should also ideally be separated with newlines instead of spaces so that it respects the right margin.

The remaining fields that could be fixed are:

add_definitions(${defines} )

Newline wrap each attribute ->

add_definitions(
    -D__weak=__attribute__\(\(weak\)\)
    -D__packed=__attribute__\(\(__packed__\)\)
    -DUSE_HAL_DRIVER -DSTM32F407xx )
include_directories(${includes})

Newline wrap each include directory ->

include_directories(
    "Inc"
    "Drivers/STM32F4xx_HAL_Driver/Inc"
    "Drivers/STM32F4xx_HAL_Driver/Inc/Legacy"
    "Drivers/CMSIS/Device/ST/STM32F4xx/Include"
    "Drivers/CMSIS/Include")

@elmot Thoughts?


This change is Reviewable

johnthagen commented 6 years ago

@elmot Anything else needed for this PR?

elmot commented 6 years ago

Eventually got some time to test on my windows computer