Say I have the following file structure:
project/
- src/
- main.cpp
moduleA/
- moduleA.cpp
- moduleA.hpp
moduleB/
- moduleB.cpp
- moduleB.hpp
Within moduleB I would like to use moduleA. As such, I would like to include moduleA.hpp
but as a relative path to src
. Aka, I would like to be able to write #include moduleA/moduleA.hpp
to use moduleA. I have control over all files, and can put CMakeLists.txt
or FindModule<>.cmake
in any directories.
Note: I want to do this because there are files in each module that have the same name (in this case, parameters.hpp
). Therefore, I would like to be able to include parameters.hpp
relative to src
directory for readability purposes, and to ensure that the correct parameters file is being included.
If this is confusing, or any other information is required, please ask. Thanks for all the help everyone!