The DirectX Headers package provides CMake targets: find_package(directx-headers CONFIG REQUIRED) target_link_libraries(main PRIVATE Microsoft::DirectX-Headers)