The relevant call stack is:
cmSystemTools::GuessLibrarySOName
cmOrderDirectoriesConstraintSOName::cmOrderDirectoriesConstraintSOName
cmOrderDirectories::AddRuntimeLibrary
cmComputeLinkInformation::AddLibraryRuntimeInfo
In AddLibraryRuntimeInfo, the check for whether a file is a shared library is done via:
is_shared_library = this->ExtractSharedLibraryName.find(file);
This condition returns true if the file name ends with .dll or .lib.
Behavior of AddImportedLibrary
The AddImportedLibrary function creates one imported interface target per external package. Each package may contain multiple library files (.lib, .so or .a), and for each of these, a separate target is added.
All these targets are either marked as STATIC or SHARED depending on the SHARED flag passed to the function. This behavior is consistent across configurations (Debug or not Debug) and does not vary per file.