Looks good! Haven’t got things set up yet, sorry. Syntax-wise it certainly looks sturdy enough, if need be there’s always CMake: How to Unit-Test your own CMake Script Macros/Functions?.
Aah, you mean the DevIL component is impacting on the issue with Meson? If so, might be an idea to update it, hopefully with new insights from the current config. 🙂
Is there any chance of decoupling DevIL entirely and pointing the referenced functions to the new ResIL source with minimal drama?