'How to add CMake library to Visual studio project from a git submodule?

I'm trying to add https://github.com/alaingalvan/CrossWindow

  1. I'm creating an empty C++ project in VS. it have one Source.cpp with int main() in it.

  2. Initialize git in the root directory (the one with .sln file)

  3. Add submodule per instruction in CrossWindow github git submodule add https://github.com/alaingalvan/crosswindow.git external/crosswindow

  4. Create CMakeLists.txt in the same root directory, fill it with what the instructions say in "Then in your CMakeLists.txt file, include the following:" part

  5. Open powershell in the root directory, type cmake -B build -A x64 per instruction.

    But what next? It builds bunch of stuff, creates Project.sln in /build folder, if I open it, it won't build fully (some template error). there is also /build/external/crosswindow/Crosswindow.sln file, it does build, but again, I don't know what to do with it. It creates crosswindow.lib, I tried to add it manually to my main .sln file, didn't worked out.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source