Microsoft says in the article
CMakeSettings.json:
The cmakesettings.json file contains information that specifies how Visual Studio should interact with CMake to build a project for a specified platform. The file stores information such as environment variables or arguments for the cmake.exe environment. You can edit directly or use the CMake Settings editor (Visual Studio 2019 and later).
The claim above is that Visual Studio 2019 can run any environment at all,
even compile and run Linux programs, once it is correctly setup.
Instructions are given in the Intel Developer Zone article
Using Intel C++ compiler with Visual Studio 2017/2019 cmake:
>
How to use Intel C++ compiler with VS2017/VS219 CMake "open folder" workflow, I give example for VS2019 and Intel C++ compiler update 4:
Create vs2019.cmd with the following text:
call "C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.4.245\windows\bin\ipsxe-comp-vars.bat"
intel64 vs2019
start "VS2019" /B "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\devenv.exe"
. Click on vs2019.cmd.
In VS2019 edit your CMakeSettings.json config file, add the following (for Release configuration):
{
"name": "x64-IntelEnv-Release",
"description": "Start visual studio from Intel C++ compiler environment cmd window",
"generator": "Ninja",
"configurationType": "Release",
"buildRoot": "${workspaceRoot}\\..\\cmake-build\\${name}",
"installRoot": "${workspaceRoot}\\..\\cmake-install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x64_x64" ],
"variables": [
{
"name": "CMAKE_CXX_COMPILER",
"value": "icl.exe",
"type": "FILEPATH"
},
{
"name": "CMAKE_C_COMPILER",
"value": "icl.exe",
"type": "FILEPATH"
}
]
}
Select "x64-IntelEnv-Release" in "Configurations" dropbox. Build.
(This is as far as I can go, never having done the above.)