The DirectX 12 Agility SDK package provides CMake targets: find_package(directx-headers CONFIG REQUIRED) find_package(directx12-agility CONFIG REQUIRED) target_link_libraries(main PRIVATE Microsoft::DirectX-Headers Microsoft::DirectX-Guids Microsoft::DirectX12-Agility) if(TARGET Microsoft::DirectX12-Agility) file(MAKE_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/D3D12") add_custom_command(TARGET main POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ $/D3D12 COMMAND ${CMAKE_COMMAND} -E copy $ $/D3D12 COMMAND_EXPAND_LISTS ) endif()