Use the ENV{LIB} variable directly instead of parsing the output of the whole environment from "set". Store the output in a .cmake script and include it from CMakeDetermineCompilerABI instead of using file(READ).