FIND_LIBRARY without a suffix?
The docs for FIND_LIBRARY say
Each library name given to the NAMES option is first considered as a library file name and then considered with platform-specific prefixes (e.g. lib) and suffixes (e.g. .so). Therefore one may specify library file names such as libfoo.a directly. This can be used to locate static libraries on UNIX-like systems.
But I feel like that is not the case. At least my experiments seem to indicate it is not so. I had to do
SET(CMAKE_FIND_LIBRARY_SUFFIXES "" ".lib" ".dll")
to add "" as a suffix before it would find the library. FIND_FILE worked fine with the same signature which is what drove me to look deeper. In this case it was and the library name was libswresample.a on a windows 64 build.
SET(CMAKE_FIND_LIBRARY_SUFFIXES "" ".lib" ".dll")
FIND_LIBRARY(FFMPEG_${varname}_LIBRARIES
NAMES ${potentialNames}
PATHS
${FFMPEG_ROOT}/lib
$ENV{FFMPEG_DIR}/lib
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/local/lib64
/usr/lib
/usr/lib64
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
DOC "Location of FFMPEG Libraries"
)