I need Intel MKL for a project and noticed it comes with a config file, so at least in theory just a call to find_package would be enough. I did so and got the following error from the provided configuration file:
CMake Error at C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find MKL (missing: OMP_DLL_DIR)
Call Stack (most recent call first):
C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files (x86)/Intel/oneAPI/mkl/2023.2.0/lib/cmake/mkl/MKLConfig.cmake:836 (find_package_handle_standard_args)
The call to find_package was: find_package(MKL CONFIG REQUIRED)