Context:
MainProject
depends on a header-only dependency Module
.
Both MainProject
and Module
are:
- still under development and subject to modifications
- modern CMake projects
- independent repositories on Github
- controlled by me
Problem:
Few months before, I tried without success to manage this dependency using CMake and versioning. Pressed by deadlines, I ended up opting for the "simplest solution" to copy-paste project Module
headers in MainProject
. Developing MainProject
led to add features and modify interfaces in the Module
local copy. Now there are two diverging Module
.
How it could have worked
It could have worked if
Module
was very stable (copy/pasting headers is actually the solution I opted for dependencies that are stable and for which I don't have ownership).I could have modified/commited/pushed/recopy/repasted the
Module
repository for every modification I wanted to bring. But of course I did not because ... time and deadlines.
Question
Now I would like to step back from this solution (ie, reflect the modifications on the initial Module
project) and chose a better dependency management strategy.
What I can think of
- create a new branch
update
onModule
git project, copy-paste the modified version, commit it and usegit diff
to check the differences with branchmaster
- use one or a combination of these three approaches (but I don't know how to chose)
- git submodules
- git subtrees
- C++20 modules