Visual Studio provides an "Open Folder" workflow for CMake. So far I've been using the default MSVC compiler but I wanted to switch to using the Intel C++ Compiler. To do this, I found this post in the Intel forum. However, I'm using Visual Studio 2022. Furthermore, my Intel C++ compiler is installed under C:\Program Files (x86)\Intel\oneAPI. I assume the updated instructions would now be:
- Create a
vs2022.cmd(where though?) with the following contents:
call "C:\Program Files (x86)\Intel\oneAPI\compiler\2024.0\bin" (I don't have `ipsxe-comp-vars.bat` in my installation...) intel64 vs2022
start "VS2022" /B "C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\devenv.exe"
- Run the
vs2022.cmdfile via double-click (in which context?) - In Visual Studio, edit your
CMakeSettings.jsonconfig file, add the following (forReleaseconfiguration):
{
"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"
}
]
}
However, the instructions don't seem to be very clear or applicable for my installations (especially the first step). How can I create a build configuration for the Intel Compiler correctly? Ideally, I also don't want to start Visual Studio in the context of the Intel environment command prompt:


