ezieragabriel / arduino

Automatically exported from code.google.com/p/arduino
Other
0 stars 0 forks source link

Arduino sketches do not allow subdirectories for inclusion #1004

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have a rather big (open source) project with quite a lot of files that I 
would like to move to subdirectories within the sketch directory.

for example:

sketch.ino
sketch.h
subdir/sub2/file.h
subdir/sub2/file.cpp
lib/libraryname/lib.h
utils/utilname/util.h

At this moment I cannot include files in subdirectories by using #include 
"subdir/sub2/file.h" because the files do not get copied to the temporary 
compilation directory. As a consequence I get the following order while 
compiling: "error: subdir/file.h: No such file or directory".

It's quite common that source code is split up in different logical folders as 
the developer sees fit. Please support subdirectories by copying all the files 
and directories to the compilation directory. The files in the subdirs should 
then also be able to include files in parent directories; #include 
"../parent.h" for example.

Original issue reported on code.google.com by mackatack on 10 Aug 2012 at 11:05

GoogleCodeExporter commented 9 years ago
Also, having common code between two projects (Arduino / non-Arduino) seems 
painful while maintaining a folder hierarchy that makes sense. 
It would be nice to be able to modify Arduino's search/include paths.

Currently, it seems hard-coded when compiling from the IDE:
http://code.google.com/p/arduino/wiki/BuildProcess
"The include path includes the sketch's directory, the core folder (e.g. the 
hardware/arduino/core/arduino/ sub-folder of the Arduino application) and the 
avr include directory (hardware/tools/avr/avr/include/), as well as any library 
directories (in hardware/libraries/ and the libraries/ sub-directory of your 
sketchbook) which contain a header file which is included by the main sketch 
file."

Original comment by blackwel...@gmail.com on 22 Aug 2012 at 6:45