Whole archive linking as a target property
I occasionally have to use the -Wl,--whole-archive flags on C++ libraries when using various tricks like self-registering factories at static initialization time. In CMake, when I or other people use the libraries, the only way I have found to do this is to manually put these flags into the target_link_libraries() command, which is platform dependent, as Mac OS X and MSVC both have alternatives for this flag.
Is there a way to apply these flags in a cross-platgorm manner using a target property? I was looking for something like INTERFACE_LINK_OPTIONS but I didn't see anything on the property list.
Thanks!