diff --git a/Modules/Platform/Windows-bcc32.cmake b/Modules/Platform/Windows-bcc32.cmake index da90d82b1..c85ca0908 100644 --- a/Modules/Platform/Windows-bcc32.cmake +++ b/Modules/Platform/Windows-bcc32.cmake @@ -26,7 +26,7 @@ SET(CMAKE_END_TEMP_FILE "\n|") # create a shared C++ library SET(CMAKE_CXX_CREATE_SHARED_LIBRARY " ${CMAKE_START_TEMP_FILE}-e -tWD -tWR ${CMAKE_END_TEMP_FILE}" - "implib ${CMAKE_START_TEMP_FILE}-w .lib .dll${CMAKE_END_TEMP_FILE}" + "implib -w .lib .dll" ) SET(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY}) @@ -34,7 +34,7 @@ SET(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY}) # create a C shared library SET(CMAKE_C_CREATE_SHARED_LIBRARY " ${CMAKE_START_TEMP_FILE}-e -tWD -tWR ${CMAKE_END_TEMP_FILE}" - "implib ${CMAKE_START_TEMP_FILE}-w .lib .dll${CMAKE_END_TEMP_FILE}" + "implib -w .lib .dll" ) # create a C shared module just copy the shared library rule diff --git a/Source/cmLocalUnixMakefileGenerator.cxx b/Source/cmLocalUnixMakefileGenerator.cxx index 9e57a157a..8a1d45335 100644 --- a/Source/cmLocalUnixMakefileGenerator.cxx +++ b/Source/cmLocalUnixMakefileGenerator.cxx @@ -768,6 +768,18 @@ cmLocalUnixMakefileGenerator::ExpandRuleVariables(std::string& s, } if(targetBase) { + // special case for quoted paths with spaces + // if you see .lib then put the .lib inside + // the quotes, same for .dll + if((strlen(targetBase) > 1) && targetBase[0] == '\"') + { + std::string base = targetBase; + base[base.size()-1] = '.'; + std::string baseLib = base + "lib\""; + std::string baseDll = base + "dll\""; + cmSystemTools::ReplaceString(s, ".lib", baseLib.c_str()); + cmSystemTools::ReplaceString(s, ".dll", baseDll.c_str()); + } cmSystemTools::ReplaceString(s, "", targetBase); } if(linkLibs)