I enclosed fix for POSIX hosts, based on commit 13182cd6. Regards
Jiri > On 03/26/2014 03:39 PM, Jiri Malak wrote: >> You are right, I will sent next patch for POSIX platforms. > > Thanks. Please base work on commit 13182cd6 to make it easy > for me to apply the patch. > > -Brad > >
>From fb77864caa43a2bdaf8a4a2e177c224a3147bab9 Mon Sep 17 00:00:00 2001 From: Jiri Malak <[email protected]> Date: Wed, 26 Mar 2014 22:33:17 +0100 Subject: [PATCH] Correct single quote processing for Watcom linker on POSIX hosts. --- Source/cmLocalUnixMakefileGenerator3.cxx | 28 +++++++++++++++++++++++++--- Source/cmLocalUnixMakefileGenerator3.h | 2 +- Source/cmMakefileTargetGenerator.cxx | 7 ++++--- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 7e55838..fa81913 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -2182,14 +2182,25 @@ cmLocalUnixMakefileGenerator3 //---------------------------------------------------------------------------- std::string cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(const char* p, - const char* quote) + bool useSingleQuote) { // Split the path into its components. std::vector<std::string> components; cmSystemTools::SplitPath(p, components); // Open the quoted result. - std::string result = quote; + if( useSingleQuote) + { +#if defined(_WIN32) && !defined(__CYGWIN__) + std::string result = "'"; +#else + std::string result = "\"'"; +#endif + } + else + { + std::string result = "\""; + } // Return an empty path if there are no components. if(!components.empty()) @@ -2233,7 +2244,18 @@ cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(const char* p, } // Close the quoted result. - result += quote; + if( useSingleQuote) + { +#if defined(_WIN32) && !defined(__CYGWIN__) + result += "'"; +#else + result += "'\""; +#endif + } + else + { + result += "\""; + } return result; } diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h index 2871cba..0aa804a 100644 --- a/Source/cmLocalUnixMakefileGenerator3.h +++ b/Source/cmLocalUnixMakefileGenerator3.h @@ -187,7 +187,7 @@ public: cmLocalGenerator::RelativeRoot returnDir); static std::string ConvertToQuotedOutputPath(const char* p, - const char* quote); + bool useSingleQuote); std::string CreateMakeVariable(const std::string& sin, const std::string& s2in); diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 4ebd334..92dd29b 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -1354,7 +1354,6 @@ cmMakefileTargetGenerator { // Write a make variable assignment that lists all objects for the // target. - char const* quote = (useSingleQuote) ? "'" : "\""; variableName = this->LocalGenerator->CreateMakeVariable(this->Target->GetName(), "_OBJECTS"); @@ -1373,7 +1372,8 @@ cmMakefileTargetGenerator { *this->BuildFileStream << " " << lineContinue << "\n"; *this->BuildFileStream << - this->LocalGenerator->ConvertToQuotedOutputPath(i->c_str(), quote); + this->LocalGenerator->ConvertToQuotedOutputPath(i->c_str(), + useSingleQuote); } *this->BuildFileStream << "\n"; @@ -1396,7 +1396,8 @@ cmMakefileTargetGenerator << " " << lineContinue << "\n" << this->Makefile->GetSafeDefinition("CMAKE_OBJECT_NAME"); *this->BuildFileStream << - this->LocalGenerator->ConvertToQuotedOutputPath(i->c_str(), quote); + this->LocalGenerator->ConvertToQuotedOutputPath(i->c_str(), + useSingleQuote); } *this->BuildFileStream << "\n" << "\n"; } -- 1.8.1.4
-- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
