diff options
-rw-r--r-- | Auxiliary/cmake-mode.el | 103 | ||||
-rw-r--r-- | Modules/Platform/Linux-Intel-C.cmake | 1 | ||||
-rw-r--r-- | Modules/Platform/Linux-Intel-CXX.cmake | 1 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestReadCustomFilesCommand.cxx | 1 | ||||
-rw-r--r-- | Source/cmCoreTryCompile.cxx | 13 | ||||
-rw-r--r-- | Source/cmExtraKateGenerator.cxx | 18 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 11 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 3 | ||||
-rw-r--r-- | Source/cmSystemTools.cxx | 46 | ||||
-rw-r--r-- | Source/cmSystemTools.h | 9 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 1 |
12 files changed, 166 insertions, 43 deletions
diff --git a/Auxiliary/cmake-mode.el b/Auxiliary/cmake-mode.el index 433710b..c8b9f8b 100644 --- a/Auxiliary/cmake-mode.el +++ b/Auxiliary/cmake-mode.el @@ -291,31 +291,47 @@ optional argument topic will be appended to the argument list." (cmake-command-run "--help-command-list") ) -(defvar cmake-help-command-history nil "Topic read history.") -(defvar cmake-help-commands '() "List of available topics for --help-command.") -(defun cmake-command-list-as-list () - "Run cmake --help-command-list and return a list where each element is a cmake command." - (let ((temp-buffer-name "*CMake Commands Temporary*")) - (save-window-excursion - (cmake-command-run "--help-command-list" nil temp-buffer-name) - (with-current-buffer temp-buffer-name - (cdr (split-string (buffer-substring-no-properties (point-min) (point-max)) "\n" t))))) +(defvar cmake-commands '() "List of available topics for --help-command.") +(defvar cmake-help-command-history nil "Command read history.") +(defvar cmake-modules '() "List of available topics for --help-module.") +(defvar cmake-help-module-history nil "Module read history.") +(defvar cmake-variables '() "List of available topics for --help-variable.") +(defvar cmake-help-variable-history nil "Variable read history.") +(defvar cmake-properties '() "List of available topics for --help-property.") +(defvar cmake-help-property-history nil "Property read history.") +(defvar cmake-help-complete-history nil "Complete help read history.") +(defvar cmake-string-to-list-symbol + '(("command" cmake-commands cmake-help-command-history) + ("module" cmake-modules cmake-help-module-history) + ("variable" cmake-variables cmake-help-variable-history) + ("property" cmake-properties cmake-help-property-history) + )) + +(defun cmake-get-list (listname) + "If the value of LISTVAR is nil, run cmake --help-LISTNAME-list +and store the result as a list in LISTVAR." + (let ((listvar (car (cdr (assoc listname cmake-string-to-list-symbol))))) + (if (not (symbol-value listvar)) + (let ((temp-buffer-name "*CMake Temporary*")) + (save-window-excursion + (cmake-command-run (concat "--help-" listname "-list") nil temp-buffer-name) + (with-current-buffer temp-buffer-name + (set listvar (cdr (split-string (buffer-substring-no-properties (point-min) (point-max)) "\n" t)))))) + (symbol-value listvar) + )) ) (require 'thingatpt) -;;;###autoload -(defun cmake-get-command () - "Gets the topic from the minibuffer input. The default is the word the cursor is on." +(defun cmake-help-type (type) (let* ((default-entry (word-at-point)) + (history (car (cdr (cdr (assoc type cmake-string-to-list-symbol))))) (input (completing-read - "CMake command: " ; prompt - ((lambda () - (if cmake-help-commands cmake-help-commands - (setq cmake-help-commands (cmake-command-list-as-list))))) ; completions + (format "CMake %s: " type) ; prompt + (cmake-get-list type) ; completions nil ; predicate t ; require-match default-entry ; initial-input - 'cmake-help-command-history ; command history + history ))) (if (string= input "") (error "No argument given") @@ -324,10 +340,59 @@ optional argument topic will be appended to the argument list." ;;;###autoload (defun cmake-help-command () - "Prints out the help message corresponding to the command the cursor is on." + "Prints out the help message for the command the cursor is on." + (interactive) + (cmake-command-run "--help-command" (cmake-help-type "command") "*CMake Help*")) + +;;;###autoload +(defun cmake-help-module () + "Prints out the help message for the module the cursor is on." (interactive) - (cmake-command-run "--help-command" (downcase (cmake-get-command)) "*CMake Help*")) + (cmake-command-run "--help-module" (cmake-help-type "module") "*CMake Help*")) +;;;###autoload +(defun cmake-help-variable () + "Prints out the help message for the variable the cursor is on." + (interactive) + (cmake-command-run "--help-variable" (cmake-help-type "variable") "*CMake Help*")) + +;;;###autoload +(defun cmake-help-property () + "Prints out the help message for the property the cursor is on." + (interactive) + (cmake-command-run "--help-property" (cmake-help-type "property") "*CMake Help*")) + +;;;###autoload +(defun cmake-help () + "Queries for any of the four available help topics and prints out the approriate page." + (interactive) + (let* ((default-entry (word-at-point)) + (command-list (cmake-get-list "command")) + (variable-list (cmake-get-list "variable")) + (module-list (cmake-get-list "module")) + (property-list (cmake-get-list "property")) + (all-words (append command-list variable-list module-list property-list)) + (input (completing-read + "CMake command/module/variable/property: " ; prompt + all-words ; completions + nil ; predicate + t ; require-match + default-entry ; initial-input + 'cmake-help-complete-history + ))) + (if (string= input "") + (error "No argument given") + (if (member input command-list) + (cmake-command-run "--help-command" input "*CMake Help*") + (if (member input variable-list) + (cmake-command-run "--help-variable" input "*CMake Help*") + (if (member input module-list) + (cmake-command-run "--help-module" input "*CMake Help*") + (if (member input property-list) + (cmake-command-run "--help-property" input "*CMake Help*") + (error "Not a know help topic.") ; this really should not happen + )))))) + ) ;;;###autoload (progn diff --git a/Modules/Platform/Linux-Intel-C.cmake b/Modules/Platform/Linux-Intel-C.cmake index d1694d6..449493a 100644 --- a/Modules/Platform/Linux-Intel-C.cmake +++ b/Modules/Platform/Linux-Intel-C.cmake @@ -1,2 +1,3 @@ include(Platform/Linux-Intel) __linux_compiler_intel(C) +set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ") diff --git a/Modules/Platform/Linux-Intel-CXX.cmake b/Modules/Platform/Linux-Intel-CXX.cmake index 66df3ac..142b6cf 100644 --- a/Modules/Platform/Linux-Intel-CXX.cmake +++ b/Modules/Platform/Linux-Intel-CXX.cmake @@ -1,2 +1,3 @@ include(Platform/Linux-Intel) __linux_compiler_intel(CXX) +set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ") 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; } |