It looks like you’re trying to add a pre-compiled shared library. I suggest you use the IMPORTED keyword instead of INTERFACE. For example:
add_library(Foo SHARED IMPORTED)
set_target_properties(Foo PROPERTIES
IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/bin/libfoo.dll"
IMPORTED_IMPLIB "${CMAKE_CURRENT_SOURCE_DIR}/lib/libfoo.lib"/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_DEBUG "${CMAKE_CURRENT_SOURCE_DIR}/bin/libfoo.dll"
IMPORTED_IMPLIB_DEBUG "${CMAKE_CURRENT_SOURCE_DIR}/lib/libfood.lib"
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/include"
)
The example above tells CMake to import a shared library, and gives it the location of all the files. You can then copy the DLL to the same directory as the executable by using the following:
# Copy DLL files on platforms where it's needed
if(CMAKE_IMPORT_LIBRARY_SUFFIX)
add_custom_command(
TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:${PROJECT_NAME}> $<TARGET_FILE_DIR:${PROJECT_NAME}>
COMMAND_EXPAND_LISTS
)
endif()
NOTE: It’s better to use ${CMAKE_STATIC_LIBRARY_PREFIX}, {CMAKE_STATIC_LIBRARY_SUFFIX}, and their shared library equivalents rather than hardcoding “lib” prefixes and “.dll” suffixes. I haven’t done it above to keep the example as simple as possible.
P.S., I cover how to link to pre-compiled libraries (and a lot more) in my CMake Tutorial book, which you can check out here: https://cmaketutorial.com/