This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SEGGER Embedded Studio - Zephyr solution / project structure

Hi,

On my Windows drive, I structured my project as follows:

  • Project parent folder
    • src
      • main.c
      • Application
        • battery_manager.c
        • ...

Now in my CMakeLists.txt I have this:

# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.13.1)

# Re-direct the directory where the 'boards' directory is found from
# $ZEPHYR_BASE to this directory.
set(BOARD_ROOT ${CMAKE_CURRENT_LIST_DIR}/../)

find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})
project(project)

target_sources(app PRIVATE src/main.c)

target_sources(app PRIVATE src/Application/battery_manager.c)

And I also tried this:

target_sources(app PRIVATE src/main.c)

add_subdirectory(src/Application)

with in the CMakeLists.txt in the Application folder:

target_sources(app PRIVATE battery_manager.c)

But this all results in the same sloppy project structure in SEGGER Embedded Studio:

How to solve this? For bigger projects this structure is not maintainable.
I do not want the C_COMPILER__app folder, and I would like that the correct directory hierarchy is shown in the SES project explorer.

Parents Reply Children
No Data
Related