Invalid <Target>-NOTFOUND dependency in MinGW Makefile for IMPORTED targets with IMPORTED_LOCATION
The symptoms are similar to issue #19080 (closed) but I do have an IMPORTED_LOCATION
set:
cmake_minimum_required(VERSION 3.11)
project(t C)
add_library(a::a SHARED IMPORTED)
set_target_properties(a::a PROPERTIES
IMPORTED_LOCATION "${CMAKE_CURRENT_LIST_DIR}/liba.dll"
)
add_library(x SHARED x.c)
target_link_libraries(x PUBLIC a::a)
The generated makefile contains the line
libx.dll: a::a-NOTFOUND
Which make
errors on. This occurs regardless of whether liba.dll
actually exists at the specified path.