From aaf59120bfd77a960317923da30e1a70ce0d8aae Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Fri, 23 Aug 2019 16:17:39 +0200 Subject: Source sweep: Replace cmExpandList with the shorter cmExpandedList This replaces the code pattern ``` std::vector args; cmExpandList(valueStr, args, ...) ``` with ``` std::vector args = cmExpandedList(valueStr, ...) ``` --- Source/CPack/IFW/cmCPackIFWCommon.cxx | 6 ++-- Source/CPack/IFW/cmCPackIFWGenerator.cxx | 3 +- Source/CPack/IFW/cmCPackIFWPackage.cxx | 3 +- Source/CPack/WiX/cmCPackWIXGenerator.cxx | 14 +++----- Source/CPack/cmCPackBundleGenerator.cxx | 3 +- Source/CPack/cmCPackDebGenerator.cxx | 3 +- Source/CPack/cmCPackDragNDropGenerator.cxx | 4 +-- Source/CPack/cmCPackFreeBSDGenerator.cxx | 12 +++---- Source/CPack/cmCPackGenerator.cxx | 34 +++++++++--------- Source/CPack/cmCPackNSISGenerator.cxx | 8 ++--- Source/CPack/cmCPackOSXX11Generator.cxx | 4 +-- Source/CPack/cpack.cxx | 3 +- Source/CTest/cmCTestGIT.cxx | 3 +- Source/CTest/cmCTestP4.cxx | 3 +- Source/CTest/cmCTestScriptHandler.cxx | 9 ++--- Source/CTest/cmCTestSubmitCommand.cxx | 6 ++-- Source/CTest/cmCTestSubmitHandler.cxx | 6 ++-- Source/CTest/cmCTestTestHandler.cxx | 33 ++++++----------- .../CursesDialog/cmCursesCacheEntryComposite.cxx | 3 +- Source/cmCTest.cxx | 6 ++-- Source/cmCacheManager.cxx | 3 +- Source/cmComputeLinkDepends.cxx | 3 +- Source/cmComputeLinkInformation.cxx | 15 +++----- Source/cmConditionEvaluator.cxx | 3 +- Source/cmCoreTryCompile.cxx | 3 +- Source/cmExportBuildAndroidMKGenerator.cxx | 7 ++-- Source/cmExportFileGenerator.cxx | 3 +- Source/cmExportTryCompileFileGenerator.cxx | 3 +- Source/cmExtraEclipseCDT4Generator.cxx | 15 +++----- Source/cmExtraSublimeTextGenerator.cxx | 3 +- Source/cmFileCopier.cxx | 4 +-- Source/cmGeneratorExpressionNode.cxx | 9 ++--- Source/cmGeneratorTarget.cxx | 33 ++++++----------- Source/cmGhsMultiTargetGenerator.cxx | 3 +- Source/cmGlobalGenerator.cxx | 10 +++--- Source/cmGlobalGhsMultiGenerator.cxx | 4 +-- Source/cmGlobalVisualStudio7Generator.cxx | 4 +-- Source/cmGlobalXCodeGenerator.cxx | 6 ++-- Source/cmGraphVizWriter.cxx | 4 +-- Source/cmInstallCommand.cxx | 9 ++--- Source/cmLDConfigLDConfigTool.cxx | 3 +- Source/cmListFileCache.cxx | 3 +- Source/cmLocalGenerator.cxx | 36 +++++++------------ Source/cmLocalNinjaGenerator.cxx | 3 +- Source/cmLocalUnixMakefileGenerator3.cxx | 10 +++--- Source/cmLocalVisualStudio7Generator.cxx | 3 +- Source/cmMakefile.cxx | 42 ++++++++-------------- Source/cmMakefileTargetGenerator.cxx | 11 +++--- Source/cmNinjaTargetGenerator.cxx | 3 +- Source/cmOutputRequiredFilesCommand.cxx | 3 +- Source/cmParseArgumentsCommand.cxx | 3 +- Source/cmQtAutoGenInitializer.cxx | 11 +++--- Source/cmQtAutoMocUic.cxx | 7 ++-- Source/cmQtAutoRcc.cxx | 7 ++-- Source/cmSearchPath.cxx | 6 ++-- Source/cmTarget.cxx | 9 ++--- Source/cmTestGenerator.cxx | 3 +- Source/cmTryRunCommand.cxx | 3 +- Source/cmVisualStudio10TargetGenerator.cxx | 4 +-- Source/cmXCodeScheme.cxx | 6 ++-- Source/cmake.cxx | 9 ++--- Source/cmcmd.cxx | 9 ++--- 62 files changed, 186 insertions(+), 318 deletions(-) diff --git a/Source/CPack/IFW/cmCPackIFWCommon.cxx b/Source/CPack/IFW/cmCPackIFWCommon.cxx index 5b1ccbd..f9ce822 100644 --- a/Source/CPack/IFW/cmCPackIFWCommon.cxx +++ b/Source/CPack/IFW/cmCPackIFWCommon.cxx @@ -78,8 +78,7 @@ bool cmCPackIFWCommon::IsVersionEqual(const char* version) void cmCPackIFWCommon::ExpandListArgument( const std::string& arg, std::map& argsOut) { - std::vector args; - cmExpandList(arg, args, false); + std::vector args = cmExpandedList(arg, false); if (args.empty()) { return; } @@ -100,8 +99,7 @@ void cmCPackIFWCommon::ExpandListArgument( void cmCPackIFWCommon::ExpandListArgument( const std::string& arg, std::multimap& argsOut) { - std::vector args; - cmExpandList(arg, args, false); + std::vector args = cmExpandedList(arg, false); if (args.empty()) { return; } diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx index 234da2f..8f13d0e 100644 --- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx +++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx @@ -316,8 +316,7 @@ int cmCPackIFWGenerator::InitializeInternal() // Repositories if (const char* RepoAllStr = this->GetOption("CPACK_IFW_REPOSITORIES_ALL")) { - std::vector RepoAllVector; - cmExpandList(RepoAllStr, RepoAllVector); + std::vector RepoAllVector = cmExpandedList(RepoAllStr); for (std::string const& r : RepoAllVector) { this->GetRepository(r); } diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx index 7407c49..fb75145 100644 --- a/Source/CPack/IFW/cmCPackIFWPackage.cxx +++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx @@ -431,8 +431,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix) if (this->IsSetToEmpty(option)) { this->AlienAutoDependOn.clear(); } else if (const char* value = this->GetOption(option)) { - std::vector depsOn; - cmExpandList(value, depsOn); + std::vector depsOn = cmExpandedList(value); for (std::string const& d : depsOn) { DependenceStruct dep(d); if (this->Generator->Packages.count(dep.Name)) { diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index e960fab..b0b2df2 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -228,8 +228,7 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration() const char* patchFilePath = GetOption("CPACK_WIX_PATCH_FILE"); if (patchFilePath) { - std::vector patchFilePaths; - cmExpandList(patchFilePath, patchFilePaths); + std::vector patchFilePaths = cmExpandedList(patchFilePath); for (std::string const& p : patchFilePaths) { if (!this->Patch->LoadFragments(p)) { @@ -312,9 +311,8 @@ void cmCPackWIXGenerator::AppendUserSuppliedExtraObjects(std::ostream& stream) if (!cpackWixExtraObjects) return; - std::vector expandedExtraObjects; - - cmExpandList(cpackWixExtraObjects, expandedExtraObjects); + std::vector expandedExtraObjects = + cmExpandedList(cpackWixExtraObjects); for (std::string const& obj : expandedExtraObjects) { stream << " " << QuotePath(obj); @@ -1131,8 +1129,7 @@ void cmCPackWIXGenerator::CollectExtensions(std::string const& variableName, if (!variableContent) return; - std::vector list; - cmExpandList(variableContent, list); + std::vector list = cmExpandedList(variableContent); extensions.insert(list.begin(), list.end()); } @@ -1143,8 +1140,7 @@ void cmCPackWIXGenerator::AddCustomFlags(std::string const& variableName, if (!variableContent) return; - std::vector list; - cmExpandList(variableContent, list); + std::vector list = cmExpandedList(variableContent); for (std::string const& i : list) { stream << " " << QuotePath(i); diff --git a/Source/CPack/cmCPackBundleGenerator.cxx b/Source/CPack/cmCPackBundleGenerator.cxx index f58cc0a..371c303 100644 --- a/Source/CPack/cmCPackBundleGenerator.cxx +++ b/Source/CPack/cmCPackBundleGenerator.cxx @@ -204,8 +204,7 @@ int cmCPackBundleGenerator::SignBundle(const std::string& src_dir) ? this->GetOption("CPACK_BUNDLE_APPLE_CODESIGN_FILES") : ""; - std::vector relFiles; - cmExpandList(sign_files, relFiles); + std::vector relFiles = cmExpandedList(sign_files); // sign the files supplied by the user, ie. frameworks. for (auto const& file : relFiles) { diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index db336b0..cefbc90 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -376,8 +376,7 @@ bool DebGenerator::generateControlTar(std::string const& md5Filename) const // default control_tar.ClearPermissions(); - std::vector controlExtraList; - cmExpandList(ControlExtra, controlExtraList); + std::vector controlExtraList = cmExpandedList(ControlExtra); for (std::string const& i : controlExtraList) { std::string filenamename = cmsys::SystemTools::GetFilenameName(i); std::string localcopy = WorkDir + "/" + filenamename; diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx index 2aa0612..ca06b81 100644 --- a/Source/CPack/cmCPackDragNDropGenerator.cxx +++ b/Source/CPack/cmCPackDragNDropGenerator.cxx @@ -128,8 +128,8 @@ int cmCPackDragNDropGenerator::InitializeInternal() return 0; } - std::vector languages; - cmExpandList(this->GetOption("CPACK_DMG_SLA_LANGUAGES"), languages); + std::vector languages = + cmExpandedList(this->GetOption("CPACK_DMG_SLA_LANGUAGES")); if (languages.empty()) { cmCPackLogger(cmCPackLog::LOG_ERROR, "CPACK_DMG_SLA_LANGUAGES set but empty" << std::endl); diff --git a/Source/CPack/cmCPackFreeBSDGenerator.cxx b/Source/CPack/cmCPackFreeBSDGenerator.cxx index b90a27c..a35977c 100644 --- a/Source/CPack/cmCPackFreeBSDGenerator.cxx +++ b/Source/CPack/cmCPackFreeBSDGenerator.cxx @@ -228,8 +228,8 @@ void cmCPackFreeBSDGenerator::write_manifest_fields( manifest << ManifestKeyValue( "desc", var_lookup("CPACK_FREEBSD_PACKAGE_DESCRIPTION")); manifest << ManifestKeyValue("www", var_lookup("CPACK_FREEBSD_PACKAGE_WWW")); - std::vector licenses; - cmExpandList(var_lookup("CPACK_FREEBSD_PACKAGE_LICENSE"), licenses); + std::vector licenses = + cmExpandedList(var_lookup("CPACK_FREEBSD_PACKAGE_LICENSE")); std::string licenselogic("single"); if (licenses.empty()) { cmSystemTools::SetFatalErrorOccured(); @@ -238,12 +238,12 @@ void cmCPackFreeBSDGenerator::write_manifest_fields( } manifest << ManifestKeyValue("licenselogic", licenselogic); manifest << (ManifestKeyListValue("licenses") << licenses); - std::vector categories; - cmExpandList(var_lookup("CPACK_FREEBSD_PACKAGE_CATEGORIES"), categories); + std::vector categories = + cmExpandedList(var_lookup("CPACK_FREEBSD_PACKAGE_CATEGORIES")); manifest << (ManifestKeyListValue("categories") << categories); manifest << ManifestKeyValue("prefix", var_lookup("CMAKE_INSTALL_PREFIX")); - std::vector deps; - cmExpandList(var_lookup("CPACK_FREEBSD_PACKAGE_DEPS"), deps); + std::vector deps = + cmExpandedList(var_lookup("CPACK_FREEBSD_PACKAGE_DEPS")); if (!deps.empty()) { manifest << (ManifestKeyDepsValue("deps") << deps); } diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 0e9f1b6..288d5d8 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -210,8 +210,8 @@ int cmCPackGenerator::InstallProject() const char* default_dir_install_permissions = this->GetOption("CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS"); if (default_dir_install_permissions && *default_dir_install_permissions) { - std::vector items; - cmExpandList(default_dir_install_permissions, items); + std::vector items = + cmExpandedList(default_dir_install_permissions); for (const auto& arg : items) { if (!cmFSPermissions::stringToModeT(arg, default_dir_mode_v)) { cmCPackLogger(cmCPackLog::LOG_ERROR, @@ -273,8 +273,8 @@ int cmCPackGenerator::InstallProjectViaInstallCommands( std::string tempInstallDirectoryEnv = cmStrCat("CMAKE_INSTALL_PREFIX=", tempInstallDirectory); cmSystemTools::PutEnv(tempInstallDirectoryEnv); - std::vector installCommandsVector; - cmExpandList(installCommands, installCommandsVector); + std::vector installCommandsVector = + cmExpandedList(installCommands); for (std::string const& ic : installCommandsVector) { cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Execute: " << ic << std::endl); std::string output; @@ -310,8 +310,8 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories( std::vector ignoreFilesRegex; const char* cpackIgnoreFiles = this->GetOption("CPACK_IGNORE_FILES"); if (cpackIgnoreFiles) { - std::vector ignoreFilesRegexString; - cmExpandList(cpackIgnoreFiles, ignoreFilesRegexString); + std::vector ignoreFilesRegexString = + cmExpandedList(cpackIgnoreFiles); for (std::string const& ifr : ignoreFilesRegexString) { cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Create ignore files regex for: " << ifr << std::endl); @@ -321,8 +321,8 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories( const char* installDirectories = this->GetOption("CPACK_INSTALLED_DIRECTORIES"); if (installDirectories && *installDirectories) { - std::vector installDirectoriesVector; - cmExpandList(installDirectories, installDirectoriesVector); + std::vector installDirectoriesVector = + cmExpandedList(installDirectories); if (installDirectoriesVector.size() % 2 != 0) { cmCPackLogger( cmCPackLog::LOG_ERROR, @@ -460,8 +460,7 @@ int cmCPackGenerator::InstallProjectViaInstallScript( if (cmakeScripts && *cmakeScripts) { cmCPackLogger(cmCPackLog::LOG_OUTPUT, "- Install scripts: " << cmakeScripts << std::endl); - std::vector cmakeScriptsVector; - cmExpandList(cmakeScripts, cmakeScriptsVector); + std::vector cmakeScriptsVector = cmExpandedList(cmakeScripts); for (std::string const& installScript : cmakeScriptsVector) { cmCPackLogger(cmCPackLog::LOG_OUTPUT, @@ -525,8 +524,8 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( << std::endl); return 0; } - std::vector cmakeProjectsVector; - cmExpandList(cmakeProjects, cmakeProjectsVector); + std::vector cmakeProjectsVector = + cmExpandedList(cmakeProjects); std::vector::iterator it; for (it = cmakeProjectsVector.begin(); it != cmakeProjectsVector.end(); ++it) { @@ -570,8 +569,8 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( cmSystemTools::UpperCase(project.Component) + "_INSTALL_TYPES"; const char* installTypes = this->GetOption(installTypesVar); if (installTypes && *installTypes) { - std::vector installTypesVector; - cmExpandList(installTypes, installTypesVector); + std::vector installTypesVector = + cmExpandedList(installTypes); for (std::string const& installType : installTypesVector) { project.InstallationTypes.push_back( this->GetInstallationType(project.ProjectName, installType)); @@ -1493,8 +1492,8 @@ cmCPackComponent* cmCPackGenerator::GetComponent( // Determine the installation types. const char* installTypes = this->GetOption(macroPrefix + "_INSTALL_TYPES"); if (installTypes && *installTypes) { - std::vector installTypesVector; - cmExpandList(installTypes, installTypesVector); + std::vector installTypesVector = + cmExpandedList(installTypes); for (std::string const& installType : installTypesVector) { component->InstallationTypes.push_back( this->GetInstallationType(projectName, installType)); @@ -1504,8 +1503,7 @@ cmCPackComponent* cmCPackGenerator::GetComponent( // Determine the component dependencies. const char* depends = this->GetOption(macroPrefix + "_DEPENDS"); if (depends && *depends) { - std::vector dependsVector; - cmExpandList(depends, dependsVector); + std::vector dependsVector = cmExpandedList(depends); for (std::string const& depend : dependsVector) { cmCPackComponent* child = GetComponent(projectName, depend); component->Dependencies.push_back(child); diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index 41ffa0e..8098edf 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -471,8 +471,8 @@ int cmCPackNSISGenerator::InitializeInternal() cmCPackLogger(cmCPackLog::LOG_DEBUG, "The cpackPackageExecutables: " << cpackPackageExecutables << "." << std::endl); - std::vector cpackPackageExecutablesVector; - cmExpandList(cpackPackageExecutables, cpackPackageExecutablesVector); + std::vector cpackPackageExecutablesVector = + cmExpandedList(cpackPackageExecutables); if (cpackPackageExecutablesVector.size() % 2 != 0) { cmCPackLogger( cmCPackLog::LOG_ERROR, @@ -524,8 +524,8 @@ void cmCPackNSISGenerator::CreateMenuLinks(std::ostream& str, } cmCPackLogger(cmCPackLog::LOG_DEBUG, "The cpackMenuLinks: " << cpackMenuLinks << "." << std::endl); - std::vector cpackMenuLinksVector; - cmExpandList(cpackMenuLinks, cpackMenuLinksVector); + std::vector cpackMenuLinksVector = + cmExpandedList(cpackMenuLinks); if (cpackMenuLinksVector.size() % 2 != 0) { cmCPackLogger( cmCPackLog::LOG_ERROR, diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx index ffa8a42..992299a 100644 --- a/Source/CPack/cmCPackOSXX11Generator.cxx +++ b/Source/CPack/cmCPackOSXX11Generator.cxx @@ -29,8 +29,8 @@ int cmCPackOSXX11Generator::PackageFiles() << "." << std::endl); std::ostringstream str; std::ostringstream deleteStr; - std::vector cpackPackageExecutablesVector; - cmExpandList(cpackPackageExecutables, cpackPackageExecutablesVector); + std::vector cpackPackageExecutablesVector = + cmExpandedList(cpackPackageExecutables); if (cpackPackageExecutablesVector.size() % 2 != 0) { cmCPackLogger( cmCPackLog::LOG_ERROR, diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index a98fabc..69dac88 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -333,8 +333,7 @@ int main(int argc, char const* const* argv) cmCPack_Log(&log, cmCPackLog::LOG_ERROR, "CPack generator not specified" << std::endl); } else { - std::vector generatorsVector; - cmExpandList(genList, generatorsVector); + std::vector generatorsVector = cmExpandedList(genList); for (std::string const& gen : generatorsVector) { cmMakefile::ScopePushPop raii(&globalMF); cmMakefile* mf = &globalMF; diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx index c13cc80..f7319ef 100644 --- a/Source/CTest/cmCTestGIT.cxx +++ b/Source/CTest/cmCTestGIT.cxx @@ -211,8 +211,7 @@ bool cmCTestGIT::UpdateByFetchAndReset() bool cmCTestGIT::UpdateByCustom(std::string const& custom) { - std::vector git_custom_command; - cmExpandList(custom, git_custom_command, true); + std::vector git_custom_command = cmExpandedList(custom, true); std::vector git_custom; git_custom.reserve(git_custom_command.size() + 1); for (std::string const& i : git_custom_command) { diff --git a/Source/CTest/cmCTestP4.cxx b/Source/CTest/cmCTestP4.cxx index 80eb8d9..64354e8 100644 --- a/Source/CTest/cmCTestP4.cxx +++ b/Source/CTest/cmCTestP4.cxx @@ -460,8 +460,7 @@ bool cmCTestP4::LoadModifications() bool cmCTestP4::UpdateCustom(const std::string& custom) { - std::vector p4_custom_command; - cmExpandList(custom, p4_custom_command, true); + std::vector p4_custom_command = cmExpandedList(custom, true); std::vector p4_custom; p4_custom.reserve(p4_custom_command.size() + 1); diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 52d4596..81966dd 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -544,8 +544,7 @@ int cmCTestScriptHandler::RunCurrentScript() // set any environment variables if (!this->CTestEnv.empty()) { - std::vector envArgs; - cmExpandList(this->CTestEnv, envArgs); + std::vector envArgs = cmExpandedList(this->CTestEnv); cmSystemTools::AppendEnv(envArgs); } @@ -649,8 +648,7 @@ int cmCTestScriptHandler::PerformExtraUpdates() // do an initial cvs update as required command = this->UpdateCmd; for (std::string const& eu : this->ExtraUpdates) { - std::vector cvsArgs; - cmExpandList(eu, cvsArgs); + std::vector cvsArgs = cmExpandedList(eu); if (cvsArgs.size() == 2) { std::string fullCommand = cmStrCat(command, " update ", cvsArgs[1]); output.clear(); @@ -789,8 +787,7 @@ int cmCTestScriptHandler::RunConfigurationDashboard() } // run ctest, it may be more than one command in here - std::vector ctestCommands; - cmExpandList(this->CTestCmd, ctestCommands); + std::vector ctestCommands = cmExpandedList(this->CTestCmd); // for each variable/argument do a putenv for (std::string const& ctestCommand : ctestCommands) { command = ctestCommand; diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx index ec1e9bb..d16aac0 100644 --- a/Source/CTest/cmCTestSubmitCommand.cxx +++ b/Source/CTest/cmCTestSubmitCommand.cxx @@ -68,16 +68,14 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() const char* notesFilesVariable = this->Makefile->GetDefinition("CTEST_NOTES_FILES"); if (notesFilesVariable) { - std::vector notesFiles; - cmExpandList(notesFilesVariable, notesFiles); + std::vector notesFiles = cmExpandedList(notesFilesVariable); this->CTest->GenerateNotesFile(notesFiles); } const char* extraFilesVariable = this->Makefile->GetDefinition("CTEST_EXTRA_SUBMIT_FILES"); if (extraFilesVariable) { - std::vector extraFiles; - cmExpandList(extraFilesVariable, extraFiles); + std::vector extraFiles = cmExpandedList(extraFilesVariable); if (!this->CTest->SubmitExtraFiles(extraFiles)) { this->SetError("problem submitting extra files."); return nullptr; diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index a30999b..2be6ef1 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -155,8 +155,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP( /* In windows, this will init the winsock stuff */ ::curl_global_init(CURL_GLOBAL_ALL); std::string curlopt(this->CTest->GetCTestConfiguration("CurlOptions")); - std::vector args; - cmExpandList(curlopt, args); + std::vector args = cmExpandedList(curlopt); bool verifyPeerOff = false; bool verifyHostOff = false; for (std::string const& arg : args) { @@ -499,8 +498,7 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, cmCTestCurl curl(this->CTest); curl.SetQuiet(this->Quiet); std::string curlopt(this->CTest->GetCTestConfiguration("CurlOptions")); - std::vector args; - cmExpandList(curlopt, args); + std::vector args = cmExpandedList(curlopt); curl.SetCurlOptions(args); curl.SetTimeOutSeconds(SUBMIT_TIMEOUT_IN_SECONDS_DEFAULT); curl.SetHttpHeaders(this->HttpHeaders); diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 4cb19f8..ca0eaf2 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -2185,26 +2185,22 @@ bool cmCTestTestHandler::SetTestsProperties( cmExpandList(val, rt.AttachOnFail); } if (key == "RESOURCE_LOCK") { - std::vector lval; - cmExpandList(val, lval); + std::vector lval = cmExpandedList(val); rt.LockedResources.insert(lval.begin(), lval.end()); } if (key == "FIXTURES_SETUP") { - std::vector lval; - cmExpandList(val, lval); + std::vector lval = cmExpandedList(val); rt.FixturesSetup.insert(lval.begin(), lval.end()); } if (key == "FIXTURES_CLEANUP") { - std::vector lval; - cmExpandList(val, lval); + std::vector lval = cmExpandedList(val); rt.FixturesCleanup.insert(lval.begin(), lval.end()); } if (key == "FIXTURES_REQUIRED") { - std::vector lval; - cmExpandList(val, lval); + std::vector lval = cmExpandedList(val); rt.FixturesRequired.insert(lval.begin(), lval.end()); } @@ -2222,15 +2218,13 @@ bool cmCTestTestHandler::SetTestsProperties( rt.RunSerial = cmIsOn(val); } if (key == "FAIL_REGULAR_EXPRESSION") { - std::vector lval; - cmExpandList(val, lval); + std::vector lval = cmExpandedList(val); for (std::string const& cr : lval) { rt.ErrorRegularExpressions.emplace_back(cr, cr); } } if (key == "SKIP_REGULAR_EXPRESSION") { - std::vector lval; - cmExpandList(val, lval); + std::vector lval = cmExpandedList(val); for (std::string const& cr : lval) { rt.SkipRegularExpressions.emplace_back(cr, cr); } @@ -2257,8 +2251,7 @@ bool cmCTestTestHandler::SetTestsProperties( cmExpandList(val, rt.Environment); } if (key == "LABELS") { - std::vector Labels; - cmExpandList(val, Labels); + std::vector Labels = cmExpandedList(val); rt.Labels.insert(rt.Labels.end(), Labels.begin(), Labels.end()); // sort the array std::sort(rt.Labels.begin(), rt.Labels.end()); @@ -2278,8 +2271,7 @@ bool cmCTestTestHandler::SetTestsProperties( } } if (key == "PASS_REGULAR_EXPRESSION") { - std::vector lval; - cmExpandList(val, lval); + std::vector lval = cmExpandedList(val); for (std::string const& cr : lval) { rt.RequiredRegularExpressions.emplace_back(cr, cr); } @@ -2288,16 +2280,14 @@ bool cmCTestTestHandler::SetTestsProperties( rt.Directory = val; } if (key == "TIMEOUT_AFTER_MATCH") { - std::vector propArgs; - cmExpandList(val, propArgs); + std::vector propArgs = cmExpandedList(val); if (propArgs.size() != 2) { cmCTestLog(this->CTest, WARNING, "TIMEOUT_AFTER_MATCH expects two arguments, found " << propArgs.size() << std::endl); } else { rt.AlternateTimeout = cmDuration(atof(propArgs[0].c_str())); - std::vector lval; - cmExpandList(propArgs[1], lval); + std::vector lval = cmExpandedList(propArgs[1]); for (std::string const& cr : lval) { rt.TimeoutRegularExpressions.emplace_back(cr, cr); } @@ -2339,8 +2329,7 @@ bool cmCTestTestHandler::SetDirectoryProperties( std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); if (cwd == rt.Directory) { if (key == "LABELS") { - std::vector DirectoryLabels; - cmExpandList(val, DirectoryLabels); + std::vector DirectoryLabels = cmExpandedList(val); rt.Labels.insert(rt.Labels.end(), DirectoryLabels.begin(), DirectoryLabels.end()); diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx index f7e3920..f450a1c 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx @@ -71,8 +71,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( cmCursesOptionsWidget* ow = new cmCursesOptionsWidget(this->EntryWidth, 1, 1, 1); this->Entry = ow; - std::vector options; - cmExpandList(stringsProp, options); + std::vector options = cmExpandedList(stringsProp); for (auto const& opt : options) { ow->AddOption(opt); } diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 866d262..aa86226 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1448,8 +1448,7 @@ void cmCTest::AddSiteProperties(cmXMLWriter& xml) if (labels) { xml.StartElement("Labels"); std::string l = labels; - std::vector args; - cmExpandList(l, args); + std::vector args = cmExpandedList(l); for (std::string const& i : args) { xml.Element("Label", i); } @@ -1481,8 +1480,7 @@ std::vector cmCTest::GetLabelsForSubprojects() { std::string labelsForSubprojects = this->GetCTestConfiguration("LabelsForSubprojects"); - std::vector subprojects; - cmExpandList(labelsForSubprojects, subprojects); + std::vector subprojects = cmExpandedList(labelsForSubprojects); // sort the array std::sort(subprojects.begin(), subprojects.end()); diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index 67ff94b..cf28cdb 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -541,8 +541,7 @@ void cmCacheManager::AddCacheEntry(const std::string& key, const char* value, // make sure we only use unix style paths if (type == cmStateEnums::FILEPATH || type == cmStateEnums::PATH) { if (e.Value.find(';') != std::string::npos) { - std::vector paths; - cmExpandList(e.Value, paths); + std::vector paths = cmExpandedList(e.Value); const char* sep = ""; e.Value = ""; for (std::string& i : paths) { diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index c4b0c05..a39425c 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -436,8 +436,7 @@ void cmComputeLinkDepends::AddVarLinkEntries(int depender_index, // This is called to add the dependencies named by // _LIB_DEPENDS. The variable contains a semicolon-separated // list. The list contains link-type;item pairs and just items. - std::vector deplist; - cmExpandList(value, deplist); + std::vector deplist = cmExpandedList(value); // Look for entries meant for this configuration. std::vector actual_libs; diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index 0ff0c3a..880d5c0 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -541,8 +541,7 @@ void cmComputeLinkInformation::AddImplicitLinkInfo(std::string const& lang) // linker language. std::string libVar = cmStrCat("CMAKE_", lang, "_IMPLICIT_LINK_LIBRARIES"); if (const char* libs = this->Makefile->GetDefinition(libVar)) { - std::vector libsVec; - cmExpandList(libs, libsVec); + std::vector libsVec = cmExpandedList(libs); for (std::string const& i : libsVec) { if (!cmContains(this->ImplicitLinkLibs, i)) { this->AddItem(i, nullptr); @@ -554,8 +553,7 @@ void cmComputeLinkInformation::AddImplicitLinkInfo(std::string const& lang) // implied by the linker language. std::string dirVar = cmStrCat("CMAKE_", lang, "_IMPLICIT_LINK_DIRECTORIES"); if (const char* dirs = this->Makefile->GetDefinition(dirVar)) { - std::vector dirsVec; - cmExpandList(dirs, dirsVec); + std::vector dirsVec = cmExpandedList(dirs); this->OrderLinkerSearchPath->AddLanguageDirectories(dirsVec); } } @@ -795,16 +793,14 @@ void cmComputeLinkInformation::ComputeItemParserInfo() LinkUnknown); if (const char* linkSuffixes = mf->GetDefinition("CMAKE_EXTRA_LINK_EXTENSIONS")) { - std::vector linkSuffixVec; - cmExpandList(linkSuffixes, linkSuffixVec); + std::vector linkSuffixVec = cmExpandedList(linkSuffixes); for (std::string const& i : linkSuffixVec) { this->AddLinkExtension(i.c_str(), LinkUnknown); } } if (const char* sharedSuffixes = mf->GetDefinition("CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES")) { - std::vector sharedSuffixVec; - cmExpandList(sharedSuffixes, sharedSuffixVec); + std::vector sharedSuffixVec = cmExpandedList(sharedSuffixes); for (std::string const& i : sharedSuffixVec) { this->AddLinkExtension(i.c_str(), LinkShared); } @@ -1640,8 +1636,7 @@ static void cmCLI_ExpandListUnique(const char* str, std::vector& out, std::set& emitted) { - std::vector tmp; - cmExpandList(str, tmp); + std::vector tmp = cmExpandedList(str); for (std::string const& i : tmp) { if (emitted.insert(i).second) { out.push_back(i); diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx index d72f561..21df278 100644 --- a/Source/cmConditionEvaluator.cxx +++ b/Source/cmConditionEvaluator.cxx @@ -668,8 +668,7 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList& newArgs, def2 = this->Makefile.GetDefinition(argP2->GetValue()); if (def2) { - std::vector list; - cmExpandList(def2, list, true); + std::vector list = cmExpandedList(def2, true); result = cmContains(list, def); } diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index f696b95..3687056 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -674,8 +674,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv, if (const char* varListStr = this->Makefile->GetDefinition( kCMAKE_TRY_COMPILE_PLATFORM_VARIABLES)) { - std::vector varList; - cmExpandList(varListStr, varList); + std::vector varList = cmExpandedList(varListStr); vars.insert(varList.begin(), varList.end()); } diff --git a/Source/cmExportBuildAndroidMKGenerator.cxx b/Source/cmExportBuildAndroidMKGenerator.cxx index f8ce592..561e830 100644 --- a/Source/cmExportBuildAndroidMKGenerator.cxx +++ b/Source/cmExportBuildAndroidMKGenerator.cxx @@ -143,8 +143,7 @@ void cmExportBuildAndroidMKGenerator::GenerateInterfaceProperties( } } else if (property.first == "INTERFACE_INCLUDE_DIRECTORIES") { std::string includes = property.second; - std::vector includeList; - cmExpandList(includes, includeList); + std::vector includeList = cmExpandedList(includes); os << "LOCAL_EXPORT_C_INCLUDES := "; std::string end; for (std::string const& i : includeList) { @@ -154,8 +153,8 @@ void cmExportBuildAndroidMKGenerator::GenerateInterfaceProperties( os << "\n"; } else if (property.first == "INTERFACE_LINK_OPTIONS") { os << "LOCAL_EXPORT_LDFLAGS := "; - std::vector linkFlagsList; - cmExpandList(property.second, linkFlagsList); + std::vector linkFlagsList = + cmExpandedList(property.second); os << cmJoin(linkFlagsList, " ") << "\n"; } else { os << "# " << property.first << " " << (property.second) << "\n"; diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 96733f2..6a8c3b0 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -499,8 +499,7 @@ void getPropertyContents(cmGeneratorTarget const* tgt, const std::string& prop, if (!p) { return; } - std::vector content; - cmExpandList(p, content); + std::vector content = cmExpandedList(p); ifaceProperties.insert(content.begin(), content.end()); } diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx index f77fd3a..5631d60 100644 --- a/Source/cmExportTryCompileFileGenerator.cxx +++ b/Source/cmExportTryCompileFileGenerator.cxx @@ -103,8 +103,7 @@ void cmExportTryCompileFileGenerator::PopulateProperties( std::string evalResult = this->FindTargets(p, target, std::string(), emitted); - std::vector depends; - cmExpandList(evalResult, depends); + std::vector depends = cmExpandedList(evalResult); for (std::string const& li : depends) { cmGeneratorTarget* tgt = target->GetLocalGenerator()->FindGeneratorTargetToUse(li); diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 5ff638d..6c94aae 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -415,8 +415,7 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile() if (const char* extraNaturesProp = mf->GetState()->GetGlobalProperty("ECLIPSE_EXTRA_NATURES")) { - std::vector extraNatures; - cmExpandList(extraNaturesProp, extraNatures); + std::vector extraNatures = cmExpandedList(extraNaturesProp); for (std::string const& n : extraNatures) { xml.Element("nature", n); } @@ -797,8 +796,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const mf->GetDefinition("CMAKE_EXTRA_GENERATOR_C_SYSTEM_DEFINED_MACROS"); if (this->CEnabled && cDefs) { // Expand the list. - std::vector defs; - cmExpandList(cDefs, defs, true); + std::vector defs = cmExpandedList(cDefs, true); // the list must contain only definition-value pairs: if ((defs.size() % 2) == 0) { @@ -830,8 +828,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const mf->GetDefinition("CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS"); if (this->CXXEnabled && cxxDefs) { // Expand the list. - std::vector defs; - cmExpandList(cxxDefs, defs, true); + std::vector defs = cmExpandedList(cxxDefs, true); // the list must contain only definition-value pairs: if ((defs.size() % 2) == 0) { @@ -881,16 +878,14 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const if (this->CEnabled && !compiler.empty()) { std::string systemIncludeDirs = mf->GetSafeDefinition("CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS"); - std::vector dirs; - cmExpandList(systemIncludeDirs, dirs); + std::vector dirs = cmExpandedList(systemIncludeDirs); this->AppendIncludeDirectories(xml, dirs, emmited); } compiler = mf->GetSafeDefinition("CMAKE_CXX_COMPILER"); if (this->CXXEnabled && !compiler.empty()) { std::string systemIncludeDirs = mf->GetSafeDefinition("CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS"); - std::vector dirs; - cmExpandList(systemIncludeDirs, dirs); + std::vector dirs = cmExpandedList(systemIncludeDirs); this->AppendIncludeDirectories(xml, dirs, emmited); } diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx index 36d9afd..33f5157 100644 --- a/Source/cmExtraSublimeTextGenerator.cxx +++ b/Source/cmExtraSublimeTextGenerator.cxx @@ -134,8 +134,7 @@ void cmExtraSublimeTextGenerator::CreateNewProjectFile( // End of build_systems fout << "\n\t]"; std::string systemName = mf->GetSafeDefinition("CMAKE_SYSTEM_NAME"); - std::vector tokens; - cmExpandList(this->EnvSettings, tokens); + std::vector tokens = cmExpandedList(this->EnvSettings); if (!this->EnvSettings.empty()) { fout << ","; diff --git a/Source/cmFileCopier.cxx b/Source/cmFileCopier.cxx index 3156c95..b989b20 100644 --- a/Source/cmFileCopier.cxx +++ b/Source/cmFileCopier.cxx @@ -173,8 +173,8 @@ bool cmFileCopier::GetDefaultDirectoryPermissions(mode_t** mode) const char* default_dir_install_permissions = this->Makefile->GetDefinition( "CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS"); if (default_dir_install_permissions && *default_dir_install_permissions) { - std::vector items; - cmExpandList(default_dir_install_permissions, items); + std::vector items = + cmExpandedList(default_dir_install_permissions); for (const auto& arg : items) { if (!this->CheckPermissions(arg, **mode)) { this->Status.SetError( diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index 9a4e13e..02cdf0f 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -375,8 +375,7 @@ static const struct RemoveDuplicatesNode : public cmGeneratorExpressionNode "$ expression requires one parameter"); } - std::vector values; - cmExpandList(parameters.front(), values, true); + std::vector values = cmExpandedList(parameters.front(), true); auto valuesEnd = cmRemoveDuplicates(values); auto valuesBegin = values.cbegin(); @@ -939,8 +938,7 @@ static const struct JoinNode : public cmGeneratorExpressionNode const GeneratorExpressionContent* /*content*/, cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override { - std::vector list; - cmExpandList(parameters.front(), list); + std::vector list = cmExpandedList(parameters.front()); return cmJoin(list, parameters[1]); } } joinNode; @@ -2209,8 +2207,7 @@ static const struct ShellPathNode : public cmGeneratorExpressionNode const GeneratorExpressionContent* content, cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override { - std::vector listIn; - cmExpandList(parameters.front(), listIn); + std::vector listIn = cmExpandedList(parameters.front()); if (listIn.empty()) { reportError(context, content->GetOriginalExpression(), "\"\" is not an absolute path."); diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 2e9a11a..2284ea5 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -1405,8 +1405,7 @@ std::vector> cmGeneratorTarget::GetSourceFilePaths( cmStringRange sourceEntries = this->Target->GetSourceEntries(); for (std::string const& entry : sourceEntries) { - std::vector items; - cmExpandList(entry, items); + std::vector items = cmExpandedList(entry); for (std::string const& item : items) { if (cmHasLiteralPrefix(item, "$') { @@ -2674,8 +2673,7 @@ void cmTargetTraceDependencies::Trace() // Queue dependencies added explicitly by the user. if (const char* additionalDeps = sf->GetProperty("OBJECT_DEPENDS")) { - std::vector objDeps; - cmExpandList(additionalDeps, objDeps); + std::vector objDeps = cmExpandedList(additionalDeps); for (std::string& objDep : objDeps) { if (cmSystemTools::FileIsFullPath(objDep)) { objDep = cmSystemTools::CollapseFullPath(objDep); @@ -3363,8 +3361,7 @@ std::vector> cmGeneratorTarget::GetLinkOptions( // actual linker wrapper const std::string wrapper(this->Makefile->GetSafeDefinition( "CMAKE_" + language + "_LINKER_WRAPPER_FLAG")); - std::vector wrapperFlag; - cmExpandList(wrapper, wrapperFlag); + std::vector wrapperFlag = cmExpandedList(wrapper); const std::string wrapperSep(this->Makefile->GetSafeDefinition( "CMAKE_" + language + "_LINKER_WRAPPER_FLAG_SEP")); bool concatFlagAndArgs = true; @@ -3485,8 +3482,7 @@ std::vector> cmGeneratorTarget::GetStaticLibraryLinkOptions( std::vector entries; if (const char* linkOptions = this->GetProperty("STATIC_LIBRARY_OPTIONS")) { - std::vector options; - cmExpandList(linkOptions, options); + std::vector options = cmExpandedList(linkOptions); for (const auto& option : options) { std::unique_ptr entry( CreateTargetPropertyEntry(option)); @@ -3640,8 +3636,7 @@ std::vector> cmGeneratorTarget::GetLinkDepends( std::vector entries; if (const char* linkDepends = this->GetProperty("LINK_DEPENDS")) { - std::vector depends; - cmExpandList(linkDepends, depends); + std::vector depends = cmExpandedList(linkDepends); for (const auto& depend : depends) { std::unique_ptr entry( CreateTargetPropertyEntry(depend)); @@ -4184,8 +4179,7 @@ void cmGeneratorTarget::ConstructSourceFileFlags() const // Process public headers to mark the source files. if (const char* files = this->GetProperty("PUBLIC_HEADER")) { - std::vector relFiles; - cmExpandList(files, relFiles); + std::vector relFiles = cmExpandedList(files); for (std::string const& relFile : relFiles) { if (cmSourceFile* sf = this->Makefile->GetSource(relFile)) { SourceFileFlags& flags = this->SourceFlagsMap[sf]; @@ -4198,8 +4192,7 @@ void cmGeneratorTarget::ConstructSourceFileFlags() const // Process private headers after public headers so that they take // precedence if a file is listed in both. if (const char* files = this->GetProperty("PRIVATE_HEADER")) { - std::vector relFiles; - cmExpandList(files, relFiles); + std::vector relFiles = cmExpandedList(files); for (std::string const& relFile : relFiles) { if (cmSourceFile* sf = this->Makefile->GetSource(relFile)) { SourceFileFlags& flags = this->SourceFlagsMap[sf]; @@ -4211,8 +4204,7 @@ void cmGeneratorTarget::ConstructSourceFileFlags() const // Mark sources listed as resources. if (const char* files = this->GetProperty("RESOURCE")) { - std::vector relFiles; - cmExpandList(files, relFiles); + std::vector relFiles = cmExpandedList(files); for (std::string const& relFile : relFiles) { if (cmSourceFile* sf = this->Makefile->GetSource(relFile)) { SourceFileFlags& flags = this->SourceFlagsMap[sf]; @@ -4354,8 +4346,7 @@ void checkPropertyConsistency(cmGeneratorTarget const* depender, return; } - std::vector props; - cmExpandList(prop, props); + std::vector props = cmExpandedList(prop); std::string pdir = cmStrCat(cmSystemTools::GetCMakeRoot(), "/Help/prop_tgt/"); @@ -5709,8 +5700,7 @@ const cmLinkInterface* cmGeneratorTarget::GetImportLinkInterface( this->ExpandLinkItems(info->LibrariesProp, info->Libraries, config, headTarget, usage_requirements_only, iface.Libraries, iface.HadHeadSensitiveCondition); - std::vector deps; - cmExpandList(info->SharedDeps, deps); + std::vector deps = cmExpandedList(info->SharedDeps); this->LookupLinkItems(deps, cmListFileBacktrace(), iface.SharedDeps); } @@ -5993,8 +5983,7 @@ void cmGeneratorTarget::GetObjectLibrariesCMP0026( // behavior of CMP0024 and CMP0026 only. cmStringRange rng = this->Target->GetSourceEntries(); for (std::string const& entry : rng) { - std::vector files; - cmExpandList(entry, files); + std::vector files = cmExpandedList(entry); for (std::string const& li : files) { if (cmHasLiteralPrefix(li, "$') { std::string objLibName = li.substr(17, li.size() - 18); diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx index 26fc226..e7b20ed 100644 --- a/Source/cmGhsMultiTargetGenerator.cxx +++ b/Source/cmGhsMultiTargetGenerator.cxx @@ -465,8 +465,7 @@ void cmGhsMultiTargetGenerator::WriteSourceProperty( { const char* prop = sf->GetProperty(propName); if (prop) { - std::vector list; - cmExpandList(prop, list); + std::vector list = cmExpandedList(prop); for (auto& p : list) { fout << " " << propFlag << p << std::endl; } diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index e145ad4..363ad6e 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1110,8 +1110,7 @@ void cmGlobalGenerator::SetLanguageEnabledMaps(const std::string& l, std::string ignoreExtensionsVar = std::string("CMAKE_") + std::string(l) + std::string("_IGNORE_EXTENSIONS"); std::string ignoreExts = mf->GetSafeDefinition(ignoreExtensionsVar); - std::vector extensionList; - cmExpandList(ignoreExts, extensionList); + std::vector extensionList = cmExpandedList(ignoreExts); for (std::string const& i : extensionList) { this->IgnoreExtensions[i] = true; } @@ -1123,8 +1122,7 @@ void cmGlobalGenerator::FillExtensionToLanguageMap(const std::string& l, std::string extensionsVar = std::string("CMAKE_") + std::string(l) + std::string("_SOURCE_FILE_EXTENSIONS"); const std::string& exts = mf->GetSafeDefinition(extensionsVar); - std::vector extensionList; - cmExpandList(exts, extensionList); + std::vector extensionList = cmExpandedList(exts); for (std::string const& i : extensionList) { this->ExtensionToLanguage[i] = l; } @@ -1581,8 +1579,8 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo() "CMAKE_" + li + "_STANDARD_INCLUDE_DIRECTORIES"; std::string const& standardIncludesStr = mf->GetSafeDefinition(standardIncludesVar); - std::vector standardIncludesVec; - cmExpandList(standardIncludesStr, standardIncludesVec); + std::vector standardIncludesVec = + cmExpandedList(standardIncludesStr); standardIncludesSet.insert(standardIncludesVec.begin(), standardIncludesVec.end()); } diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx index 25d678f..0b45f4b 100644 --- a/Source/cmGlobalGhsMultiGenerator.cxx +++ b/Source/cmGlobalGhsMultiGenerator.cxx @@ -610,8 +610,8 @@ void cmGlobalGhsMultiGenerator::WriteMacros(std::ostream& fout, char const* ghsGpjMacros = this->GetCMakeInstance()->GetCacheDefinition("GHS_GPJ_MACROS"); if (nullptr != ghsGpjMacros) { - std::vector expandedList; - cmExpandList(std::string(ghsGpjMacros), expandedList); + std::vector expandedList = + cmExpandedList(std::string(ghsGpjMacros)); for (std::string const& arg : expandedList) { fout << "macro " << arg << std::endl; } diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 258e300..26ceedd 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -511,8 +511,8 @@ void cmGlobalVisualStudio7Generator::WriteSLNGlobalSections( extensibilityAddInsOverridden = true; } fout << "\tGlobalSection(" << name << ") = " << sectionType << "\n"; - std::vector keyValuePairs; - cmExpandList(root->GetMakefile()->GetProperty(it), keyValuePairs); + std::vector keyValuePairs = + cmExpandedList(root->GetMakefile()->GetProperty(it)); for (std::string const& itPair : keyValuePairs) { const std::string::size_type posEqual = itPair.find('='); if (posEqual != std::string::npos) { diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index a8f27d6..a204fe0 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -875,8 +875,7 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeSourceFile( const char* extraFileAttributes = sf->GetProperty("XCODE_FILE_ATTRIBUTES"); if (extraFileAttributes) { // Expand the list of attributes. - std::vector attributes; - cmExpandList(extraFileAttributes, attributes); + std::vector attributes = cmExpandedList(extraFileAttributes); // Store the attributes. for (const auto& attribute : attributes) { @@ -3568,8 +3567,7 @@ void cmGlobalXCodeGenerator::AppendDefines(BuildObjectListOrString& defs, } // Expand the list of definitions. - std::vector defines; - cmExpandList(defines_list, defines); + std::vector defines = cmExpandedList(defines_list); // Store the definitions in the string. this->AppendDefines(defs, defines, dflag); diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx index c5b5522..9b58f61 100644 --- a/Source/cmGraphVizWriter.cxx +++ b/Source/cmGraphVizWriter.cxx @@ -235,8 +235,8 @@ void cmGraphVizWriter::ReadSettings( this->TargetsToIgnoreRegex.clear(); if (!ignoreTargetsRegexes.empty()) { - std::vector ignoreTargetsRegExVector; - cmExpandList(ignoreTargetsRegexes, ignoreTargetsRegExVector); + std::vector ignoreTargetsRegExVector = + cmExpandedList(ignoreTargetsRegexes); for (std::string const& currentRegexString : ignoreTargetsRegExVector) { cmsys::RegularExpression currentRegex; if (!currentRegex.compile(currentRegexString)) { diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index 8b428a9..1883acb 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -670,8 +670,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) if (createInstallGeneratorsForTargetFileSets && !namelinkOnly) { const char* files = target.GetProperty("PRIVATE_HEADER"); if ((files) && (*files)) { - std::vector relFiles; - cmExpandList(files, relFiles); + std::vector relFiles = cmExpandedList(files); std::vector absFiles; if (!this->MakeFilesFullPath("PRIVATE_HEADER", relFiles, absFiles)) { return false; @@ -685,8 +684,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) files = target.GetProperty("PUBLIC_HEADER"); if ((files) && (*files)) { - std::vector relFiles; - cmExpandList(files, relFiles); + std::vector relFiles = cmExpandedList(files); std::vector absFiles; if (!this->MakeFilesFullPath("PUBLIC_HEADER", relFiles, absFiles)) { return false; @@ -700,8 +698,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) files = target.GetProperty("RESOURCE"); if ((files) && (*files)) { - std::vector relFiles; - cmExpandList(files, relFiles); + std::vector relFiles = cmExpandedList(files); std::vector absFiles; if (!this->MakeFilesFullPath("RESOURCE", relFiles, absFiles)) { return false; diff --git a/Source/cmLDConfigLDConfigTool.cxx b/Source/cmLDConfigLDConfigTool.cxx index d5cc621..b68dbbd 100644 --- a/Source/cmLDConfigLDConfigTool.cxx +++ b/Source/cmLDConfigLDConfigTool.cxx @@ -33,8 +33,7 @@ bool cmLDConfigLDConfigTool::GetLDConfigPaths(std::vector& paths) } } - std::vector ldConfigCommand; - cmExpandList(ldConfigPath, ldConfigCommand); + std::vector ldConfigCommand = cmExpandedList(ldConfigPath); ldConfigCommand.emplace_back("-v"); ldConfigCommand.emplace_back("-N"); // Don't rebuild the cache. ldConfigCommand.emplace_back("-X"); // Don't update links. diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx index 7ef475a..ff3ecd9 100644 --- a/Source/cmListFileCache.cxx +++ b/Source/cmListFileCache.cxx @@ -483,8 +483,7 @@ std::vector> ExpandListWithBacktrace( std::string const& list, cmListFileBacktrace const& bt) { std::vector> result; - std::vector tmp; - cmExpandList(list, tmp); + std::vector tmp = cmExpandedList(list); result.reserve(tmp.size()); for (std::string& i : tmp) { result.emplace_back(std::move(i), bt); diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 1827a42..57dabd1 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -311,8 +311,7 @@ void cmLocalGenerator::GenerateTestFiles() const char* testIncludeFiles = this->Makefile->GetProperty("TEST_INCLUDE_FILES"); if (testIncludeFiles) { - std::vector includesList; - cmExpandList(testIncludeFiles, includesList); + std::vector includesList = cmExpandedList(testIncludeFiles); for (std::string const& i : includesList) { fout << "include(\"" << i << "\")" << std::endl; } @@ -902,8 +901,7 @@ void cmLocalGenerator::AddCompileOptions(std::string& flags, ge.Parse(jmcExprGen); std::string isJMCEnabled = cge->Evaluate(this, config); if (cmIsOn(isJMCEnabled)) { - std::vector optVec; - cmExpandList(jmc, optVec); + std::vector optVec = cmExpandedList(jmc); this->AppendCompileOptions(flags, optVec); } } @@ -1769,8 +1767,7 @@ void cmLocalGenerator::AddCompilerRequirementFlag( "CMAKE_" + lang + "_EXTENSION_COMPILE_OPTION"; if (const char* opt = target->Target->GetMakefile()->GetDefinition(option_flag)) { - std::vector optVec; - cmExpandList(opt, optVec); + std::vector optVec = cmExpandedList(opt); for (std::string const& i : optVec) { this->AppendFlagEscape(flags, i); } @@ -1798,8 +1795,7 @@ void cmLocalGenerator::AddCompilerRequirementFlag( "does not know the compile flags to use to enable it."; this->IssueMessage(MessageType::FATAL_ERROR, e.str()); } else { - std::vector optVec; - cmExpandList(opt, optVec); + std::vector optVec = cmExpandedList(opt); for (std::string const& i : optVec) { this->AppendFlagEscape(flags, i); } @@ -1859,8 +1855,7 @@ void cmLocalGenerator::AddCompilerRequirementFlag( std::string const& opt = target->Target->GetMakefile()->GetRequiredDefinition(option_flag); - std::vector optVec; - cmExpandList(opt, optVec); + std::vector optVec = cmExpandedList(opt); for (std::string const& i : optVec) { this->AppendFlagEscape(flags, i); } @@ -1876,8 +1871,7 @@ void cmLocalGenerator::AddCompilerRequirementFlag( if (const char* opt = target->Target->GetMakefile()->GetDefinition(option_flag)) { - std::vector optVec; - cmExpandList(opt, optVec); + std::vector optVec = cmExpandedList(opt); for (std::string const& i : optVec) { this->AppendFlagEscape(flags, i); } @@ -2072,8 +2066,7 @@ void cmLocalGenerator::AddPositionIndependentFlags(std::string& flags, cmStrCat("CMAKE_", lang, "_COMPILE_OPTIONS_PIC")); } if (!picFlags.empty()) { - std::vector options; - cmExpandList(picFlags, options); + std::vector options = cmExpandedList(picFlags); for (std::string const& o : options) { this->AppendFlagEscape(flags, o); } @@ -2144,8 +2137,7 @@ void cmLocalGenerator::AppendIPOLinkerFlags(std::string& flags, return; } - std::vector flagsList; - cmExpandList(rawFlagsList, flagsList); + std::vector flagsList = cmExpandedList(rawFlagsList); for (std::string const& o : flagsList) { this->AppendFlagEscape(flags, o); } @@ -2180,8 +2172,7 @@ void cmLocalGenerator::AppendPositionIndependentLinkerFlags( return; } - std::vector flagsList; - cmExpandList(pieFlags, flagsList); + std::vector flagsList = cmExpandedList(pieFlags); for (const auto& flag : flagsList) { this->AppendFlagEscape(flags, flag); } @@ -2197,8 +2188,7 @@ void cmLocalGenerator::AppendCompileOptions(std::string& options, } // Expand the list of options. - std::vector options_vec; - cmExpandList(options_list, options_vec); + std::vector options_vec = cmExpandedList(options_list); this->AppendCompileOptions(options, options_vec, regex); } @@ -2232,8 +2222,7 @@ void cmLocalGenerator::AppendIncludeDirectories( } // Expand the list of includes. - std::vector includes_vec; - cmExpandList(includes_list, includes_vec); + std::vector includes_vec = cmExpandedList(includes_list); this->AppendIncludeDirectories(includes, includes_vec, sourceFile); } @@ -2360,8 +2349,7 @@ void cmLocalGenerator::AppendFeatureOptions(std::string& flags, const char* optionList = this->Makefile->GetDefinition( cmStrCat("CMAKE_", lang, "_COMPILE_OPTIONS_", feature)); if (optionList != nullptr) { - std::vector options; - cmExpandList(optionList, options); + std::vector options = cmExpandedList(optionList); for (std::string const& o : options) { this->AppendFlagEscape(flags, o); } diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index 1be219c..e28b876 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -221,8 +221,7 @@ void cmLocalNinjaGenerator::WritePools(std::ostream& os) if (jobpools) { cmGlobalNinjaGenerator::WriteComment( os, "Pools defined by global property JOB_POOLS"); - std::vector pools; - cmExpandList(jobpools, pools); + std::vector pools = cmExpandedList(jobpools); for (std::string const& pool : pools) { const std::string::size_type eq = pool.find('='); unsigned int jobs; diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index c301b1a..106e506 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1455,8 +1455,8 @@ bool cmLocalUnixMakefileGenerator3::ScanDependencies( this->WriteDisclaimer(internalRuleFileStream); // for each language we need to scan, scan it - std::vector langs; - cmExpandList(mf->GetSafeDefinition("CMAKE_DEPENDS_LANGUAGES"), langs); + std::vector langs = + cmExpandedList(mf->GetSafeDefinition("CMAKE_DEPENDS_LANGUAGES")); for (std::string const& lang : langs) { // construct the checker // Create the scanner for this language @@ -1500,8 +1500,7 @@ void cmLocalUnixMakefileGenerator3::CheckMultipleOutputs(bool verbose) } // Convert the string to a list and preserve empty entries. - std::vector pairs; - cmExpandList(pairs_string, pairs, true); + std::vector pairs = cmExpandedList(pairs_string, true); for (std::vector::const_iterator i = pairs.begin(); i != pairs.end() && (i + 1) != pairs.end();) { const std::string& depender = *i++; @@ -1727,8 +1726,7 @@ void cmLocalUnixMakefileGenerator3::ClearDependencies(cmMakefile* mf, if (!infoDef) { return; } - std::vector files; - cmExpandList(infoDef, files); + std::vector files = cmExpandedList(infoDef); // Each depend information file corresponds to a target. Clear the // dependencies for that target. diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index bbee705..2c91974 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -1492,8 +1492,7 @@ cmLocalVisualStudio7GeneratorFCInfo::cmLocalVisualStudio7GeneratorFCInfo( // Check for extra object-file dependencies. if (const char* deps = sf.GetProperty("OBJECT_DEPENDS")) { - std::vector depends; - cmExpandList(deps, depends); + std::vector depends = cmExpandedList(deps); const char* sep = ""; for (std::vector::iterator j = depends.begin(); j != depends.end(); ++j) { diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 78351c1..08525e0 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1352,8 +1352,7 @@ bool cmMakefile::ParseDefineFlag(std::string const& def, bool remove) if (remove) { if (const char* cdefs = this->GetProperty("COMPILE_DEFINITIONS")) { // Expand the list. - std::vector defs; - cmExpandList(cdefs, defs); + std::vector defs = cmExpandedList(cdefs); // Recompose the list without the definition. std::vector::const_iterator defEnd = @@ -1953,8 +1952,7 @@ void cmMakefile::AddGlobalLinkInformation(cmTarget& target) } if (const char* linkLibsProp = this->GetProperty("LINK_LIBRARIES")) { - std::vector linkLibs; - cmExpandList(linkLibsProp, linkLibs); + std::vector linkLibs = cmExpandedList(linkLibsProp); for (std::vector::iterator j = linkLibs.begin(); j != linkLibs.end(); ++j) { @@ -2281,8 +2279,7 @@ void cmMakefile::ExpandVariablesCMP0019() } if (const char* linkLibsProp = this->GetProperty("LINK_LIBRARIES")) { - std::vector linkLibs; - cmExpandList(linkLibsProp, linkLibs); + std::vector linkLibs = cmExpandedList(linkLibsProp); for (std::vector::iterator l = linkLibs.begin(); l != linkLibs.end(); ++l) { @@ -3200,8 +3197,7 @@ bool cmMakefile::ExpandArguments( if (i.Delim == cmListFileArgument::Quoted) { outArgs.emplace_back(value, true); } else { - std::vector stringArgs; - cmExpandList(value, stringArgs); + std::vector stringArgs = cmExpandedList(value); for (std::string const& stringArg : stringArgs) { outArgs.emplace_back(stringArg, false); } @@ -3558,8 +3554,7 @@ std::string cmMakefile::GetModulesFile(const std::string& filename, // Always search in CMAKE_MODULE_PATH: const char* cmakeModulePath = this->GetDefinition("CMAKE_MODULE_PATH"); if (cmakeModulePath) { - std::vector modulePath; - cmExpandList(cmakeModulePath, modulePath); + std::vector modulePath = cmExpandedList(cmakeModulePath); // Look through the possible module directories. for (std::string itempl : modulePath) { @@ -4374,8 +4369,7 @@ bool cmMakefile::AddRequiredTargetFeature(cmTarget* target, return false; } - std::vector availableFeatures; - cmExpandList(features, availableFeatures); + std::vector availableFeatures = cmExpandedList(features); if (!cmContains(availableFeatures, feature)) { std::ostringstream e; e << "The compiler feature \"" << feature << "\" is not known to " << lang @@ -4643,32 +4637,27 @@ void cmMakefile::CheckNeededCxxLanguage(const std::string& feature, { if (const char* propCxx98 = this->GetDefinition("CMAKE_CXX98_COMPILE_FEATURES")) { - std::vector props; - cmExpandList(propCxx98, props); + std::vector props = cmExpandedList(propCxx98); needCxx98 = cmContains(props, feature); } if (const char* propCxx11 = this->GetDefinition("CMAKE_CXX11_COMPILE_FEATURES")) { - std::vector props; - cmExpandList(propCxx11, props); + std::vector props = cmExpandedList(propCxx11); needCxx11 = cmContains(props, feature); } if (const char* propCxx14 = this->GetDefinition("CMAKE_CXX14_COMPILE_FEATURES")) { - std::vector props; - cmExpandList(propCxx14, props); + std::vector props = cmExpandedList(propCxx14); needCxx14 = cmContains(props, feature); } if (const char* propCxx17 = this->GetDefinition("CMAKE_CXX17_COMPILE_FEATURES")) { - std::vector props; - cmExpandList(propCxx17, props); + std::vector props = cmExpandedList(propCxx17); needCxx17 = cmContains(props, feature); } if (const char* propCxx20 = this->GetDefinition("CMAKE_CXX20_COMPILE_FEATURES")) { - std::vector props; - cmExpandList(propCxx20, props); + std::vector props = cmExpandedList(propCxx20); needCxx20 = cmContains(props, feature); } } @@ -4767,20 +4756,17 @@ void cmMakefile::CheckNeededCLanguage(const std::string& feature, { if (const char* propC90 = this->GetDefinition("CMAKE_C90_COMPILE_FEATURES")) { - std::vector props; - cmExpandList(propC90, props); + std::vector props = cmExpandedList(propC90); needC90 = cmContains(props, feature); } if (const char* propC99 = this->GetDefinition("CMAKE_C99_COMPILE_FEATURES")) { - std::vector props; - cmExpandList(propC99, props); + std::vector props = cmExpandedList(propC99); needC99 = cmContains(props, feature); } if (const char* propC11 = this->GetDefinition("CMAKE_C11_COMPILE_FEATURES")) { - std::vector props; - cmExpandList(propC11, props); + std::vector props = cmExpandedList(propC11); needC11 = cmContains(props, feature); } } diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 5477e48..b1db7c6 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -767,8 +767,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( // If compiler launcher was specified and not consumed above, it // goes to the beginning of the command line. if (!compileCommands.empty() && !compilerLauncher.empty()) { - std::vector args; - cmExpandList(compilerLauncher, args, true); + std::vector args = cmExpandedList(compilerLauncher, true); if (!args.empty()) { args[0] = this->LocalGenerator->ConvertToOutputFormat( args[0], cmOutputConverter::SHELL); @@ -840,8 +839,8 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( cmStrCat("CMAKE_", lang, "_CREATE_PREPROCESSED_SOURCE"); if (const char* preprocessRule = this->Makefile->GetDefinition(preprocessRuleVar)) { - std::vector preprocessCommands; - cmExpandList(preprocessRule, preprocessCommands); + std::vector preprocessCommands = + cmExpandedList(preprocessRule); std::string shellObjI = this->LocalGenerator->ConvertToOutputFormat( objI, cmOutputConverter::SHELL); @@ -885,8 +884,8 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( cmStrCat("CMAKE_", lang, "_CREATE_ASSEMBLY_SOURCE"); if (const char* assemblyRule = this->Makefile->GetDefinition(assemblyRuleVar)) { - std::vector assemblyCommands; - cmExpandList(assemblyRule, assemblyCommands); + std::vector assemblyCommands = + cmExpandedList(assemblyRule); std::string shellObjS = this->LocalGenerator->ConvertToOutputFormat( objS, cmOutputConverter::SHELL); diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 7b91bd4..3d3d80d 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -725,8 +725,7 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang) // If compiler launcher was specified and not consumed above, it // goes to the beginning of the command line. if (!compileCmds.empty() && !compilerLauncher.empty()) { - std::vector args; - cmExpandList(compilerLauncher, args, true); + std::vector args = cmExpandedList(compilerLauncher, true); if (!args.empty()) { args[0] = this->LocalGenerator->ConvertToOutputFormat( args[0], cmOutputConverter::SHELL); diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx index 38e86e3..dbb7111 100644 --- a/Source/cmOutputRequiredFilesCommand.cxx +++ b/Source/cmOutputRequiredFilesCommand.cxx @@ -122,8 +122,7 @@ public: std::string incDirs = cmGeneratorExpression::Preprocess( incDirProp, cmGeneratorExpression::StripAllGeneratorExpressions); - std::vector includes; - cmExpandList(incDirs, includes); + std::vector includes = cmExpandedList(incDirs); for (std::string& path : includes) { this->Makefile->ExpandVariablesInString(path); diff --git a/Source/cmParseArgumentsCommand.cxx b/Source/cmParseArgumentsCommand.cxx index 2ca3c57..aad9f74 100644 --- a/Source/cmParseArgumentsCommand.cxx +++ b/Source/cmParseArgumentsCommand.cxx @@ -159,8 +159,7 @@ bool cmParseArgumentsCommand(std::vector const& args, }; // the second argument is a (cmake) list of options without argument - std::vector list; - cmExpandList(*argIter++, list); + std::vector list = cmExpandedList(*argIter++); parser.Bind(list, options, duplicateKey); // the third argument is a (cmake) list of single argument options diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index 6718466..c355a5f 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -381,8 +381,7 @@ bool cmQtAutoGenInitializer::InitCustomTargets() std::string const deps = this->Target->GetSafeProperty("AUTOGEN_TARGET_DEPENDS"); if (!deps.empty()) { - std::vector extraDeps; - cmExpandList(deps, extraDeps); + std::vector extraDeps = cmExpandedList(deps); for (std::string const& depName : extraDeps) { // Allow target and file dependencies auto* depTarget = makefile->FindTargetToUse(depName); @@ -796,8 +795,7 @@ bool cmQtAutoGenInitializer::InitScanFiles() std::string const uicOpts = sf->GetSafeProperty(kw.AUTOUIC_OPTIONS); if (!uicOpts.empty()) { this->Uic.FileFiles.push_back(std::move(realPath)); - std::vector optsVec; - cmExpandList(uicOpts, optsVec); + std::vector optsVec = cmExpandedList(uicOpts); this->Uic.FileOptions.push_back(std::move(optsVec)); } } else { @@ -850,9 +848,8 @@ bool cmQtAutoGenInitializer::InitScanFiles() if (!this->Rcc.Qrcs.empty()) { const bool modernQt = (this->QtVersion.Major >= 5); // Target rcc options - std::vector optionsTarget; - cmExpandList(this->Target->GetSafeProperty(kw.AUTORCC_OPTIONS), - optionsTarget); + std::vector optionsTarget = + cmExpandedList(this->Target->GetSafeProperty(kw.AUTORCC_OPTIONS)); // Check if file name is unique for (Qrc& qrc : this->Rcc.Qrcs) { diff --git a/Source/cmQtAutoMocUic.cxx b/Source/cmQtAutoMocUic.cxx index a82dd3a..df190a1 100644 --- a/Source/cmQtAutoMocUic.cxx +++ b/Source/cmQtAutoMocUic.cxx @@ -1491,8 +1491,8 @@ bool cmQtAutoMocUic::Init(cmMakefile* makefile) return makefile->IsOn(key); }; auto InfoGetList = [makefile](const char* key) -> std::vector { - std::vector list; - cmExpandList(makefile->GetSafeDefinition(key), list); + std::vector list = + cmExpandedList(makefile->GetSafeDefinition(key)); return list; }; auto InfoGetLists = @@ -1530,8 +1530,7 @@ bool cmQtAutoMocUic::Init(cmMakefile* makefile) }; auto InfoGetConfigList = [&InfoGetConfig](const char* key) -> std::vector { - std::vector list; - cmExpandList(InfoGetConfig(key), list); + std::vector list = cmExpandedList(InfoGetConfig(key)); return list; }; auto LogInfoError = [this](std::string const& msg) -> bool { diff --git a/Source/cmQtAutoRcc.cxx b/Source/cmQtAutoRcc.cxx index f15634c..cc1a290 100644 --- a/Source/cmQtAutoRcc.cxx +++ b/Source/cmQtAutoRcc.cxx @@ -28,8 +28,8 @@ bool cmQtAutoRcc::Init(cmMakefile* makefile) }; auto InfoGetList = [makefile](std::string const& key) -> std::vector { - std::vector list; - cmExpandList(makefile->GetSafeDefinition(key), list); + std::vector list = + cmExpandedList(makefile->GetSafeDefinition(key)); return list; }; auto InfoGetConfig = [makefile, @@ -46,8 +46,7 @@ bool cmQtAutoRcc::Init(cmMakefile* makefile) }; auto InfoGetConfigList = [&InfoGetConfig](std::string const& key) -> std::vector { - std::vector list; - cmExpandList(InfoGetConfig(key), list); + std::vector list = cmExpandedList(InfoGetConfig(key)); return list; }; auto LogInfoError = [this](std::string const& msg) -> bool { diff --git a/Source/cmSearchPath.cxx b/Source/cmSearchPath.cxx index affff54..d15ce57 100644 --- a/Source/cmSearchPath.cxx +++ b/Source/cmSearchPath.cxx @@ -78,8 +78,7 @@ void cmSearchPath::AddCMakePath(const std::string& variable) // Get a path from a CMake variable. if (const char* value = this->FC->Makefile->GetDefinition(variable)) { - std::vector expanded; - cmExpandList(value, expanded); + std::vector expanded = cmExpandedList(value); for (std::string const& p : expanded) { this->AddPathInternal( @@ -103,8 +102,7 @@ void cmSearchPath::AddCMakePrefixPath(const std::string& variable) // Get a path from a CMake variable. if (const char* value = this->FC->Makefile->GetDefinition(variable)) { - std::vector expanded; - cmExpandList(value, expanded); + std::vector expanded = cmExpandedList(value); this->AddPrefixPaths( expanded, this->FC->Makefile->GetCurrentSourceDirectory().c_str()); diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index bc1b9de..fba0d23 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -88,8 +88,7 @@ const char* cmTargetPropertyComputer::GetSources( std::ostringstream ss; const char* sep = ""; for (std::string const& entry : entries) { - std::vector files; - cmExpandList(entry, files); + std::vector files = cmExpandedList(entry); for (std::string const& file : files) { if (cmHasLiteralPrefix(file, "$') { @@ -499,8 +498,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, if (globals) { const std::string genName = mf->GetGlobalGenerator()->GetName(); if (cmHasLiteralPrefix(genName, "Visual Studio")) { - std::vector props; - cmExpandList(globals, props); + std::vector props = cmExpandedList(globals); const std::string vsGlobal = "VS_GLOBAL_"; for (const std::string& i : props) { // split NAME=VALUE @@ -742,8 +740,7 @@ public: bool operator()(std::string const& entry) { - std::vector files; - cmExpandList(entry, files); + std::vector files = cmExpandedList(entry); std::vector locations; locations.reserve(files.size()); std::transform(files.begin(), files.end(), std::back_inserter(locations), diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx index 75cb413..333d4d5 100644 --- a/Source/cmTestGenerator.cxx +++ b/Source/cmTestGenerator.cxx @@ -102,8 +102,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os, // Prepend with the emulator when cross compiling if required. const char* emulator = target->GetProperty("CROSSCOMPILING_EMULATOR"); if (emulator != nullptr && *emulator) { - std::vector emulatorWithArgs; - cmExpandList(emulator, emulatorWithArgs); + std::vector emulatorWithArgs = cmExpandedList(emulator); std::string emulatorExe(emulatorWithArgs[0]); cmSystemTools::ConvertToUnixSlashes(emulatorExe); os << cmOutputConverter::EscapeForCMake(emulatorExe) << " "; diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index 1c892c7..24d0f0f 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -170,8 +170,7 @@ void cmTryRunCommand::RunExecutable(const std::string& runArgs, const std::string& emulator = this->Makefile->GetSafeDefinition("CMAKE_CROSSCOMPILING_EMULATOR"); if (!emulator.empty()) { - std::vector emulatorWithArgs; - cmExpandList(emulator, emulatorWithArgs); + std::vector emulatorWithArgs = cmExpandedList(emulator); finalCommand += cmSystemTools::ConvertToRunCommandPath(emulatorWithArgs[0]); finalCommand += " "; diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index c5cf9a7..13f6295 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -851,8 +851,8 @@ void cmVisualStudio10TargetGenerator::WriteImports(Elem& e0) const char* imports = this->GeneratorTarget->Target->GetProperty("VS_PROJECT_IMPORT"); if (imports) { - std::vector argsSplit; - cmExpandList(std::string(imports), argsSplit, false); + std::vector argsSplit = + cmExpandedList(std::string(imports), false); for (auto& path : argsSplit) { if (!cmsys::SystemTools::FileIsFullPath(path)) { path = this->Makefile->GetCurrentSourceDirectory() + "/" + path; diff --git a/Source/cmXCodeScheme.cxx b/Source/cmXCodeScheme.cxx index 0b3962e..a1c64ed 100644 --- a/Source/cmXCodeScheme.cxx +++ b/Source/cmXCodeScheme.cxx @@ -214,8 +214,7 @@ void cmXCodeScheme::WriteLaunchAction(cmXMLWriter& xout, if (const char* argList = this->Target->GetTarget()->GetProperty("XCODE_SCHEME_ARGUMENTS")) { - std::vector arguments; - cmExpandList(argList, arguments); + std::vector arguments = cmExpandedList(argList); if (!arguments.empty()) { xout.StartElement("CommandLineArguments"); @@ -235,8 +234,7 @@ void cmXCodeScheme::WriteLaunchAction(cmXMLWriter& xout, if (const char* envList = this->Target->GetTarget()->GetProperty("XCODE_SCHEME_ENVIRONMENT")) { - std::vector envs; - cmExpandList(envList, envs); + std::vector envs = cmExpandedList(envList); if (!envs.empty()) { xout.StartElement("EnvironmentVariables"); diff --git a/Source/cmake.cxx b/Source/cmake.cxx index a5c8d46..077ea4d 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -531,8 +531,7 @@ bool cmake::FindPackage(const std::vector& args) } } else if (mode == "COMPILE") { std::string includes = mf->GetSafeDefinition("PACKAGE_INCLUDE_DIRS"); - std::vector includeDirs; - cmExpandList(includes, includeDirs); + std::vector includeDirs = cmExpandedList(includes); gg->CreateGenerationObjects(); cmLocalGenerator* lg = gg->LocalGenerators[0]; @@ -548,8 +547,7 @@ bool cmake::FindPackage(const std::vector& args) tgt->SetProperty("LINKER_LANGUAGE", language.c_str()); std::string libs = mf->GetSafeDefinition("PACKAGE_LIBRARIES"); - std::vector libList; - cmExpandList(libs, libList); + std::vector libList = cmExpandedList(libs); for (std::string const& lib : libList) { tgt->AddLinkLibrary(*mf, lib, GENERAL_LibraryType); } @@ -1264,8 +1262,7 @@ struct SaveCacheEntry int cmake::HandleDeleteCacheVariables(const std::string& var) { - std::vector argsSplit; - cmExpandList(std::string(var), argsSplit, true); + std::vector argsSplit = cmExpandedList(std::string(var), true); // erase the property to avoid infinite recursion this->State->SetGlobalProperty("__CMAKE_DELETE_CACHE_CHANGE_VARS_", ""); if (this->State->GetIsInTryCompile()) { diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 0832e2f..2be8bae 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -172,8 +172,7 @@ static int HandleIWYU(const std::string& runCmd, { // Construct the iwyu command line by taking what was given // and adding all the arguments we give to the compiler. - std::vector iwyu_cmd; - cmExpandList(runCmd, iwyu_cmd, true); + std::vector iwyu_cmd = cmExpandedList(runCmd, true); cmAppend(iwyu_cmd, orig_cmd.begin() + 1, orig_cmd.end()); // Run the iwyu command line. Capture its stderr and hide its stdout. // Ignore its return code because the tool always returns non-zero. @@ -262,8 +261,7 @@ static int HandleCppLint(const std::string& runCmd, const std::vector&) { // Construct the cpplint command line. - std::vector cpplint_cmd; - cmExpandList(runCmd, cpplint_cmd, true); + std::vector cpplint_cmd = cmExpandedList(runCmd, true); cpplint_cmd.push_back(sourceFile); // Run the cpplint command line. Capture its output. @@ -291,8 +289,7 @@ static int HandleCppCheck(const std::string& runCmd, const std::vector& orig_cmd) { // Construct the cpplint command line. - std::vector cppcheck_cmd; - cmExpandList(runCmd, cppcheck_cmd, true); + std::vector cppcheck_cmd = cmExpandedList(runCmd, true); // extract all the -D, -U, and -I options from the compile line for (auto const& opt : orig_cmd) { if (opt.size() > 2) { -- cgit v0.12