How to relocate or rename main\ & build\ directories

justinmreina
Posts: 71
Joined: Tue Jul 18, 2017 10:39 pm
Location: Snohomish, WAt
Contact:

How to relocate or rename main\ & build\ directories

Postby justinmreina » Fri Mar 14, 2025 3:01 pm

Hi, I am having troubles finding how to rename the main\ & build\ sub-directories of a new project

Task:
  • Is it possible to rename the build\ directory (e.g. rename it to "out\"?)
  • Is it possible to rename the main\ directory (e.g. rename it to "src\"?)

I have done a lot of research, and nothing has worked! Are there some sdkconfig option perhaps?

Thanks,
Justin

*I am currently developing against the ESP32-S3 using Espressif IDE v3.2.0 and ESP-IDF v5.4 on a Win11 machine

Sprite
Espressif staff
Espressif staff
Posts: 10651
Joined: Thu Nov 26, 2015 4:08 am

Re: How to relocate or rename main\ & build\ directories

Postby Sprite » Sat Mar 15, 2025 12:35 am

[*] Is it possible to rename the build\ directory (e.g. rename it to "out\"?)
I *think* you can put a 'set(CMAKE_BINARY_DIR "/out")' in your project cmake, but I'm not sure if anyone ever tried to change the build dir, so I have no idea how far that will get you.
[*] Is it possible to rename the main\ directory (e.g. rename it to "src\"?)
Yes.

justinmreina
Posts: 71
Joined: Tue Jul 18, 2017 10:39 pm
Location: Snohomish, WAt
Contact:

Re: How to relocate or rename main\ & build\ directories

Postby justinmreina » Sat Mar 15, 2025 5:13 pm

Excellent, thank you @ESP_Sprite! I have captured my findings in my reference project now -

Example: Findings:
  1. rename main\ - "set(EXTRA_COMPONENT_DIRS ${CMAKE_CURRENT_LIST_DIR}/newDirName)" (example)
  2. do not rename build\ - this appears a default for the Espressif toolchain

See the readme in above repo for detail
Attachments
Hide Build Example.png
Hide Build Example.png (142.12 KiB) Viewed 310 times

Who is online

Users browsing this forum: Bing [Bot], ChatGPT-User, PetalBot and 2 guests