If anybody in the audience knows how CMake determines the flags to be used when linking a particular executable target, based on:
the setting of CMAKE_EXE_LINKER_FLAGS;
the setting of CMAKE_EXE_LINKER_FLAGS_<CONFIG> for the configuration being built;
the LINK_FLAGS property of the target being built;
any *other* variables and properties that affect the linker flags;
it would be appreciated if they'd let us know *and* convince the CMake people to document this in some fairly obvious place; the documentation for CMAKE_EXE_LINKER_FLAGS:
https://cmake.org/cmake/help/v3.12/variable/CMAKE_EXE_LINKER_FLAGS.html
"Linker flags to be used to create executables.
These flags will be used by the linker when creating an executable."
CMAKE_EXE_LINKER_FLAGS_<CONFIG>:
https://cmake.org/cmake/help/v3.12/variable/CMAKE_EXE_LINKER_FLAGS_CONFIG.html
"Flags to be used when linking an executable.
Same as CMAKE_C_FLAGS_* but used by the linker when creating executables."
LINK_FLAGS:
https://cmake.org/cmake/help/v3.12/prop_tgt/LINK_FLAGS.html
"Additional flags to use when linking this target.
The LINK_FLAGS property can be used to add extra flags to the link step of a target. LINK_FLAGS_<CONFIG> will add to the configuration <CONFIG>, for example, DEBUG, RELEASE, MINSIZEREL, RELWITHDEBINFO, …"
LINK_FLAGS_<CONFIG>:
https://cmake.org/cmake/help/v3.12/prop_tgt/LINK_FLAGS_CONFIG.html
"Per-configuration linker flags for a target.
This is the configuration-specific version of LINK_FLAGS."
doesn't help, and there doesn't appear to *be* any documentation for the alleged "CMAKE_C_FLAGS_*" flags.
Until then, I'll just go back to doing things the old way, even if that's not how you're supposed to set link flags that are to be used with all executables.
(And then explain the behaviors of linker flags for *other* types of targets, if they're similar, *mutatis mutandis*.)