How to specify "-S" flag to select a custom CMake target in the project?
I'm using ModernCppStarter as a project template and I've taken the time to setup a custom CMakeSettings.json file so I can actually build the project. The problem I ran into is that, even though I do set the -S flag to specify the source directory, Ninja gets passed its own target during the config/build phase.
e.g.
Command line: "cmd.exe" /c "%SYSTEMROOT%\System32\chcp.com 65001 >NUL && "C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\PROFESSIONAL\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -G "Ninja" -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="C:\Users\u26i76\Projects\BoundedQueue\build\test\msvc\debug\install" -DCMAKE_CXX_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe" -Stest -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\PROFESSIONAL\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" "C:\Users\u26i76\Projects\BoundedQueue" 2>&1"
The above is the full command that runs.
I've also tried passing in the actual target via "${projectDir}\test" in the "Build command arguments", but it doesn't work.
The section here suggests that there is a way to pass custom options to Ninja.
What do I have to do to set this project up correctly?