Using CMake with the compiler on Linux is supported. When you are using CMake, the compiler is enabled using the icx (variant) binary. You may need to set your CC/CXX or CMAKE_C_COMPILER /CMAKE_CXX_COMPILER string to icx/icpx. For example:
cmake -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx …
Using CMake with the compiler on Windows is supported. When you are using CMake, the compiler is enabled using the icx (variant) binary. You may need to set your CC/CXX or CMAKE_C_COMPILER /CMAKE_CXX_COMPILER string to icx. The supported generator in the Windows environment is Ninja. For example:
cmake -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icx -GNinja …
Use the following steps to enable the compiler for your project:
cmake_minimum_required(VERSION 3.21.0)
And:
find_package(IntelDPCPP REQUIRED)
The second snippet enables the dpcpp compiler. The heterogeneous compilation configuration package (IntelDPCPPConfig.cmake) is shipped with the compiler. The package directory is found in the parent directory of the icx bin directory.