CMake 3.21:
I’m trying to wrap fmod with a SHARED IMPORTED target and support Windows builds. The .lib name depends on bitness and build type, as does the dll, but the IMPORTED_IMPLIB and IMPORTED_LOCATION properties don’t appear to take generator expressions.
SET_PARGET_PROPERTIES(
ExternFMOD
PROPERTIES
IMPORTED_IMPLIB "${_fmod_lib_dir}/$<IF:$<CONFIG:Debug>,fmodL64_vc.lib,fmod64_vc.lib>"
IMPORTED_LOCATION "${_fmod_lib_dir}/$<IF:$<CONFIG:Debug>,fmodL64.dll,fmod64.dll>"
)
fails:
LINK : fatal error LNK1104: cannot open file '...\lib\$<IF:$<CONFIG:Debug>,fmodL64_vc.lib,fmod64_vc.lib>' ...
It doesn’t appear to allow the old ‘optimized’ or ‘debug’ patterns, either.
This approach seems to be dead in the water without explicit generator expression support for IMPLIB_ properties?