# build folder usage issues

I'm writing my manuscript using TeXlive and Texmaker. I have different folders for chapters, images and frontmatter (including title, declaration, acknowledgements, ...) to organize a little bit the writing process. All these documents are properly written.

To be a little bit organized, I would like to use the option in Texmaker of creating a "build" folder for the generated files during compilation (.aux, .nlo, .log, .bbl, ...) but I can't use the \include command with that "build" option because I got this error:

! I can't write on file frontmatter/title.aux'.
\@include ...\immediate \openout \@partaux #1.aux
\immediate \write \@partau...
l.63 \include{frontmatter/title}


If I don't use that option everything works as it should but my main folder is filled with those auxiliary files. Apparently there is a problem writing the auxiliary files, but I can't figure out why.

On the other hand, if I use \input command, everything works well even with the "build" option selected in Texmaker.

But there is a big difference in using \input instead of \include in a large document as you well know in terms of compilation time and other issues related with numbering and referencing if I want to compile only one chapter.

Here is my MWE: Main.tex

\documentclass[12pt,a4paper]{report}
\begin{document}
\include{frontmatter/dedication}   %%% Not working with "build" option
%\input{frontmatter/dedication}   %%% It works with "build" option
\end{document}


dedication.tex(included in frontmatter folder which is in the same folder as main.tex)

\chapter*{Declaration}
I declare that ........................


Any hint will be appreciated! Happy new year!

It looks like TeXmaker is not appending the --output-directory option to the lualatex CLI command.
So I added it manually to the lualatex` command text field in the TeXmaker configuration. I also checked the "use build folder" checkbox.