The following content is OS specific.
Use of CMake with the Intel® oneAPI DPC++/C++ 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 …
-OR-
$ export CC=icx; export CXX=icpx; cmake …
Use of CMake with the Intel® oneAPI DPC++/C++ 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*.
$ cmake -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icx -GNinja …
-OR-
$ CC=icx CXX=icx cmake -GNinja …
Use the following steps to enable the compiler for your project:
cmake_minimum_required(VERSION 3.21.0)
find_package(IntelDPCPP REQUIRED)This snippet enables the dpcpp compiler. The DPC++ configuration package (IntelDPCPPConfig.cmake) is shipped with the Intel® oneAPI DPC++/C++ Compiler. The package directory is found in the parent directory of icx bin directory. Example: /deploy/linux_prod/IntelDPCPP/IntelDPCPPConfig.cmake.