diff --git a/CMakeLists.txt b/CMakeLists.txt index f57a78a14a..5e1924ba1e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -794,8 +794,15 @@ foreach (flag ${CONFIG_LDFLAGS_LIST}) # message("${flag} is a file") set(_CONFIG_LDFLAGS "${_CONFIG_LDFLAGS} ${flag}") else() - message("Fixing ${flag} to -l${flag}") - set(_CONFIG_LDFLAGS "${_CONFIG_LDFLAGS} -l${flag}") + string(FIND "${flag}" "::" hascolcol) + if (${hascolcol} EQUAL -1) + message("Fixing ${flag} to -l${flag}") + set(_CONFIG_LDFLAGS "${_CONFIG_LDFLAGS} -l${flag}") + else() + string(REGEX MATCH "[^:]*$" flag2 "${flag}") + message("Fixing ${flag} to -l${flag2}") + set(_CONFIG_LDFLAGS "${_CONFIG_LDFLAGS} -l${flag2}") + endif() endif() endif() endforeach()