summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/policy/CMP0024.rst2
-rw-r--r--Help/policy/CMP0037.rst2
-rw-r--r--Help/variable/CMAKE_VERBOSE_MAKEFILE.rst9
-rw-r--r--Modules/FindBacktrace.cmake17
-rw-r--r--Modules/Platform/MirBSD.cmake1
-rw-r--r--Modules/TestCXXAcceptsFlag.cmake16
-rw-r--r--Source/cmExportBuildFileGenerator.cxx2
-rw-r--r--Source/cmExportInstallFileGenerator.cxx12
-rw-r--r--Source/cmGeneratorExpressionEvaluator.cxx66
-rw-r--r--Source/cmGlobalBorlandMakefileGenerator.h2
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.h3
-rw-r--r--Source/cmGlobalWatcomWMakeGenerator.h2
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx11
-rw-r--r--Source/cmQtAutoGenerators.cxx6
-rw-r--r--Source/cmStandardIncludes.h6
-rw-r--r--Source/cmTarget.cxx2
-rw-r--r--Source/kwsys/EncodingC.c2
-rw-r--r--Source/kwsys/FStream.hxx.in2
-rw-r--r--Source/kwsys/ProcessUNIX.c2
-rw-r--r--Source/kwsys/SystemInformation.cxx32
-rw-r--r--Source/kwsys/SystemTools.cxx4
-rw-r--r--Source/kwsys/testEncoding.cxx11
-rw-r--r--Tests/GeneratorExpression/CMakeLists.txt6
-rw-r--r--Tests/GeneratorExpression/check-part3.cmake6
-rw-r--r--Tests/RunCMake/CMP0028/CMP0028-NEW-stderr.txt2
-rw-r--r--Tests/RunCMake/CMP0028/CMP0028-WARN-stderr.txt2
26 files changed, 143 insertions, 85 deletions
diff --git a/Help/policy/CMP0024.rst b/Help/policy/CMP0024.rst
index 4c8c714..abfcc75 100644
--- a/Help/policy/CMP0024.rst
+++ b/Help/policy/CMP0024.rst
@@ -11,7 +11,7 @@ until later at generate-time, such as the link language and complete
list of link libraries. Future refactoring will change the effect of
the export() command to be executed at generate-time. Use ALIAS
targets instead in cases where the goal is to refer to targets by
-another name
+another name.
The OLD behavior for this policy is to allow including the result of
an export() command. The NEW behavior for this policy is to not to
diff --git a/Help/policy/CMP0037.rst b/Help/policy/CMP0037.rst
index 059b2e6..f4d2f4e 100644
--- a/Help/policy/CMP0037.rst
+++ b/Help/policy/CMP0037.rst
@@ -11,7 +11,7 @@ diagnostics expect target names to match a restricted pattern.
Target names may contain upper and lower case letters, numbers, the underscore
character (_), dot(.), plus(+) and minus(-). As a special case, ALIAS
-targets and INTERFACE library targets may contain two consequtive colons.
+targets and IMPORTED targets may contain two consequtive colons.
Target names reserved by one or more CMake generators are not allowed.
Among others these include "all", "help" and "test".
diff --git a/Help/variable/CMAKE_VERBOSE_MAKEFILE.rst b/Help/variable/CMAKE_VERBOSE_MAKEFILE.rst
index 451ce8c..2420a25 100644
--- a/Help/variable/CMAKE_VERBOSE_MAKEFILE.rst
+++ b/Help/variable/CMAKE_VERBOSE_MAKEFILE.rst
@@ -1,8 +1,9 @@
CMAKE_VERBOSE_MAKEFILE
----------------------
-Create verbose makefiles if on.
+Enable verbose output from Makefile builds.
-This variable defaults to false. You can set this variable to true to
-make CMake produce verbose makefiles that show each command line as it
-is used.
+This variable is a cache entry initialized (to FALSE) by
+the :command:`project` command. Users may enable the option
+in their local build tree to get more verbose output from
+Makefile builds and show each command line as it is launched.
diff --git a/Modules/FindBacktrace.cmake b/Modules/FindBacktrace.cmake
index 56e739e..83789cc 100644
--- a/Modules/FindBacktrace.cmake
+++ b/Modules/FindBacktrace.cmake
@@ -58,17 +58,20 @@ endif(Backtrace_HEADER)
find_path(Backtrace_INCLUDE_DIR "${_Backtrace_HEADER_TRY}")
set(Backtrace_INCLUDE_DIRS ${Backtrace_INCLUDE_DIR})
-# First, check if we already have backtrace(), e.g., in libc
-cmake_push_check_state(RESET)
-set(CMAKE_REQUIRED_INCLUDES ${Backtrace_INCLUDE_DIRS})
-check_symbol_exists("backtrace" "${_Backtrace_HEADER_TRY}" _Backtrace_SYM_FOUND)
-cmake_pop_check_state()
+if (NOT DEFINED Backtrace_LIBRARY)
+ # First, check if we already have backtrace(), e.g., in libc
+ cmake_push_check_state(RESET)
+ set(CMAKE_REQUIRED_INCLUDES ${Backtrace_INCLUDE_DIRS})
+ check_symbol_exists("backtrace" "${_Backtrace_HEADER_TRY}" _Backtrace_SYM_FOUND)
+ cmake_pop_check_state()
+endif()
if(_Backtrace_SYM_FOUND)
- set(Backtrace_LIBRARY)
- if(NOT Backtrace_FIND_QUIETLY)
+ # Avoid repeating the message() call below each time CMake is run.
+ if(NOT Backtrace_FIND_QUIETLY AND NOT DEFINED Backtrace_LIBRARY)
message(STATUS "backtrace facility detected in default set of libraries")
endif()
+ set(Backtrace_LIBRARY "" CACHE FILEPATH "Library providing backtrace(3), empty for default set of libraries")
else()
# Check for external library, for non-glibc systems
if(Backtrace_INCLUDE_DIR)
diff --git a/Modules/Platform/MirBSD.cmake b/Modules/Platform/MirBSD.cmake
new file mode 100644
index 0000000..7637f9b
--- /dev/null
+++ b/Modules/Platform/MirBSD.cmake
@@ -0,0 +1 @@
+include(Platform/OpenBSD)
diff --git a/Modules/TestCXXAcceptsFlag.cmake b/Modules/TestCXXAcceptsFlag.cmake
index 2bcbea6..c814187 100644
--- a/Modules/TestCXXAcceptsFlag.cmake
+++ b/Modules/TestCXXAcceptsFlag.cmake
@@ -2,16 +2,18 @@
# TestCXXAcceptsFlag
# ------------------
#
-# Test CXX compiler for a flag
+# Deprecated. See :module:`CheckCXXCompilerFlag`.
#
-# Check if the CXX compiler accepts a flag
+# Check if the CXX compiler accepts a flag.
#
-# ::
+# .. code-block:: cmake
#
-# Macro CHECK_CXX_ACCEPTS_FLAG(FLAGS VARIABLE) -
-# checks if the function exists
-# FLAGS - the flags to try
-# VARIABLE - variable to store the result
+# CHECK_CXX_ACCEPTS_FLAG(<flags> <variable>)
+#
+# ``<flags>``
+# the flags to try
+# ``<variable>``
+# variable to store the result
#=============================================================================
# Copyright 2002-2009 Kitware, Inc.
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index 0d0d05b..c10f86f 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -229,10 +229,8 @@ cmExportBuildFileGenerator::HandleMissingTarget(
// Append it with the export namespace.
link_libs += this->Namespace;
link_libs += dependee->GetExportName();
-// if generate time {}
}
-
//----------------------------------------------------------------------------
std::vector<std::string>
cmExportBuildFileGenerator
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index 79e78df..1025dc0 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -297,16 +297,14 @@ cmExportInstallFileGenerator
{
// Collect import properties for this target.
cmTargetExport const* te = *tei;
- ImportPropertyMap properties;
- std::set<std::string> importedLocations;
- if (!properties.empty()
- && te->Target->GetType() == cmTarget::INTERFACE_LIBRARY)
+ if (te->Target->GetType() == cmTarget::INTERFACE_LIBRARY)
{
- this->GenerateImportPropertyCode(os, config, te->Target, properties);
- this->GenerateImportedFileChecksCode(os, te->Target, properties,
- importedLocations);
continue;
}
+
+ ImportPropertyMap properties;
+ std::set<std::string> importedLocations;
+
this->SetImportLocationProperty(config, suffix, te->ArchiveGenerator,
properties, importedLocations);
this->SetImportLocationProperty(config, suffix, te->LibraryGenerator,
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 0f8c4e3..c8010d0 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -82,7 +82,6 @@ static const struct ZeroNode : public cmGeneratorExpressionNode
const GeneratorExpressionContent *,
cmGeneratorExpressionDAGChecker *) const
{
- // Unreachable
return std::string();
}
} zeroNode;
@@ -94,13 +93,12 @@ static const struct OneNode : public cmGeneratorExpressionNode
virtual bool AcceptsArbitraryContentParameter() const { return true; }
- std::string Evaluate(const std::vector<std::string> &,
+ std::string Evaluate(const std::vector<std::string> &parameters,
cmGeneratorExpressionContext *,
const GeneratorExpressionContent *,
cmGeneratorExpressionDAGChecker *) const
{
- // Unreachable
- return std::string();
+ return parameters.front();
}
} oneNode;
@@ -203,6 +201,8 @@ static const struct LowerCaseNode : public cmGeneratorExpressionNode
{
LowerCaseNode() {}
+ bool AcceptsArbitraryContentParameter() const { return true; }
+
std::string Evaluate(const std::vector<std::string> &parameters,
cmGeneratorExpressionContext *,
const GeneratorExpressionContent *,
@@ -217,6 +217,8 @@ static const struct UpperCaseNode : public cmGeneratorExpressionNode
{
UpperCaseNode() {}
+ bool AcceptsArbitraryContentParameter() const { return true; }
+
std::string Evaluate(const std::vector<std::string> &parameters,
cmGeneratorExpressionContext *,
const GeneratorExpressionContent *,
@@ -231,6 +233,8 @@ static const struct MakeCIdentifierNode : public cmGeneratorExpressionNode
{
MakeCIdentifierNode() {}
+ bool AcceptsArbitraryContentParameter() const { return true; }
+
std::string Evaluate(const std::vector<std::string> &parameters,
cmGeneratorExpressionContext *,
const GeneratorExpressionContent *,
@@ -350,6 +354,7 @@ static const struct CCompilerIdNode : public CompilerIdNode
reportError(context, content->GetOriginalExpression(),
"$<C_COMPILER_ID> may only be used with targets. It may not "
"be used with add_custom_command.");
+ return std::string();
}
return this->EvaluateWithLanguage(parameters, context, content,
dagChecker, "C");
@@ -377,6 +382,7 @@ static const struct CXXCompilerIdNode : public CompilerIdNode
reportError(context, content->GetOriginalExpression(),
"$<CXX_COMPILER_ID> may only be used with targets. It may not "
"be used with add_custom_command.");
+ return std::string();
}
return this->EvaluateWithLanguage(parameters, context, content,
dagChecker, "CXX");
@@ -444,6 +450,7 @@ static const struct CCompilerVersionNode : public CompilerVersionNode
reportError(context, content->GetOriginalExpression(),
"$<C_COMPILER_VERSION> may only be used with targets. It may not "
"be used with add_custom_command.");
+ return std::string();
}
return this->EvaluateWithLanguage(parameters, context, content,
dagChecker, "C");
@@ -472,6 +479,7 @@ static const struct CxxCompilerVersionNode : public CompilerVersionNode
reportError(context, content->GetOriginalExpression(),
"$<CXX_COMPILER_VERSION> may only be used with targets. It may "
"not be used with add_custom_command.");
+ return std::string();
}
return this->EvaluateWithLanguage(parameters, context, content,
dagChecker, "CXX");
@@ -504,7 +512,7 @@ struct PlatformIdNode : public cmGeneratorExpressionNode
return parameters.front().empty() ? "1" : "0";
}
- if (cmsysString_strcasecmp(parameters.begin()->c_str(), platformId) == 0)
+ if (strcmp(parameters.begin()->c_str(), platformId) == 0)
{
return "1";
}
@@ -1634,14 +1642,6 @@ std::string GeneratorExpressionContent::Evaluate(
return std::string();
}
- if (node->NumExpectedParameters() == 1
- && node->AcceptsArbitraryContentParameter())
- {
- return this->ProcessArbitraryContent(node, identifier, context,
- dagChecker,
- this->ParamChildren.begin());
- }
-
std::vector<std::string> parameters;
this->EvaluateParameters(node, identifier, context, dagChecker, parameters);
if (context->HadError)
@@ -1669,33 +1669,35 @@ std::string GeneratorExpressionContent::EvaluateParameters(
pend = this->ParamChildren.end();
const bool acceptsArbitraryContent
= node->AcceptsArbitraryContentParameter();
- for ( ; pit != pend; ++pit)
+ int counter = 1;
+ for ( ; pit != pend; ++pit, ++counter)
{
- std::string parameter;
- std::vector<cmGeneratorExpressionEvaluator*>::const_iterator it =
- pit->begin();
- const std::vector<cmGeneratorExpressionEvaluator*>::const_iterator end =
- pit->end();
- for ( ; it != end; ++it)
- {
- parameter += (*it)->Evaluate(context, dagChecker);
- if (context->HadError)
- {
- return std::string();
- }
- }
- parameters.push_back(parameter);
- if (acceptsArbitraryContent
- && parameters.size() == (unsigned int)numExpected - 1)
+ if (acceptsArbitraryContent && counter == numExpected)
{
- assert(pit != pend);
std::string lastParam = this->ProcessArbitraryContent(node, identifier,
context,
dagChecker,
- pit + 1);
+ pit);
parameters.push_back(lastParam);
return std::string();
}
+ else
+ {
+ std::string parameter;
+ std::vector<cmGeneratorExpressionEvaluator*>::const_iterator it =
+ pit->begin();
+ const std::vector<cmGeneratorExpressionEvaluator*>::const_iterator end =
+ pit->end();
+ for ( ; it != end; ++it)
+ {
+ parameter += (*it)->Evaluate(context, dagChecker);
+ if (context->HadError)
+ {
+ return std::string();
+ }
+ }
+ parameters.push_back(parameter);
+ }
}
}
diff --git a/Source/cmGlobalBorlandMakefileGenerator.h b/Source/cmGlobalBorlandMakefileGenerator.h
index bd3db3e..70004ea 100644
--- a/Source/cmGlobalBorlandMakefileGenerator.h
+++ b/Source/cmGlobalBorlandMakefileGenerator.h
@@ -44,6 +44,8 @@ public:
*/
virtual void EnableLanguage(std::vector<std::string>const& languages,
cmMakefile *, bool optional);
+
+ virtual bool AllowNotParallel() const { return false; }
};
#endif
diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h
index 986d1d7..00a86eb 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.h
+++ b/Source/cmGlobalUnixMakefileGenerator3.h
@@ -125,6 +125,9 @@ public:
const std::string &workingDirectory,
const std::string &compileCommand);
+ /** Does the make tool tolerate .NOTPARALLEL? */
+ virtual bool AllowNotParallel() const { return true; }
+
protected:
void WriteMainMakefile2();
void WriteMainCMakefile();
diff --git a/Source/cmGlobalWatcomWMakeGenerator.h b/Source/cmGlobalWatcomWMakeGenerator.h
index 23e60a1..d5350ef 100644
--- a/Source/cmGlobalWatcomWMakeGenerator.h
+++ b/Source/cmGlobalWatcomWMakeGenerator.h
@@ -43,6 +43,8 @@ public:
*/
virtual void EnableLanguage(std::vector<std::string>const& languages,
cmMakefile *, bool optional);
+
+ virtual bool AllowNotParallel() const { return false; }
};
#endif
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 7e97f78..20e8eea 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -1685,6 +1685,17 @@ void cmLocalUnixMakefileGenerator3
"default_target",
depends,
no_commands, true);
+
+ // Help out users that try "gmake target1 target2 -j".
+ cmGlobalUnixMakefileGenerator3* gg =
+ static_cast<cmGlobalUnixMakefileGenerator3*>(this->GlobalGenerator);
+ if(gg->AllowNotParallel())
+ {
+ std::vector<std::string> no_depends;
+ this->WriteMakeRule(ruleFileStream,
+ "Allow only one \"make -f Makefile2\" at a time, but pass parallelism.",
+ ".NOTPARALLEL", no_depends, no_commands, true);
+ }
}
this->WriteSpecialTargetsTop(ruleFileStream);
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 2b4bb8a..a561aab 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -1379,18 +1379,18 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
if (this->RunMocFailed)
{
- std::cerr << "moc failed..."<< std::endl;
+ std::cerr << "moc failed..." << std::endl;
return false;
}
if (this->RunUicFailed)
{
- std::cerr << "uic failed..."<< std::endl;
+ std::cerr << "uic failed..." << std::endl;
return false;
}
if (this->RunRccFailed)
{
- std::cerr << "rcc failed..."<< std::endl;
+ std::cerr << "rcc failed..." << std::endl;
return false;
}
outStream.flush();
diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h
index 7369fe6..eb6e52f 100644
--- a/Source/cmStandardIncludes.h
+++ b/Source/cmStandardIncludes.h
@@ -423,19 +423,19 @@ struct cmStrCmp {
cmStrCmp(const char *test) : m_test(test) {}
cmStrCmp(std::string &test) : m_test(test.c_str()) {}
- bool operator()(const char * input)
+ bool operator()(const char * input) const
{
return strcmp(input, m_test) == 0;
}
// For use with binary_search
- bool operator()(const char *str1, const char *str2)
+ bool operator()(const char *str1, const char *str2) const
{
return strcmp(str1, str2) < 0;
}
private:
- const char *m_test;
+ const char * const m_test;
};
#endif
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index a44cda1..a0177fb 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -5614,7 +5614,7 @@ void cmTarget::ComputeLinkImplementation(const char* config,
{
e << "Target \"" << this->GetName() << "\" links to target \"" << item
<< "\" but the target was not found. Perhaps a find_package() "
- "call is missing for an IMPORTED target, or a ALIAS target is "
+ "call is missing for an IMPORTED target, or an ALIAS target is "
"missing?";
this->Makefile->GetCMakeInstance()->IssueMessage(messageType,
e.str(),
diff --git a/Source/kwsys/EncodingC.c b/Source/kwsys/EncodingC.c
index a36eecc..cda78e2 100644
--- a/Source/kwsys/EncodingC.c
+++ b/Source/kwsys/EncodingC.c
@@ -68,7 +68,7 @@ size_t kwsysEncoding_wcstombs(char* dest, const wchar_t* str, size_t n)
char* kwsysEncoding_DupToNarrow(const wchar_t* str)
{
char* ret = NULL;
- size_t length = kwsysEncoding_wcstombs(0, str, 0);
+ size_t length = kwsysEncoding_wcstombs(0, str, 0) + 1;
if(length > 0)
{
ret = malloc(length);
diff --git a/Source/kwsys/FStream.hxx.in b/Source/kwsys/FStream.hxx.in
index 8170fb3..c340c55 100644
--- a/Source/kwsys/FStream.hxx.in
+++ b/Source/kwsys/FStream.hxx.in
@@ -81,7 +81,7 @@ namespace @KWSYS_NAMESPACE@
internal_buffer_type *rdbuf() const
{
- return buf_.get();
+ return buf_;
}
~basic_ifstream()
diff --git a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c
index b9af2f1..faeb967 100644
--- a/Source/kwsys/ProcessUNIX.c
+++ b/Source/kwsys/ProcessUNIX.c
@@ -2449,6 +2449,7 @@ static void kwsysProcessKill(pid_t process_id)
if(f)
{
size_t nread = fread(buffer, 1, KWSYSPE_PIPE_BUFFER_SIZE, f);
+ fclose(f);
buffer[nread] = '\0';
if(nread > 0)
{
@@ -2463,7 +2464,6 @@ static void kwsysProcessKill(pid_t process_id)
}
}
}
- fclose(f);
}
}
}
diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx
index 2f6c949..5f20853 100644
--- a/Source/kwsys/SystemInformation.cxx
+++ b/Source/kwsys/SystemInformation.cxx
@@ -3162,8 +3162,17 @@ bool SystemInformationImplementation::RetreiveInformationFromCpuInfoFile()
kwsys_stl::string cores =
this->ExtractValueFromCpuInfoFile(buffer,"cpu cores");
int numberOfCoresPerCPU=atoi(cores.c_str());
- this->NumberOfPhysicalCPU=static_cast<unsigned int>(
- numberOfCoresPerCPU*(maxId+1));
+ if (maxId > 0)
+ {
+ this->NumberOfPhysicalCPU=static_cast<unsigned int>(
+ numberOfCoresPerCPU*(maxId+1));
+ }
+ else
+ {
+ // Linux Sparc: get cpu count
+ this->NumberOfPhysicalCPU=
+ atoi(this->ExtractValueFromCpuInfoFile(buffer,"ncpus active").c_str());
+ }
#else // __CYGWIN__
// does not have "physical id" entries, neither "cpu cores"
@@ -3185,7 +3194,19 @@ bool SystemInformationImplementation::RetreiveInformationFromCpuInfoFile()
// CPU speed (checking only the first processor)
kwsys_stl::string CPUSpeed = this->ExtractValueFromCpuInfoFile(buffer,"cpu MHz");
- this->CPUSpeedInMHz = static_cast<float>(atof(CPUSpeed.c_str()));
+ if(!CPUSpeed.empty())
+ {
+ this->CPUSpeedInMHz = static_cast<float>(atof(CPUSpeed.c_str()));
+ }
+#ifdef __linux
+ else
+ {
+ // Linux Sparc: CPU speed is in Hz and encoded in hexadecimal
+ CPUSpeed = this->ExtractValueFromCpuInfoFile(buffer,"Cpu0ClkTck");
+ this->CPUSpeedInMHz = static_cast<float>(
+ strtoull(CPUSpeed.c_str(),0,16))/1000000.0f;
+ }
+#endif
// Chip family
kwsys_stl::string familyStr =
@@ -4991,7 +5012,12 @@ bool SystemInformationImplementation::QueryHPUXProcessor()
case CPU_PA_RISC2_0:
this->ChipID.Vendor = "Hewlett-Packard";
this->ChipID.Family = 0x200;
+# ifdef CPU_HP_INTEL_EM_1_0
+ case CPU_HP_INTEL_EM_1_0:
+# endif
+# ifdef CPU_IA64_ARCHREV_0
case CPU_IA64_ARCHREV_0:
+# endif
this->ChipID.Vendor = "GenuineIntel";
this->Features.HasIA64 = true;
break;
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 4649f3b..f4a443f 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -2115,10 +2115,10 @@ bool SystemTools::CopyFileAlways(const char* source, const char* destination)
SystemTools::RemoveFile(destination);
#if defined(_WIN32) || defined(__CYGWIN__)
- kwsys_ios::ofstream fout(destination,
+ kwsys::ofstream fout(destination,
kwsys_ios::ios::binary | kwsys_ios::ios::out | kwsys_ios::ios::trunc);
#else
- kwsys_ios::ofstream fout(destination,
+ kwsys::ofstream fout(destination,
kwsys_ios::ios::out | kwsys_ios::ios::trunc);
#endif
if(!fout)
diff --git a/Source/kwsys/testEncoding.cxx b/Source/kwsys/testEncoding.cxx
index 8e74a50..a65c430 100644
--- a/Source/kwsys/testEncoding.cxx
+++ b/Source/kwsys/testEncoding.cxx
@@ -16,14 +16,18 @@
#endif
#include KWSYS_HEADER(Encoding.hxx)
+#include KWSYS_HEADER(Encoding.h)
#include KWSYS_HEADER(ios/iostream)
#include <locale.h>
+#include <string.h>
+#include <stdlib.h>
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
#if 0
# include "Encoding.hxx.in"
+# include "Encoding.h.in"
# include "kwsys_ios_iostream.h.in"
#endif
@@ -68,11 +72,16 @@ static int testHelloWorldEncoding()
std::cout << str << std::endl;
std::wstring wstr = kwsys::Encoding::ToWide(str);
std::string str2 = kwsys::Encoding::ToNarrow(wstr);
- if(!wstr.empty() && str != str2)
+ wchar_t* c_wstr = kwsysEncoding_DupToWide(str.c_str());
+ char* c_str2 = kwsysEncoding_DupToNarrow(c_wstr);
+ if(!wstr.empty() && (str != str2 || strcmp(c_str2, str.c_str())))
{
std::cout << "converted string was different: " << str2 << std::endl;
+ std::cout << "converted string was different: " << c_str2 << std::endl;
ret++;
}
+ free(c_wstr);
+ free(c_str2);
}
return ret;
}
diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt
index edadb87..892f80f 100644
--- a/Tests/GeneratorExpression/CMakeLists.txt
+++ b/Tests/GeneratorExpression/CMakeLists.txt
@@ -193,9 +193,9 @@ add_custom_target(check-part3 ALL
-Dtest_platform_id_Linux=$<PLATFORM_ID:Linux>
-Dtest_platform_id_Windows=$<PLATFORM_ID:Windows>
-Dtest_platform_id_Darwin=$<PLATFORM_ID:Darwin>
- -Dlower_case=$<LOWER_CASE:MiXeD>
- -Dupper_case=$<UPPER_CASE:MiXeD>
- -Dmake_c_identifier=$<MAKE_C_IDENTIFIER:4foo:+bar-$>
+ -Dlower_case=$<LOWER_CASE:Mi,XeD>
+ -Dupper_case=$<UPPER_CASE:MiX,eD>
+ -Dmake_c_identifier=$<MAKE_C_IDENTIFIER:4f,oo:+bar-$>
-P ${CMAKE_CURRENT_SOURCE_DIR}/check-part3.cmake
COMMAND ${CMAKE_COMMAND} -E echo "check done (part 3 of 3)"
VERBATIM
diff --git a/Tests/GeneratorExpression/check-part3.cmake b/Tests/GeneratorExpression/check-part3.cmake
index a86db31..3361eeb 100644
--- a/Tests/GeneratorExpression/check-part3.cmake
+++ b/Tests/GeneratorExpression/check-part3.cmake
@@ -34,6 +34,6 @@ foreach(system Linux Windows Darwin)
check(test_platform_id_${system} 0)
endif()
endforeach()
-check(lower_case "mixed")
-check(upper_case "MIXED")
-check(make_c_identifier "_4foo__bar__")
+check(lower_case "mi,xed")
+check(upper_case "MIX,ED")
+check(make_c_identifier "_4f_oo__bar__")
diff --git a/Tests/RunCMake/CMP0028/CMP0028-NEW-stderr.txt b/Tests/RunCMake/CMP0028/CMP0028-NEW-stderr.txt
index a7b0799..711ad0e 100644
--- a/Tests/RunCMake/CMP0028/CMP0028-NEW-stderr.txt
+++ b/Tests/RunCMake/CMP0028/CMP0028-NEW-stderr.txt
@@ -1,6 +1,6 @@
CMake Error at CMP0028-NEW.cmake:4 \(add_library\):
Target "foo" links to target "External::Library" but the target was not
found. Perhaps a find_package\(\) call is missing for an IMPORTED target, or
- a ALIAS target is missing\?
+ an ALIAS target is missing\?
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/CMP0028/CMP0028-WARN-stderr.txt b/Tests/RunCMake/CMP0028/CMP0028-WARN-stderr.txt
index 2ff6927..41d7560 100644
--- a/Tests/RunCMake/CMP0028/CMP0028-WARN-stderr.txt
+++ b/Tests/RunCMake/CMP0028/CMP0028-WARN-stderr.txt
@@ -5,7 +5,7 @@ CMake Warning \(dev\) at CMP0028-WARN.cmake:2 \(add_library\):
Target "foo" links to target "External::Library" but the target was not
found. Perhaps a find_package\(\) call is missing for an IMPORTED target, or
- a ALIAS target is missing\?
+ an ALIAS target is missing\?
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.