diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake index d5ec8cf4fb..c2aa026ef0 100644 --- a/build/cmake/config.cmake +++ b/build/cmake/config.cmake @@ -42,7 +42,13 @@ macro(wx_get_dependencies var lib) else() get_filename_component(dep_name ${dep} NAME) endif() - wx_string_append(${var} "-l${dep_name} ") + if(dep_name MATCHES "^-l(.*)" OR dep_name STREQUAL "libc.so") + wx_string_append(${var} "${dep_name} ") + elseif(dep_name MATCHES "^lib(.*)(.so|.a)") + wx_string_append(${var} "-l${CMAKE_MATCH_1} ") + elseif(dep_name) + wx_string_append(${var} "-l${dep_name} ") + endif() endforeach() string(STRIP ${${var}} ${var}) endif()