Visual Studio CMake support See https://docs.microsoft.com/fr-fr/cpp/build/launch-vs-schema-reference-cpp, https://devblogs.microsoft.com/cppblog/using-visual-studio-for-cross-platform-c-development-targeting-windows-and-linux/, https://docs.microsoft.com/en-us/visualstudio/ide/customize-build-and-debug-tasks-in-visual-studio, https://docs.microsoft.com/fr-fr/cpp/build/configure-cmake-debugging-sessions, https://devblogs.microsoft.com/cppblog/bring-your-c-codebase-to-visual-studio-with-open-folder/#debug-code To set the remote working directory when the app runs and set the DISPLAY environment variable so that the GUI works on the remote computer, modify .vs\launch.vs.json (you might be able to access it by right-clicking on CMakeLists.txt and choose Debug and Launch Settings or in Debug menu, only relevant parts are shown...) : { "version": "0.2.1", "defaults": {}, "configurations": [ { "type": "default", "currentDir": "${workspaceRoot}" }, { "type": "cppdbg", "cwd": "${debugInfo.defaultWorkingDirectory}/../../../src", "environment": [ { "Name": "DISPLAY", "value": ":10.0" } ] }, { "type": "default", "project": "c:\\windows\\notepad.exe", "name": "Notepad test", "args": [ "\"test document.txt\"" ], "currentDir": "${workspaceRoot}" }, { "type": "default", "project": "CMakeLists.txt", "projectTarget": "VideoWebcamOpenCV.exe", "name": "VideoWebcamOpenCV.exe", "environment": [ { "name": "PATH", "value": "C:\\OpenCV4.9.0\\x64\\vc17\\bin;${env.PATH}" } ] } ] } In CMakeSettings.json, choosing "NMake Makefiles" generator instead of "Ninja" might solve some problems. Also, consider using "RelWithDebInfo" configurationType when "Debug" does not work...