Suppose I create a C++ CMake project for Windows using CLion that includes a subdirectory named formatter/
containing platform-agnostic classes to act like a Decorator between a HD44780 LCD (or an emulated one running under Windows) and a program that uses it as its display. For example, to implement things like marquees and "smashed decimals" (using a single custom character to render a decimal point and superscript-like digit into a single character).
My quandary: I'm unsure about how to structure the project and its Git repo(s).
When working on the formatter library under Windows, I don't want to have anything Arduino-related within sight of the project.
When using the formatter library in an Arduino project, I don't want anything Windows-related showing up to confuse it.
Even though I'll be doing the bulk of the formatter library's development under Windows, I'd like to someday be able to edit the library's files in the context of either the original Windows project or an Arduino project.
I can tentatively think of two ways:
Create a Windows C++ project with SFML using CLion and CMake, and publish it to Github.
Create another project on Github and add it to the first as a submodule in a subdirectory named
formatter/
Check out project #1 using
git clone --recursive
into a new directory, and use it going forward.Someday, create my Arduino library project, and add my hd44780-formatter library to its
formatter/
subdirectory as a submodule
... or ...
Create a Windows C++ CMake project just like step 1 above
Create a
formatter/
subdirectory within it, put the platform-agnostic classes there, and do the bulk of initial development.someday... create the new Arduino library project on Github, then somehow tell Git, "add only the
formatter/
subdirectory of {first-repo} to {second-repo} as a submodule"
In any case, I'm not really sure how to proceed.
I already tried to implement the first scenario. I made it as far as step 3. I checked out my project (containing the Windows project plus empty "formatter/" subdirectory) using --recursive into a new subdirectory, opened it in CLion, then created a few new classes in the "formatter/" subdirectory.
I then launched SmartGit, opened the directory containing the project, and staged the new files from the "formatter/" subdirectory. When I tried to commit them, the following dialog appeared:
The problem is, I think I know what the sentences mean individually... but I don't really understand what they mean collectively, or what action I should take to continue. I'm not sure whether it's telling me to create a branch for repo #2, repo #1, or both... and if both, whether I should give them the same names, different names, or otherwise need to do anything to coordinate the two.
So... just to be clear about what it is that I'm trying to achieve here (assuming I'm going about this the right way)... I'd like to be able to:
load the Windows project into CLion (with the formatter classes in a subdirectory created from the second-repo submodule),
edit and add classes to the project (including to the formatter/ subdirectory),
commit them to the local repo, and
push them to their respective Github remote repos so that files in "formatter/" end up getting pushed to the second repo, and everything else gets pushed to the first repo.
For the sake of providing concrete examples, the two Github repos in question are https://github.com/jskubick/vrEmuLcd4win.git and https://github.com/jskubick/hd44780-formatter.git
Update, 7/20/22
I got frustrated & severed the submodule link in vrEmuLcd4win & (semi-temporarily?) replaced it with a normal subdirectory so I can move forward instead of being stalled & sidetracked indefinitely trying to get past this submodule problem :-(