Where should 3rd-party dependencies go

I have a 3rd-party library I would like to use in a plugin. It will be brought into the project as a git submodule. I saw some plugins drop it under the root of the project while some others drop it under src/. I’m not interested in dropping it into dep/ as I’m just importing a few classes from it and do not want it to fully build and/or be removed by the toolchain’s cleandep target. What would be the “appropriate” location to drop the submodule?

Being pedantic, I would say it should be in src/ as it’s source code. Additionally, as it’s a submodule, it should go into it’s own folder to delineate it from your source code.

src/submodule_name/submodule_source_file1.cpp

src/submodule_name/submodule_source_file2.cpp

src/your_source_file1.cpp

src/your_source_file2.cpp

Although I get it when a submodule is dropped into the project root as one is saying this project is reliant on this submodule. This also has the bonus of keeping src/ a bit simpler if the project has a lot going on there.

1 Like