cancel
Showing results for 
Search instead for 
Did you mean: 

How to organize build artifacts in "Build" folder ?

Subramanya A
Associate II

Hi Team,

Currently my Project have 2 Build variants (Managed via Manage configuration), build are placed in root directory inside Configuration name.

I'm looking for below solution:

  1. To place both variants build in one common folder.
  2. To select both variants by default, currently only one is active.
  3. and also to use pre and post build to call *.bat/*.sh files.

Kindly let me know how to achieve above needs.

Thanks & Regards,

Subramanya A

1 ACCEPTED SOLUTION

Accepted Solutions

Some ST examples have a directory structure where the .project and .cproject are in a subdirectory (CubeIDE), rather than in the root of the project. IIRC if you uncheck "generate under root" in Cube, it creates the same structure. Then the subdirectory with .project & .cproject is the build directory that you want. The per-config subdirs are created under it.

View solution in original post

3 REPLIES 3
Pavel A.
Evangelist III

Build products for different configurations are placed under different subdirs exactly because they depend on the configuration details (defines, optimization level...). So it's an unusual wish.

If you want to build more than one configuration, you can select this in the GUI or use the command line (aka "headless") builder.

For post-build script IMHO the .sh files are easier to write, and they work even in Windows because CubeIDE toolkit comes with the MinGW busybox.

By the way, the current directory for post-build scripts is the per-config build sub-directory mentioned above. So it's not hard to find it.

Subramanya A
Associate II

@Pavel A.​  Thanks for the answers, now it is clear to me for point 2 & 3, sorry for my bad, for point 1 here is what I was expecting.

Directory of <Project-root>

- app

- build

+- variant1

+- variant2

- core

- drivers

- middleware

I tried by inserting the output prefix path in build properties, "./build/variant1/" and "./build/variant2/".

build was not successfully, error which I received was "c:\st\stm32cubeide_1.9.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.0.202111181127\tools\arm-none-eabi\bin\ld.exe: cannot open map file ./build/variant1/prj-variant1.map: No such file or directory"

if any one achieved this folder structure for build artifacts, kindly let me know for the same.

Thanks & Regards,

Subramanya A

Some ST examples have a directory structure where the .project and .cproject are in a subdirectory (CubeIDE), rather than in the root of the project. IIRC if you uncheck "generate under root" in Cube, it creates the same structure. Then the subdirectory with .project & .cproject is the build directory that you want. The per-config subdirs are created under it.