summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CTest/cmCTestReadCustomFilesCommand.cxx1
-rw-r--r--Source/cmCoreTryCompile.cxx13
-rw-r--r--Source/cmExtraKateGenerator.cxx18
-rw-r--r--Source/cmGeneratorTarget.cxx11
-rw-r--r--Source/cmGlobalGenerator.cxx3
-rw-r--r--Source/cmSystemTools.cxx46
-rw-r--r--Source/cmSystemTools.h9
-rw-r--r--Source/cmTarget.cxx1
9 files changed, 80 insertions, 24 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 1a923ce..9e60e71 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -2,5 +2,5 @@
set(CMake_VERSION_MAJOR 2)
set(CMake_VERSION_MINOR 8)
set(CMake_VERSION_PATCH 12)
-set(CMake_VERSION_TWEAK 20140216)
+set(CMake_VERSION_TWEAK 20140219)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CTest/cmCTestReadCustomFilesCommand.cxx b/Source/CTest/cmCTestReadCustomFilesCommand.cxx
index 5db01f9..3b9d552 100644
--- a/Source/CTest/cmCTestReadCustomFilesCommand.cxx
+++ b/Source/CTest/cmCTestReadCustomFilesCommand.cxx
@@ -10,7 +10,6 @@
See the License for more information.
============================================================================*/
#include "cmCTestReadCustomFilesCommand.h"
-
#include "cmCTest.h"
bool cmCTestReadCustomFilesCommand
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index bbdb3a1..7b52069 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -585,15 +585,20 @@ void cmCoreTryCompile::CleanupFiles(const char* binDir)
}
else
{
+#ifdef _WIN32
// Sometimes anti-virus software hangs on to new files so we
// cannot delete them immediately. Try a few times.
- int tries = 5;
+ cmSystemTools::WindowsFileRetry retry =
+ cmSystemTools::GetWindowsFileRetry();
while(!cmSystemTools::RemoveFile(fullPath.c_str()) &&
- --tries && cmSystemTools::FileExists(fullPath.c_str()))
+ --retry.Count && cmSystemTools::FileExists(fullPath.c_str()))
{
- cmSystemTools::Delay(500);
+ cmSystemTools::Delay(retry.Delay);
}
- if(tries == 0)
+ if(retry.Count == 0)
+#else
+ if(!cmSystemTools::RemoveFile(fullPath.c_str()))
+#endif
{
std::string m = "Remove failed on file: " + fullPath;
cmSystemTools::ReportLastSystemError(m.c_str());
diff --git a/Source/cmExtraKateGenerator.cxx b/Source/cmExtraKateGenerator.cxx
index d0f83b2..a0d37d4 100644
--- a/Source/cmExtraKateGenerator.cxx
+++ b/Source/cmExtraKateGenerator.cxx
@@ -98,12 +98,12 @@ cmExtraKateGenerator::WriteTargets(const cmMakefile* mf,
"\t\t\"clean_target\": \"clean\",\n";
// build, clean and quick are for the build plugin kate <= 4.12:
- fout << "\t\t\"build\": \"" << make << " -C " << homeOutputDir
- << " " << makeArgs << " " << "all\",\n";
- fout << "\t\t\"clean\": \"" << make << " -C " << homeOutputDir
- << " " << makeArgs << " " << "clean\",\n";
- fout << "\t\t\"quick\": \"" << make << " -C " << homeOutputDir
- << " " << makeArgs << " " << "install\",\n";
+ fout << "\t\t\"build\": \"" << make << " -C \\\"" << homeOutputDir
+ << "\\\" " << makeArgs << " " << "all\",\n";
+ fout << "\t\t\"clean\": \"" << make << " -C \\\"" << homeOutputDir
+ << "\\\" " << makeArgs << " " << "clean\",\n";
+ fout << "\t\t\"quick\": \"" << make << " -C \\\"" << homeOutputDir
+ << "\\\" " << makeArgs << " " << "install\",\n";
// this is for kate >= 4.13:
fout <<
@@ -225,9 +225,9 @@ cmExtraKateGenerator::AppendTarget(cmGeneratedFileStream& fout,
fout <<
"\t\t\t" << JsonSep << "{\"name\":\"" << target << "\", "
"\"build_cmd\":\"" << make
- << " -C " << (this->UseNinja ? homeOutputDir : path.c_str())
- << " " << makeArgs << " "
- << target << "\"}\n";
+ << " -C \\\"" << (this->UseNinja ? homeOutputDir : path.c_str())
+ << "\\\" " << makeArgs << " "
+ << target << "\"}\n";
JsonSep = ',';
}
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 2573c85..175bb0e 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -498,11 +498,14 @@ cmTargetTraceDependencies
// Queue all the source files already specified for the target.
std::vector<cmSourceFile*> sources;
- this->Target->GetSourceFiles(sources);
- for(std::vector<cmSourceFile*>::const_iterator si = sources.begin();
- si != sources.end(); ++si)
+ if (this->Target->GetType() != cmTarget::INTERFACE_LIBRARY)
{
- this->QueueSource(*si);
+ this->Target->GetSourceFiles(sources);
+ for(std::vector<cmSourceFile*>::const_iterator si = sources.begin();
+ si != sources.end(); ++si)
+ {
+ this->QueueSource(*si);
+ }
}
// Queue pre-build, pre-link, and post-build rule dependencies.
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 7d98734..4f3328d 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1468,7 +1468,8 @@ void cmGlobalGenerator::ComputeGeneratorTargetObjects()
for(cmGeneratorTargetsType::iterator ti = targets.begin();
ti != targets.end(); ++ti)
{
- if (ti->second->Target->IsImported())
+ if (ti->second->Target->IsImported()
+ || ti->second->Target->GetType() == cmTarget::INTERFACE_LIBRARY)
{
continue;
}
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 41c7509..ff05975 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -864,6 +864,44 @@ bool cmSystemTools::CopyFileIfDifferent(const char* source,
}
//----------------------------------------------------------------------------
+#ifdef _WIN32
+cmSystemTools::WindowsFileRetry cmSystemTools::GetWindowsFileRetry()
+{
+ static WindowsFileRetry retry = {0,0};
+ if(!retry.Count)
+ {
+ unsigned int data[2] = {0,0};
+ HKEY const keys[2] = {HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE};
+ wchar_t const* const values[2] = {L"FilesystemRetryCount",
+ L"FilesystemRetryDelay"};
+ for(int k=0; k < 2; ++k)
+ {
+ HKEY hKey;
+ if(RegOpenKeyExW(keys[k], L"Software\\Kitware\\CMake\\Config",
+ 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS)
+ {
+ for(int v=0; v < 2; ++v)
+ {
+ DWORD dwData, dwType, dwSize = 4;
+ if(!data[v] &&
+ RegQueryValueExW(hKey, values[v], 0, &dwType, (BYTE *)&dwData,
+ &dwSize) == ERROR_SUCCESS &&
+ dwType == REG_DWORD && dwSize == 4)
+ {
+ data[v] = static_cast<unsigned int>(dwData);
+ }
+ }
+ RegCloseKey(hKey);
+ }
+ }
+ retry.Count = data[0]? data[0] : 5;
+ retry.Delay = data[1]? data[1] : 500;
+ }
+ return retry;
+}
+#endif
+
+//----------------------------------------------------------------------------
bool cmSystemTools::RenameFile(const char* oldname, const char* newname)
{
#ifdef _WIN32
@@ -874,10 +912,10 @@ bool cmSystemTools::RenameFile(const char* oldname, const char* newname)
fails then remove the read-only attribute from any existing destination.
Try multiple times since we may be racing against another process
creating/opening the destination file just before our MoveFileEx. */
- int tries = 5;
+ WindowsFileRetry retry = cmSystemTools::GetWindowsFileRetry();
while(!MoveFileExW(cmsys::Encoding::ToWide(oldname).c_str(),
cmsys::Encoding::ToWide(newname).c_str(),
- MOVEFILE_REPLACE_EXISTING) && --tries)
+ MOVEFILE_REPLACE_EXISTING) && --retry.Count)
{
// Try again only if failure was due to access permissions.
if(GetLastError() != ERROR_ACCESS_DENIED)
@@ -896,10 +934,10 @@ bool cmSystemTools::RenameFile(const char* oldname, const char* newname)
else
{
// The file may be temporarily in use so wait a bit.
- cmSystemTools::Delay(100);
+ cmSystemTools::Delay(retry.Delay);
}
}
- return tries > 0;
+ return retry.Count > 0;
#else
/* On UNIX we have an OS-provided call to do this atomically. */
return rename(oldname, newname) == 0;
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index 4e854c8..4a5d298 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -460,6 +460,15 @@ public:
/** Tokenize a string */
static std::vector<std::string> tokenize(const std::string& str,
const std::string& sep);
+
+#ifdef _WIN32
+ struct WindowsFileRetry
+ {
+ unsigned int Count;
+ unsigned int Delay;
+ };
+ static WindowsFileRetry GetWindowsFileRetry();
+#endif
private:
static bool s_ForceUnixPaths;
static bool s_RunCommandHideConsole;
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 3e96b69..db34bd8 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -551,6 +551,7 @@ bool cmTarget::FindSourceFiles()
//----------------------------------------------------------------------------
void cmTarget::GetSourceFiles(std::vector<cmSourceFile*> &files) const
{
+ assert(this->GetType() != INTERFACE_LIBRARY);
files = this->SourceFiles;
}