I did some tests and some reading, you can't really use Visual Studio for this.
If you have MinGW installed then you can use that, otherwise you can download Ninja (which is a single executable that you can place anywhere you want, so it is a lot less than having to install the entire MinGW package just to use a small part of it). To download ninja, get "ninja-win.zip" from
https://github.com/ninja-build/ninja/releasesI had to make the following changes to the cmake step:
- Delete the contents of the build directory that you already created, you need to start a fresh build.
- I had to use CMake 3.19, when using CMake 3.18 it would look for android stuff in the wrong directory
- Pass "Ninja" as parameter to the "-G" flag (use "MinGW Makefiles" when using MinGW)
- When using ninja, set CMAKE_MAKE_PROGRAM to the executable location. The same applies for MinGW and mingw32-make.exe, but MinGW is probably installed in the PATH which makes this step unnecessary.
- I had to use slashes in the android NDK path, it didn't like the backslashes (it was interpreting them as escape characters, so using "\\" instead of "/" would probably work as well).
This is the command I used:
cmake -G Ninja -DCMAKE_MAKE_PROGRAM="D:\Downloads\ninja.exe" -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_NDK="C:/Users/texus/AppData/Local/Android/Sdk/ndk/22.0.7026061" -DCMAKE_ANDROID_ARCH_ABI=x86 -DCMAKE_BUILD_TYPE=Debug ..
At this point for me it complained about not finding SFML because I currently don't have the SFML android libraries installed. If you have SFML installed in your NDK then it should find them automatically (at least it does on linux).
I will try building SFML tomorrow and see if there are any more difficulties to solve in getting TGUI's android build working on windows.
Assuming it find the SFML libraries for you and the cmake step completes, you would probably have to run "ninja" and "ninja install" to create the libraries and installing them to the NDK (you will likely need the entire file path to the ninja executable instead of just writing "ninja").