I want to create a project with CMake in windows with Visual Studio (the particular version I'm using is 2022), I've never used CMake in windows before so I'm just following what visual studio says to me.
I want to have a project structure where I have an App directory that generates an executable, an Engine folder that generates a dll shared lib.
I want to run them separately, so when I'm done with Engine and press run, I just want the project to generate the dll files and do nothing with the App directory.
Then, when I run App, I want it to generate an exe that depends on the dlls created by the Engine, and not re-generate the Engine directory.
I want these to be on the same solution like this:
Project/
├─ libs/
├─ README.md
├─ Solutionfile_or_smthng.vprojx
├─ App/
│ ├─ include/
│ ├─ src/
│ ├─ CMakeLists.txt
│ ├─ main.cpp
├─ Engine/
│ ├─ src/
│ ├─ include/
│ ├─ Engine.hpp
│ ├─ CMakeLists.txt
├─ .gitignore
Normally when create a visual studio project it creates a solution and I can just right click on the solution to say add project
and configure accordingly. But when I create a cmake project it just gives me a folder and there is no add project
when I right click on it.
It doesn't necessarily have to be a solution, as long as I achieve 2 separate builds in the same view I'm fine. Actually I prefer not having a solution.
The problem right now is, as far as I understand visual studio puts a CMakeLists.txt
file in the root of the project which it runs when I press build. Right now when I add the folders manually my project structure looks like this:
MyProject/
├─ libs/
├─ App/
│ ├─ src/
│ ├─ include/
│ ├─ main.cpp
│ ├─ CMakeLists.txt
├─ Engine/
│ ├─ include/
│ ├─ src/
│ ├─ CMakeLists.txt
│ ├─ Engine.hpp
├─ .gitignore
├─ CMakeLists.txt
I don't want to have a single CMakeLists.txt file that runs once. If I have to do two separate projects, how can I view them on the same window and how can I make App see generated dll's from Engine?