r261397 changed how LDFLAGS were added to the target under cmake from
using target_link_libraries to using a function to call
append_target_flags to append LDFLAGS to LINK_FLAGS because
target_link_libraries ignores flags that do not begin with -; however,
LINK_FLAGS are appended before the object files on the link line, so
this causes linking statically to fail.
This patches changes the append_compile_flags macro to append LDFLAGS to
LINK_LIBRARIES instead of LINK_FLAGS, as LINK_LIBRARIES is appended
after the object files. In addition, it modifies the append_target_flags
macro to strip whitespace before setting the destination variable, as
having any whitespace before or after LINK_LIBRARIES violates CMP0004.
accidental newline?