diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake index 91d11acba2..d5ec8cf4fb 100644 --- a/build/cmake/config.cmake +++ b/build/cmake/config.cmake @@ -39,11 +39,10 @@ macro(wx_get_dependencies var lib) else() get_target_property(dep_name ${dep} OUTPUT_NAME) endif() - set(dep_name "-l${dep_name}") else() get_filename_component(dep_name ${dep} NAME) endif() - wx_string_append(${var} "${dep_name} ") + wx_string_append(${var} "-l${dep_name} ") endforeach() string(STRIP ${${var}} ${var}) endif() @@ -153,10 +152,14 @@ function(wx_write_config) set(WXCONFIG_CFLAGS "-pthread") set(WXCONFIG_LDFLAGS "-pthread") endif() - set(WXCONFIG_CPPFLAGS "-DWXUSINGDLL") + set(WXCONFIG_CPPFLAGS) + if(wxBUILD_SHARED) + wx_string_append(WXCONFIG_CPPFLAGS " -DWXUSINGDLL") + endif() foreach(flag IN LISTS wxTOOLKIT_DEFINITIONS) wx_string_append(WXCONFIG_CPPFLAGS " -D${flag}") endforeach() + string(STRIP "${WXCONFIG_CPPFLAGS}" WXCONFIG_CPPFLAGS) set(WXCONFIG_CXXFLAGS ${WXCONFIG_CFLAGS}) set(WXCONFIG_LDFLAGS_GUI) set(WXCONFIG_RESFLAGS)