project\
|-main.ahk ; #include %A_ScriptDir%
; #include lib\lib.ahk
; #include lib\lib2.ahk
|-lib\
|-[color=red]lib1.ahk[/color] ; this library needs to include an external library, i.e. #include ext_lib\extLib.ahk
; how to include an external library here 'without breaking' the A_ScriptDir #include folder?
; ('old' #include folder in main.ahk file)
|-ext_lib\
|- extLib.ahk ; library without #include directives
|-lib2.ahk ; library without #include directives
What is the default action if one needs to link an 'external' library to an already existing library in a project, like in the above example?I've thought about:
[*:34oaxyju] #include lib\ext_lib\extlib.ahk
in main.ahk file
Con: Each time I use lib1.ahk, I have to remember that lib1.ahk uses an external library
[*:34oaxyju] #include %A_ScriptDir%
#include ext_lib\extlib.ahk
in lib1.ahk file
Con: if lib1.ahk included in main.ahk, then in main.ahk directly after the #include lib\lib1.ahk there has to be a #include %A_ScriptDir% directive to restore the old main.ahk #include working directory - looks a little bit ugly:
#include %A_ScriptDir% #include lib\lib1.ahk #include %A_ScriptDir% #include lib\lib2.ahk #include %A_ScriptDir% etc.




