Avoid CMake Warning that used GET_TARGET_PROPERTY with LOCATION property,
so we should use $<TARGET_FILE> expression instead.
Fix CMake warnings on Mac OS X.
Fix build failure with gcc.