Remember that this is a macro, so characters are replaced before being replaced. This means that characters that are empty will be replaced with nothing before being evaluated. Thus, if WTDBO_SOVERSION "", then
SET_TARGET_PROPERTIES(wtdbo PROPERTIES SOVERSION ${WTDBO_SOVERSION})
will become
SET_TARGET_PROPERTIES(wtdbo PROPERTIES SOVERSION)
and it will cause an error. If blank lines are valid for your purpose, then surround the character in quotation marks. eg.
SET_TARGET_PROPERTIES(wtdbo PROPERTIES SOVERSION "${WTDBO_SOVERSION}")
source share