CMake two projects for a game/engine, what am I trying to do?

I am a new C++ programmer so I’m only just getting a grasp on the language itself, but learning the CMake has been an absolute pitfall for me. I’ve gotten the hang of it (mostly) for one project, but my plan for making a game has evolved to the point where I want to create an engine alongside my game, and I don’t really know how to tackle it from the CMake side of things.

Right now my file structure (using vscode) looks a bit like this:

workspace example/
__/engine/
______/etc/
______/src/
_________engine.h
_________main.h
______CMakeList
__/game/
______/etc/
______/src/
_________game.h
______CMakeList

I cannot decide how to set it up to begin working on my project, considering that the game will need to use components of the engine, (so the game should be an executable with included sources from engine) but the engine might need to be able to run as a stand-alone later, either for making other projects or to edit my game (maps, adding components or entities, etc)
Since I’m just starting out, I don’t know where main should be, I don’t know how the game should link to the engine, etc, and the resources available for this exact situation are low. I was hoping to just be coding c++ but this cmake learning has been giving me a headache every step of the way, learning how to include my own dependencies, third party headers etc… Unfortunately following AI advice got me to here, splitting my engine and game cmake, but I don’t even know that that’s the right course, as I could just use a root CMakeLists, and build them together into one executable for now. (cmake integration extension claims support for more projects in one workspace but I’m not seeing how to do that)
Anyways, if anyone’s got advice for me, that would be great, I would be glad to provide screenshots or more info but my project is a mess right now from trying to reconfigure everything, it’s hard to see what’s going on, hopefully someone will understand my problem from the info I gave. Thanks!

For me it looks like you want the engine as a library (I’d go for shared library, but you may want static one). The engine should have its own set of tests - don’t forget about those.

I’d make the engine, and the game separate projects, so that they can be built in isolation. Then you could use a superbuild pattern to build both projects together.

If later your engine should get some utility programs around it, you can add those to the “engine” project and make them link to the very same shared library, as your game.

Sorry for lack of details, but I have not enough time to describe more precise instructions.
(BTW: It’s not really a CMake problem - figuring out the right project structure is generally not an easy task)