cmake/install: move check against _[wl]in into cmake helper macro functions