In many projects I use:
set(LINKER_OPTIONS "LINKER:-z,defs")
to prevent underlinking. But this requires tests for what platform is being used (macOS does not recognize this flag, and doesn’t need it), and perhaps even depends on the compiler and linker toolchain being used.
Is there a “generic” way to have CMake provide this for me, when it is needed?