From e74377dcd809d078f7d7a24dd2dedc7ed6ef986e Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Sun, 22 Dec 2002 15:19:48 -0500 Subject: ENH: fixes for borland with spaces in the path --- Modules/Platform/Windows-bcc32.cmake | 4 ++-- Source/cmLocalUnixMakefileGenerator.cxx | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Modules/Platform/Windows-bcc32.cmake b/Modules/Platform/Windows-bcc32.cmake index da90d82..c85ca09 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 9e57a15..8a1d453 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) -- cgit v0.12