diff options
Diffstat (limited to 'Source')
42 files changed, 153 insertions, 136 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index cfbeab3..1894b69 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 3) -set(CMake_VERSION_PATCH 20150824) +set(CMake_VERSION_PATCH 20150827) #set(CMake_VERSION_RC 1) diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx index 09e123c..43d34ee 100644 --- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx +++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx @@ -191,7 +191,7 @@ int cmCPackIFWGenerator::PackageFiles() } } // TODO: set correct name for multipackages - if (this->packageFileNames.size() > 0) + if (!this->packageFileNames.empty()) { ifwCmd += " " + packageFileNames[0]; } diff --git a/Source/CPack/OSXScriptLauncher.cxx b/Source/CPack/OSXScriptLauncher.cxx index 1d7afbd..c271517 100644 --- a/Source/CPack/OSXScriptLauncher.cxx +++ b/Source/CPack/OSXScriptLauncher.cxx @@ -11,17 +11,18 @@ ============================================================================*/ #include <cmsys/SystemTools.hxx> #include <cmsys/Process.h> -#include <cmsys/ios/iostream> #include <cmsys/FStream.hxx> +#include <iostream> + #include <CoreFoundation/CoreFoundation.h> // For the PATH_MAX constant #include <sys/syslimits.h> #define DebugError(x) \ - ofs << x << cmsys_ios::endl; \ - cmsys_ios::cout << x << cmsys_ios::endl + ofs << x << std::endl; \ + std::cout << x << std::endl int main(int argc, char* argv[]) { @@ -77,7 +78,7 @@ int main(int argc, char* argv[]) std::string scriptDirectory = cmsys::SystemTools::GetFilenamePath( fullScriptPath); - ofs << fullScriptPath.c_str() << cmsys_ios::endl; + ofs << fullScriptPath.c_str() << std::endl; std::vector<const char*> args; args.push_back(fullScriptPath.c_str()); int cc; @@ -109,7 +110,7 @@ int main(int argc, char* argv[]) data[i] = ' '; } } - cmsys_ios::cout.write(data, length); + std::cout.write(data, length); } cmsysProcess_WaitForExit(cp, 0); diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index b3eb7b2..6f25e50 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -217,7 +217,7 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration() { std::string defaultRef = "WixUI_InstallDir"; - if(this->Components.size()) + if(!this->Components.empty()) { defaultRef = "WixUI_FeatureTree"; } @@ -1005,7 +1005,7 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitons( shortcut.workingDirectoryId = directoryId; shortcuts.insert(cmWIXShortcuts::START_MENU, id, shortcut); - if(desktopExecutables.size() && + if(!desktopExecutables.empty() && std::find(desktopExecutables.begin(), desktopExecutables.end(), executableName) diff --git a/Source/CPack/WiX/cmWIXAccessControlList.cxx b/Source/CPack/WiX/cmWIXAccessControlList.cxx index aeec968..fc0d3d3 100644 --- a/Source/CPack/WiX/cmWIXAccessControlList.cxx +++ b/Source/CPack/WiX/cmWIXAccessControlList.cxx @@ -71,7 +71,7 @@ void cmWIXAccessControlList::CreatePermissionElement( this->SourceWriter.BeginElement("Permission"); this->SourceWriter.AddAttribute("User", user); - if(domain.size()) + if(!domain.empty()) { this->SourceWriter.AddAttribute("Domain", domain); } diff --git a/Source/CPack/WiX/cmWIXPatch.cxx b/Source/CPack/WiX/cmWIXPatch.cxx index b5202e0..5a8dc63 100644 --- a/Source/CPack/WiX/cmWIXPatch.cxx +++ b/Source/CPack/WiX/cmWIXPatch.cxx @@ -79,7 +79,7 @@ bool cmWIXPatch::CheckForUnappliedFragments() fragmentList += "'"; } - if(fragmentList.size()) + if(!fragmentList.empty()) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Some XML patch fragments did not have matching IDs: " << diff --git a/Source/CPack/WiX/cmWIXSourceWriter.cxx b/Source/CPack/WiX/cmWIXSourceWriter.cxx index 219fca8..8d38e9b 100644 --- a/Source/CPack/WiX/cmWIXSourceWriter.cxx +++ b/Source/CPack/WiX/cmWIXSourceWriter.cxx @@ -128,7 +128,7 @@ void cmWIXSourceWriter::AddAttribute( void cmWIXSourceWriter::AddAttributeUnlessEmpty( std::string const& key, std::string const& value) { - if(value.size()) + if(!value.empty()) { AddAttribute(key, value); } diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index 2de2bc4..6cdda28 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -49,7 +49,7 @@ int cmCPackNSISGenerator::PackageFiles() // TODO: Fix nsis to force out file name std::string nsisInFileName = this->FindTemplate("NSIS.template.in"); - if ( nsisInFileName.size() == 0 ) + if (nsisInFileName.empty()) { cmCPackLogger(cmCPackLog::LOG_ERROR, "CPack error: Could not find NSIS installer template file." @@ -58,7 +58,7 @@ int cmCPackNSISGenerator::PackageFiles() } std::string nsisInInstallOptions = this->FindTemplate("NSIS.InstallOptions.ini.in"); - if ( nsisInInstallOptions.size() == 0 ) + if (nsisInInstallOptions.empty()) { cmCPackLogger(cmCPackLog::LOG_ERROR, "CPack error: Could not find NSIS installer options file." @@ -536,7 +536,7 @@ int cmCPackNSISGenerator::InitializeInternal() << ".lnk\"" << std::endl; // see if CPACK_CREATE_DESKTOP_LINK_ExeName is on // if so add a desktop link - if(cpackPackageDesktopLinksVector.size() && + if(!cpackPackageDesktopLinksVector.empty() && std::find(cpackPackageDesktopLinksVector.begin(), cpackPackageDesktopLinksVector.end(), execName) diff --git a/Source/CPack/cmCPackSTGZGenerator.cxx b/Source/CPack/cmCPackSTGZGenerator.cxx index e5da5cf..109dcb7 100644 --- a/Source/CPack/cmCPackSTGZGenerator.cxx +++ b/Source/CPack/cmCPackSTGZGenerator.cxx @@ -19,7 +19,6 @@ #include "cmMakefile.h" #include "cmCPackLog.h" -#include <cmsys/ios/sstream> #include <cmsys/FStream.hxx> #include <sys/types.h> #include <sys/stat.h> @@ -85,7 +84,7 @@ int cmCPackSTGZGenerator::PackageFiles() int cmCPackSTGZGenerator::GenerateHeader(std::ostream* os) { cmCPackLogger(cmCPackLog::LOG_DEBUG, "Writing header" << std::endl); - cmsys_ios::ostringstream str; + std::ostringstream str; int counter = 0; std::string inLicFile = this->GetOption("CPACK_RESOURCE_FILE_LICENSE"); diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index 65599e0..20807c8 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -27,8 +27,6 @@ #include <cmsys/Process.h> #include <cmsys/RegularExpression.hxx> #include <cmsys/Glob.hxx> -#include <cmsys/stl/iterator> -#include <cmsys/stl/algorithm> #include <cmsys/FStream.hxx> #include <stdlib.h> diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx index 6b84bab..5b9208a 100644 --- a/Source/CTest/cmCTestGIT.cxx +++ b/Source/CTest/cmCTestGIT.cxx @@ -17,7 +17,6 @@ #include "cmXMLSafe.h" #include <cmsys/RegularExpression.hxx> -#include <cmsys/ios/sstream> #include <cmsys/Process.h> #include <cmsys/FStream.hxx> diff --git a/Source/CTest/cmCTestP4.cxx b/Source/CTest/cmCTestP4.cxx index 31002a6..5ce431a 100644 --- a/Source/CTest/cmCTestP4.cxx +++ b/Source/CTest/cmCTestP4.cxx @@ -16,7 +16,6 @@ #include "cmXMLSafe.h" #include <cmsys/RegularExpression.hxx> -#include <cmsys/ios/sstream> #include <cmsys/Process.h> #include <sys/types.h> diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index 44d0d4e..9f56324 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -13,7 +13,6 @@ #include "cmSystemTools.h" #include "cmLocale.h" -#include <cmsys/ios/iostream> #include <cmsys/Directory.hxx> #include <cmsys/FStream.hxx> #include <cm_libarchive.h> @@ -67,7 +66,7 @@ struct cmArchiveWrite::Callback { cmArchiveWrite* self = static_cast<cmArchiveWrite*>(cd); if(self->Stream.write(static_cast<const char*>(b), - static_cast<cmsys_ios::streamsize>(n))) + static_cast<std::streamsize>(n))) { return static_cast<__LA_SSIZE_T>(n); } @@ -90,49 +89,49 @@ cmArchiveWrite::cmArchiveWrite( switch (c) { case CompressNone: - if(archive_write_set_compression_none(this->Archive) != ARCHIVE_OK) + if(archive_write_add_filter_none(this->Archive) != ARCHIVE_OK) { - this->Error = "archive_write_set_compression_none: "; + this->Error = "archive_write_add_filter_none: "; this->Error += cm_archive_error_string(this->Archive); return; } break; case CompressCompress: - if(archive_write_set_compression_compress(this->Archive) != ARCHIVE_OK) + if(archive_write_add_filter_compress(this->Archive) != ARCHIVE_OK) { - this->Error = "archive_write_set_compression_compress: "; + this->Error = "archive_write_add_filter_compress: "; this->Error += cm_archive_error_string(this->Archive); return; } break; case CompressGZip: - if(archive_write_set_compression_gzip(this->Archive) != ARCHIVE_OK) + if(archive_write_add_filter_gzip(this->Archive) != ARCHIVE_OK) { - this->Error = "archive_write_set_compression_gzip: "; + this->Error = "archive_write_add_filter_gzip: "; this->Error += cm_archive_error_string(this->Archive); return; } break; case CompressBZip2: - if(archive_write_set_compression_bzip2(this->Archive) != ARCHIVE_OK) + if(archive_write_add_filter_bzip2(this->Archive) != ARCHIVE_OK) { - this->Error = "archive_write_set_compression_bzip2: "; + this->Error = "archive_write_add_filter_bzip2: "; this->Error += cm_archive_error_string(this->Archive); return; } break; case CompressLZMA: - if(archive_write_set_compression_lzma(this->Archive) != ARCHIVE_OK) + if(archive_write_add_filter_lzma(this->Archive) != ARCHIVE_OK) { - this->Error = "archive_write_set_compression_lzma: "; + this->Error = "archive_write_add_filter_lzma: "; this->Error += cm_archive_error_string(this->Archive); return; } break; case CompressXZ: - if(archive_write_set_compression_xz(this->Archive) != ARCHIVE_OK) + if(archive_write_add_filter_xz(this->Archive) != ARCHIVE_OK) { - this->Error = "archive_write_set_compression_xz: "; + this->Error = "archive_write_add_filter_xz: "; this->Error += cm_archive_error_string(this->Archive); return; } @@ -177,8 +176,8 @@ cmArchiveWrite::cmArchiveWrite( //---------------------------------------------------------------------------- cmArchiveWrite::~cmArchiveWrite() { - archive_read_finish(this->Disk); - archive_write_finish(this->Archive); + archive_read_free(this->Disk); + archive_write_free(this->Archive); } //---------------------------------------------------------------------------- @@ -313,7 +312,7 @@ bool cmArchiveWrite::AddFile(const char* file, //---------------------------------------------------------------------------- bool cmArchiveWrite::AddData(const char* file, size_t size) { - cmsys::ifstream fin(file, std::ios::in | cmsys_ios_binary); + cmsys::ifstream fin(file, std::ios::in | std::ios::binary); if(!fin) { this->Error = "Error opening \""; @@ -327,7 +326,7 @@ bool cmArchiveWrite::AddData(const char* file, size_t size) size_t nleft = size; while(nleft > 0) { - typedef cmsys_ios::streamsize ssize_type; + typedef std::streamsize ssize_type; size_t const nnext = nleft > sizeof(buffer)? sizeof(buffer) : nleft; ssize_type const nnext_s = static_cast<ssize_type>(nnext); fin.read(buffer, nnext_s); diff --git a/Source/cmCMakeHostSystemInformationCommand.cxx b/Source/cmCMakeHostSystemInformationCommand.cxx index 5234538..6ff7c0d 100644 --- a/Source/cmCMakeHostSystemInformationCommand.cxx +++ b/Source/cmCMakeHostSystemInformationCommand.cxx @@ -11,8 +11,6 @@ ============================================================================*/ #include "cmCMakeHostSystemInformationCommand.h" -#include <cmsys/ios/sstream> - // cmCMakeHostSystemInformation bool cmCMakeHostSystemInformationCommand ::InitialPass(std::vector<std::string> const &args, cmExecutionStatus &) @@ -107,7 +105,7 @@ bool cmCMakeHostSystemInformationCommand std::string cmCMakeHostSystemInformationCommand ::ValueToString(size_t value) const { - cmsys_ios::stringstream tmp; + std::stringstream tmp; tmp << value; return tmp.str(); } diff --git a/Source/cmCallVisualStudioMacro.cxx b/Source/cmCallVisualStudioMacro.cxx index c211111..0e04838 100644 --- a/Source/cmCallVisualStudioMacro.cxx +++ b/Source/cmCallVisualStudioMacro.cxx @@ -498,7 +498,7 @@ int cmCallVisualStudioMacro::CallMacro( } } - if(0 == instances.size()) + if(instances.empty()) { // no instances to call diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index 8ba8847..59590fd 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -18,8 +18,6 @@ #include "cmake.h" #include "cmAlgorithms.h" -#include <cmsys/stl/algorithm> - #include <assert.h> /* diff --git a/Source/cmCryptoHash.cxx b/Source/cmCryptoHash.cxx index 74e17b6..6616218 100644 --- a/Source/cmCryptoHash.cxx +++ b/Source/cmCryptoHash.cxx @@ -46,7 +46,7 @@ std::string cmCryptoHash::HashString(const std::string& input) //---------------------------------------------------------------------------- std::string cmCryptoHash::HashFile(const std::string& file) { - cmsys::ifstream fin(file.c_str(), std::ios::in | cmsys_ios_binary); + cmsys::ifstream fin(file.c_str(), std::ios::in | std::ios::binary); if(!fin) { return ""; diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx index 0a66732..e8d158e 100644 --- a/Source/cmFindLibraryCommand.cxx +++ b/Source/cmFindLibraryCommand.cxx @@ -11,7 +11,6 @@ ============================================================================*/ #include "cmFindLibraryCommand.h" #include <cmsys/Directory.hxx> -#include <cmsys/stl/algorithm> cmFindLibraryCommand::cmFindLibraryCommand() { diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 68a6558..9b9071d 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -1378,7 +1378,7 @@ void cmFindPackageCommand::LoadPackageRegistryDir(std::string const& dir, cmFindPackageCommandHoldFile holdFile(fname.c_str()); // Load the file. - cmsys::ifstream fin(fname.c_str(), std::ios::in | cmsys_ios_binary); + cmsys::ifstream fin(fname.c_str(), std::ios::in | std::ios::binary); std::string fentry; if(fin && cmSystemTools::GetLineFromStream(fin, fentry) && this->CheckPackageRegistryEntry(fentry, outPaths)) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 503c455..be7896d 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -2041,24 +2041,37 @@ void cmGlobalGenerator::SetConfiguredFilesPath(cmGlobalGenerator* gen) } } -bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root, - cmLocalGenerator* gen) const +bool cmGlobalGenerator::IsExcluded(cmState::Snapshot const& rootSnp, + cmState::Snapshot const& snp_) const { - if(!gen || gen == root) + cmState::Snapshot snp = snp_; + while (snp.IsValid()) { - // No directory excludes itself. - return false; - } + if(snp == rootSnp) + { + // No directory excludes itself. + return false; + } - if(gen->GetMakefile()->GetPropertyAsBool("EXCLUDE_FROM_ALL")) - { - // This directory is excluded from its parent. - return true; + if(snp.GetDirectory().GetPropertyAsBool("EXCLUDE_FROM_ALL")) + { + // This directory is excluded from its parent. + return true; + } + snp = snp.GetBuildsystemDirectoryParent(); } + return false; +} + +bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root, + cmLocalGenerator* gen) const +{ + assert(gen); + + cmState::Snapshot rootSnp = root->GetStateSnapshot(); + cmState::Snapshot snp = gen->GetStateSnapshot(); - // This directory is included in its parent. Check whether the - // parent is excluded. - return this->IsExcluded(root, gen->GetParent()); + return this->IsExcluded(rootSnp, snp); } bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root, @@ -2070,12 +2083,9 @@ bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root, // This target is excluded from its directory. return true; } - else - { - // This target is included in its directory. Check whether the - // directory is excluded. - return this->IsExcluded(root, target->GetLocalGenerator()); - } + // This target is included in its directory. Check whether the + // directory is excluded. + return this->IsExcluded(root, target->GetLocalGenerator()); } void diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index fe710f1..23501bc 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -396,6 +396,8 @@ protected: // has been populated. void FillProjectMap(); void CheckLocalGenerators(); + bool IsExcluded(cmState::Snapshot const& root, + cmState::Snapshot const& snp) const; bool IsExcluded(cmLocalGenerator* root, cmLocalGenerator* gen) const; bool IsExcluded(cmLocalGenerator* root, cmGeneratorTarget* target) const; virtual void InitializeProgressMarks() {} diff --git a/Source/cmGlobalMSYSMakefileGenerator.cxx b/Source/cmGlobalMSYSMakefileGenerator.cxx index a84923b..9a6f3ba 100644 --- a/Source/cmGlobalMSYSMakefileGenerator.cxx +++ b/Source/cmGlobalMSYSMakefileGenerator.cxx @@ -62,19 +62,19 @@ void cmGlobalMSYSMakefileGenerator locations.push_back("c:/mingw/bin"); std::string tgcc = cmSystemTools::FindProgram("gcc", locations); std::string gcc = "gcc.exe"; - if(tgcc.size()) + if(!tgcc.empty()) { gcc = tgcc; } std::string tgxx = cmSystemTools::FindProgram("g++", locations); std::string gxx = "g++.exe"; - if(tgxx.size()) + if(!tgxx.empty()) { gxx = tgxx; } std::string trc = cmSystemTools::FindProgram("windres", locations); std::string rc = "windres.exe"; - if(trc.size()) + if(!trc.empty()) { rc = trc; } diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index fd7c768..92bef67 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -936,14 +936,25 @@ void cmGlobalUnixMakefileGenerator3::InitializeProgressMarks() cmGeneratorTarget* gt = this->GetGeneratorTarget(&target); + cmLocalGenerator* tlg = gt->GetLocalGenerator(); + + if(gt->GetType() == cmTarget::INTERFACE_LIBRARY + || gt->Target->GetPropertyAsBool("EXCLUDE_FROM_ALL")) + { + continue; + } + + cmState::Snapshot csnp = lg->GetStateSnapshot(); + cmState::Snapshot tsnp = tlg->GetStateSnapshot(); + // Consider the directory containing the target and all its // parents until something excludes the target. - for(cmLocalGenerator* clg = lg; clg && !this->IsExcluded(clg, gt); - clg = clg->GetParent()) + for( ; csnp.IsValid() && !this->IsExcluded(csnp, tsnp); + csnp = csnp.GetBuildsystemDirectoryParent()) { // This local generator includes the target. std::set<cmGeneratorTarget const*>& targetSet = - this->DirectoryTargetsMap[clg->GetStateSnapshot()]; + this->DirectoryTargetsMap[csnp]; targetSet.insert(gt); // Add dependencies of the included target. An excluded diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx index 65a15ee..b7c897c 100644 --- a/Source/cmGlobalVisualStudio6Generator.cxx +++ b/Source/cmGlobalVisualStudio6Generator.cxx @@ -255,7 +255,7 @@ void cmGlobalVisualStudio6Generator ::OutputDSWFile(cmLocalGenerator* root, std::vector<cmLocalGenerator*>& generators) { - if(generators.size() == 0) + if(generators.empty()) { return; } diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index 1ab4c9c..607642c 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -212,7 +212,7 @@ cmGlobalVisualStudio71Generator { const char* name = di->c_str(); std::string guid = this->GetGUID(name); - if(guid.size() == 0) + if(guid.empty()) { std::string m = "Target: "; m += target.GetName(); @@ -250,7 +250,7 @@ void cmGlobalVisualStudio71Generator std::set<std::string>::const_iterator it; for(it = depends.begin(); it != depends.end(); ++it) { - if(it->size() > 0) + if(!it->empty()) { fout << "\t\t{" << this->GetGUID(it->c_str()) diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index f8d882c..2660d23 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -359,7 +359,7 @@ void cmGlobalVisualStudio7Generator ::OutputSLNFile(cmLocalGenerator* root, std::vector<cmLocalGenerator*>& generators) { - if(generators.size() == 0) + if(generators.empty()) { return; } @@ -736,7 +736,7 @@ cmGlobalVisualStudio7Generator { const char* name = di->c_str(); std::string guid = this->GetGUID(name); - if(guid.size() == 0) + if(guid.empty()) { std::string m = "Target: "; m += target.GetName(); diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index c38a35a..b0aa243 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -81,7 +81,7 @@ bool cmGlobalVisualStudioGenerator::Compute() { std::vector<cmLocalGenerator*>& gen = it->second; // add the ALL_BUILD to the first local generator of each project - if(gen.size()) + if(!gen.empty()) { // Use no actual command lines so that the target itself is not // considered always out of date. @@ -265,7 +265,7 @@ cmGlobalVisualStudioGenerator { std::vector<std::string> filenames; this->GetFilesReplacedDuringGenerate(filenames); - if (filenames.size() > 0) + if (!filenames.empty()) { // Convert vector to semi-colon delimited string of filenames: std::string projects; diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 39933cb..4ba29f5 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -772,7 +772,7 @@ cmGlobalXCodeGenerator::CreateXCodeSourceFile(cmLocalGenerator* lg, sf->GetProperty("COMPILE_DEFINITIONS"), true); if (!flagsBuild.IsEmpty()) { - if (flags.size()) + if (!flags.empty()) { flags += ' '; } @@ -1874,7 +1874,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, { extraLinkOptionsVar = "CMAKE_MODULE_LINKER_FLAGS"; } - if(extraLinkOptionsVar.size()) + if(!extraLinkOptionsVar.empty()) { this->CurrentLocalGenerator ->AddConfigVariableFlags(extraLinkOptions, @@ -2614,7 +2614,7 @@ std::string cmGlobalXCodeGenerator::AddConfigurations(cmXCodeObject* target, config->SetComment(configVector[i].c_str()); config->AddAttribute("buildSettings", buildSettings); } - if(configVector.size()) + if(!configVector.empty()) { configlist->AddAttribute("defaultConfigurationName", this->CreateString(configVector[0].c_str())); diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index b3fe3b0..1e8fd3e 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2364,25 +2364,22 @@ void cmLocalGenerator::AppendFeatureOptions( const char* cmLocalGenerator::GetFeature(const std::string& feature, const std::string& config) { + std::string featureName = feature; // TODO: Define accumulation policy for features (prepend, append, replace). // Currently we always replace. if(!config.empty()) { - std::string featureConfig = feature; - featureConfig += "_"; - featureConfig += cmSystemTools::UpperCase(config); - if(const char* value = this->Makefile->GetProperty(featureConfig)) + featureName += "_"; + featureName += cmSystemTools::UpperCase(config); + } + cmState::Snapshot snp = this->StateSnapshot; + while(snp.IsValid()) + { + if(const char* value = snp.GetDirectory().GetProperty(featureName)) { return value; } - } - if(const char* value = this->Makefile->GetProperty(feature)) - { - return value; - } - if(cmLocalGenerator* parent = this->GetParent()) - { - return parent->GetFeature(feature, config); + snp = snp.GetBuildsystemDirectoryParent(); } return 0; } diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx index 9ded83a..9e3185c 100644 --- a/Source/cmLocalVisualStudio10Generator.cxx +++ b/Source/cmLocalVisualStudio10Generator.cxx @@ -33,7 +33,7 @@ class cmVS10XMLParser : public cmXMLParser virtual void StartElement(const std::string& name, const char**) { // once the GUID is found do nothing - if(this->GUID.size()) + if(!this->GUID.empty()) { return; } diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index 29e1034..0d07536 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -984,11 +984,11 @@ void cmLocalVisualStudio6Generator std::string libMultiLineDebugOptions; std::string libMultiLineOptimizedOptions; - if(libPath.size()) + if(!libPath.empty()) { std::string lpath = this->ConvertToOutputFormat(libPath.c_str(), SHELL); - if(lpath.size() == 0) + if(lpath.empty()) { lpath = "."; } @@ -1017,11 +1017,11 @@ void cmLocalVisualStudio6Generator libMultiLineOptionsForDebug += " \n"; } } - if(exePath.size()) + if(!exePath.empty()) { std::string lpath = this->ConvertToOutputFormat(exePath.c_str(), SHELL); - if(lpath.size() == 0) + if(lpath.empty()) { lpath = "."; } @@ -1062,7 +1062,7 @@ void cmLocalVisualStudio6Generator } std::string lpath = this->ConvertToOutputFormat(path.c_str(), SHELL); - if(lpath.size() == 0) + if(lpath.empty()) { lpath = "."; } @@ -1452,7 +1452,7 @@ void cmLocalVisualStudio6Generator #ifdef CM_USE_OLD_VS6 // Compute link information for the target. - if(extraLinkOptions.size()) + if(!extraLinkOptions.empty()) { libOptions += " "; libOptions += extraLinkOptions; @@ -1543,7 +1543,7 @@ void cmLocalVisualStudio6Generator std::string line; std::string libnameExports; - if(exportSymbol.size()) + if(!exportSymbol.empty()) { libnameExports = "/D \""; libnameExports += exportSymbol; diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index a38a061..5de6d37 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -2283,7 +2283,7 @@ public: virtual void StartElement(const std::string& name, const char** atts) { // once the GUID is found do nothing - if(this->GUID.size()) + if(!this->GUID.empty()) { return; } @@ -2331,7 +2331,7 @@ void cmLocalVisualStudio7Generator::ReadAndStoreExternalGUID( cmVS7XMLParser parser; parser.ParseFile(path); // if we can not find a GUID then we will generate one later - if(parser.GUID.size() == 0) + if(parser.GUID.empty()) { return; } diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 4eb9b13..f85e70e 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -26,7 +26,6 @@ #include <sys/stat.h> #include <cmsys/Terminal.h> -#include <cmsys/ios/sstream> #include <cmsys/FStream.hxx> #include <assert.h> @@ -122,7 +121,7 @@ static void copyTargetProperty(cmTarget* destinationTarget, static std::string ReadAll(const std::string& filename) { cmsys::ifstream file(filename.c_str()); - cmsys_ios::stringstream stream; + std::stringstream stream; stream << file.rdbuf(); file.close(); return stream.str(); @@ -1640,7 +1639,7 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile) this->GenerateQrc(); } - cmsys_ios::stringstream outStream; + std::stringstream outStream; outStream << "/* This file is autogenerated, do not edit*/\n"; bool automocCppChanged = false; diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index a9796b9..468a589 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -33,14 +33,6 @@ // Provide fixed-size integer types. #include <cmIML/INT.h> -// Include stream compatibility layer from KWSys. -// This is needed to work with large file support -// on some platforms whose stream operators do not -// support the large integer types. -#if defined(CMAKE_BUILD_WITH_CMAKE) -# include <cmsys/IOStream.hxx> -#endif - #include <fstream> #include <iostream> #include <iomanip> diff --git a/Source/cmState.cxx b/Source/cmState.cxx index 3df855a..a401265 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -1711,3 +1711,13 @@ std::vector<std::string> cmState::Directory::GetPropertyKeys() const } return keys; } + +bool operator==(const cmState::Snapshot& lhs, const cmState::Snapshot& rhs) +{ + return lhs.Position == rhs.Position; +} + +bool operator!=(const cmState::Snapshot& lhs, const cmState::Snapshot& rhs) +{ + return lhs.Position != rhs.Position; +} diff --git a/Source/cmState.h b/Source/cmState.h index a488c62..3099384 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -95,6 +95,10 @@ public: }; private: + friend bool operator==(const cmState::Snapshot& lhs, + const cmState::Snapshot& rhs); + friend bool operator!=(const cmState::Snapshot& lhs, + const cmState::Snapshot& rhs); friend class cmState; friend class Directory; friend struct StrictWeakOrder; @@ -316,4 +320,7 @@ private: bool MSYSShell; }; +bool operator==(const cmState::Snapshot& lhs, const cmState::Snapshot& rhs); +bool operator!=(const cmState::Snapshot& lhs, const cmState::Snapshot& rhs); + #endif diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index a117238..3f03b51 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -30,7 +30,6 @@ # include "cmLocale.h" # include <cm_libarchive.h> #endif -#include <cmsys/stl/algorithm> #include <cmsys/FStream.hxx> #include <cmsys/Terminal.h> @@ -1482,7 +1481,7 @@ bool cmSystemTools::CreateTar(const char* outFileName, { #if defined(CMAKE_BUILD_WITH_CMAKE) std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); - cmsys::ofstream fout(outFileName, std::ios::out | cmsys_ios_binary); + cmsys::ofstream fout(outFileName, std::ios::out | std::ios::binary); if(!fout) { std::string e = "Cannot open output file \""; @@ -1705,7 +1704,7 @@ bool extract_tar(const char* outFileName, bool verbose, static_cast<void>(localeRAII); struct archive* a = archive_read_new(); struct archive *ext = archive_write_disk_new(); - archive_read_support_compression_all(a); + archive_read_support_filter_all(a); archive_read_support_format_all(a); struct archive_entry *entry; int r = cm_archive_read_open_file(a, outFileName, 10240); @@ -1792,7 +1791,7 @@ bool extract_tar(const char* outFileName, bool verbose, } archive_write_free(ext); archive_read_close(a); - archive_read_finish(a); + archive_read_free(a); return r == ARCHIVE_EOF || r == ARCHIVE_OK; } } diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 80b8591..823b550 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -1656,7 +1656,7 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( // for the first time we need a new line if there is something // produced here. const char* firstString = ">\n"; - if(objectName.size()) + if(!objectName.empty()) { (*this->BuildFileStream ) << firstString; firstString = ""; @@ -1675,7 +1675,7 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( defPropName += configUpper; if(const char* ccdefs = sf.GetProperty(defPropName.c_str())) { - if(configDefines.size()) + if(!configDefines.empty()) { configDefines += ";"; } @@ -2422,7 +2422,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config) libs = this->Makefile->GetSafeDefinition(standardLibsVar.c_str()); // Remove trailing spaces from libs std::string::size_type pos = libs.size()-1; - if(libs.size() != 0) + if(!libs.empty()) { while(libs[pos] == ' ') { @@ -2783,7 +2783,7 @@ void cmVisualStudio10TargetGenerator::WriteEvent( std::vector<cmCustomCommand> const& commands, std::string const& configName) { - if(commands.size() == 0) + if(commands.empty()) { return; } diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx index abd350e..bd4eb69 100644 --- a/Source/cmVisualStudioGeneratorOptions.cxx +++ b/Source/cmVisualStudioGeneratorOptions.cxx @@ -274,7 +274,7 @@ cmVisualStudioGeneratorOptions { // if there are configuration specific flags, then // use the configuration specific tag for PreprocessorDefinitions - if(this->Configuration.size()) + if(!this->Configuration.empty()) { fout << prefix; this->TargetGenerator->WritePlatformConfigTag( @@ -346,7 +346,7 @@ cmVisualStudioGeneratorOptions m != this->FlagMap.end(); ++m) { fout << indent; - if(this->Configuration.size()) + if(!this->Configuration.empty()) { this->TargetGenerator->WritePlatformConfigTag( m->first.c_str(), @@ -398,7 +398,7 @@ cmVisualStudioGeneratorOptions if(this->Version >= cmGlobalVisualStudioGenerator::VS10) { fout << prefix; - if(this->Configuration.size()) + if(!this->Configuration.empty()) { this->TargetGenerator->WritePlatformConfigTag( "AdditionalOptions", diff --git a/Source/cmXCode21Object.cxx b/Source/cmXCode21Object.cxx index f30f700..3973540 100644 --- a/Source/cmXCode21Object.cxx +++ b/Source/cmXCode21Object.cxx @@ -22,7 +22,7 @@ cmXCode21Object::cmXCode21Object(PBXType ptype, Type type) //---------------------------------------------------------------------------- void cmXCode21Object::PrintComment(std::ostream& out) { - if(this->Comment.size() == 0) + if(this->Comment.empty()) { cmXCodeObject* n = this->GetObject("name"); if(n) diff --git a/Source/cmXMLSafe.cxx b/Source/cmXMLSafe.cxx index 99f5625..4ad05ca 100644 --- a/Source/cmXMLSafe.cxx +++ b/Source/cmXMLSafe.cxx @@ -13,8 +13,8 @@ #include "cm_utf8.h" -#include <cmsys/ios/iostream> -#include <cmsys/ios/sstream> +#include <iostream> +#include <sstream> #include <string.h> #include <stdio.h> @@ -45,13 +45,13 @@ cmXMLSafe& cmXMLSafe::Quotes(bool b) //---------------------------------------------------------------------------- std::string cmXMLSafe::str() { - cmsys_ios::ostringstream ss; + std::ostringstream ss; ss << *this; return ss.str(); } //---------------------------------------------------------------------------- -cmsys_ios::ostream& operator<<(cmsys_ios::ostream& os, cmXMLSafe const& self) +std::ostream& operator<<(std::ostream& os, cmXMLSafe const& self) { char const* first = self.Data; char const* last = self.Data + self.Size; diff --git a/Source/cmXMLSafe.h b/Source/cmXMLSafe.h index c23a90c..ead2e01 100644 --- a/Source/cmXMLSafe.h +++ b/Source/cmXMLSafe.h @@ -12,8 +12,9 @@ #ifndef cmXMLSafe_h #define cmXMLSafe_h -#include <cmsys/stl/string> -#include <cmsys/ios/iosfwd> +#include <cmsys/Configure.hxx> +#include <string> +#include <iosfwd> /** \class cmXMLSafe * \brief Write strings to XML with proper escapes @@ -37,8 +38,7 @@ private: char const* Data; unsigned long Size; bool DoQuotes; - friend cmsys_ios::ostream& operator<<(cmsys_ios::ostream&, - cmXMLSafe const&); + friend std::ostream& operator<<(std::ostream&, cmXMLSafe const&); }; #endif |