@@ -716,14 +716,13 @@ bool cmQtAutoGenInitializer::InitScanFiles()
716
716
if (muf.MocIt || muf.UicIt ) {
717
717
// Search for the default header file and a private header
718
718
std::string const & srcPath = muf.SF ->GetFullPath ();
719
- std::string basePath = cmQtAutoGen::SubDirPrefix (srcPath);
720
- basePath += cmSystemTools::GetFilenameWithoutLastExtension (srcPath);
719
+ std::string basePath =
720
+ cmStrCat (cmQtAutoGen::SubDirPrefix (srcPath),
721
+ cmSystemTools::GetFilenameWithoutLastExtension (srcPath));
721
722
for (auto const & suffix : suffixes) {
722
723
std::string const suffixedPath = basePath + suffix;
723
724
for (auto const & ext : exts) {
724
- std::string fullPath = suffixedPath;
725
- fullPath += ' .' ;
726
- fullPath += ext;
725
+ std::string fullPath = cmStrCat (suffixedPath, ' .' , ext);
727
726
728
727
auto constexpr locationKind = cmSourceFileLocationKind::Known;
729
728
cmSourceFile* sf = makefile->GetSource (fullPath, locationKind);
@@ -828,9 +827,8 @@ bool cmQtAutoGenInitializer::InitScanFiles()
828
827
this ->AutogenTarget .DependFiles .insert (muf->RealPath );
829
828
}
830
829
} else if (this ->CMP0071Warn ) {
831
- std::string msg;
832
- msg += cmPolicies::GetPolicyWarning (cmPolicies::CMP0071);
833
- msg += ' \n ' ;
830
+ std::string msg =
831
+ cmStrCat (cmPolicies::GetPolicyWarning (cmPolicies::CMP0071), ' \n ' );
834
832
std::string property;
835
833
if (this ->Moc .Enabled && this ->Uic .Enabled ) {
836
834
property = kw.SKIP_AUTOGEN ;
@@ -883,18 +881,10 @@ bool cmQtAutoGenInitializer::InitScanFiles()
883
881
for (Qrc& qrc : this ->Rcc .Qrcs ) {
884
882
qrc.PathChecksum = fpathCheckSum.getPart (qrc.QrcFile );
885
883
// RCC output file name
884
+ qrc.RccFile = cmStrCat (this ->Dir .Build + " /" , qrc.PathChecksum ,
885
+ " /qrc_" , qrc.QrcName , " .cpp" );
886
886
{
887
- std::string rccFile = this ->Dir .Build + " /" ;
888
- rccFile += qrc.PathChecksum ;
889
- rccFile += " /qrc_" ;
890
- rccFile += qrc.QrcName ;
891
- rccFile += " .cpp" ;
892
- qrc.RccFile = std::move (rccFile);
893
- }
894
- {
895
- std::string base = this ->Dir .Info ;
896
- base += " /RCC" ;
897
- base += qrc.QrcName ;
887
+ std::string base = cmStrCat (this ->Dir .Info , " /RCC" , qrc.QrcName );
898
888
if (!qrc.Unique ) {
899
889
base += qrc.PathChecksum ;
900
890
}
@@ -927,8 +917,7 @@ bool cmQtAutoGenInitializer::InitScanFiles()
927
917
// Replace '-' with '_'. The former is not valid for symbol names.
928
918
std::replace (name.begin (), name.end (), ' -' , ' _' );
929
919
if (!qrc.Unique ) {
930
- name += " _" ;
931
- name += qrc.PathChecksum ;
920
+ name += cmStrCat (" _" , qrc.PathChecksum );
932
921
}
933
922
std::vector<std::string> nameOpts;
934
923
nameOpts.emplace_back (" -name" );
@@ -1152,8 +1141,8 @@ bool cmQtAutoGenInitializer::InitRccTargets()
1152
1141
currentLine.push_back (" $<CONFIG>" );
1153
1142
commandLines.push_back (std::move (currentLine));
1154
1143
}
1155
- std::string ccComment = " Automatic RCC for " ;
1156
- ccComment += FileProjectRelativePath (makefile, qrc.QrcFile );
1144
+ std::string ccComment = cmStrCat (
1145
+ " Automatic RCC for " , FileProjectRelativePath (makefile, qrc.QrcFile ) );
1157
1146
1158
1147
if (qrc.Generated || this ->Rcc .GlobalTarget ) {
1159
1148
// Create custom rcc target
@@ -1221,9 +1210,8 @@ bool cmQtAutoGenInitializer::SetupCustomTargets()
1221
1210
{
1222
1211
// Create info directory on demand
1223
1212
if (!cmSystemTools::MakeDirectory (this ->Dir .Info )) {
1224
- std::string emsg = (" AutoGen: Could not create directory: " );
1225
- emsg += Quoted (this ->Dir .Info );
1226
- cmSystemTools::Error (emsg);
1213
+ cmSystemTools::Error (cmStrCat (" AutoGen: Could not create directory: " ,
1214
+ Quoted (this ->Dir .Info )));
1227
1215
return false ;
1228
1216
}
1229
1217
@@ -1306,10 +1294,8 @@ bool cmQtAutoGenInitializer::SetupWriteAutogenInfo()
1306
1294
}
1307
1295
if (muf->MocIt || muf->UicIt ) {
1308
1296
headers.emplace_back (muf->RealPath );
1309
- std::string flags;
1310
- flags += muf->MocIt ? ' M' : ' m' ;
1311
- flags += muf->UicIt ? ' U' : ' u' ;
1312
- headersFlags.emplace_back (std::move (flags));
1297
+ headersFlags.emplace_back (
1298
+ cmStrCat (muf->MocIt ? " M" : " m" , muf->UicIt ? " U" : " u" ));
1313
1299
}
1314
1300
}
1315
1301
}
@@ -1318,14 +1304,13 @@ bool cmQtAutoGenInitializer::SetupWriteAutogenInfo()
1318
1304
cmFilePathChecksum const fpathCheckSum (makefile);
1319
1305
std::unordered_set<std::string> emitted;
1320
1306
for (std::string const & hdr : headers) {
1321
- std::string basePath = fpathCheckSum. getPart (hdr);
1322
- basePath += " /moc_" ;
1323
- basePath += cmSystemTools::GetFilenameWithoutLastExtension (hdr);
1324
- for (unsigned int ii = 1 ; ii != 1024 ; ++ii) {
1307
+ std::string basePath =
1308
+ cmStrCat (fpathCheckSum. getPart (hdr), " /moc_" ,
1309
+ cmSystemTools::GetFilenameWithoutLastExtension (hdr) );
1310
+ for (int ii = 1 ; ii != 1024 ; ++ii) {
1325
1311
std::string path = basePath;
1326
1312
if (ii > 1 ) {
1327
- path += ' _' ;
1328
- path += std::to_string (ii);
1313
+ path += cmStrCat (" _" , ii);
1329
1314
}
1330
1315
path += " .cpp" ;
1331
1316
if (emitted.emplace (path).second ) {
@@ -1364,10 +1349,8 @@ bool cmQtAutoGenInitializer::SetupWriteAutogenInfo()
1364
1349
}
1365
1350
if (muf->MocIt || muf->UicIt ) {
1366
1351
sources.emplace_back (muf->RealPath );
1367
- std::string flags;
1368
- flags += muf->MocIt ? ' M' : ' m' ;
1369
- flags += muf->UicIt ? ' U' : ' u' ;
1370
- sourcesFlags.emplace_back (std::move (flags));
1352
+ sourcesFlags.emplace_back (
1353
+ cmStrCat (muf->MocIt ? " M" : " m" , muf->UicIt ? " U" : " u" ));
1371
1354
}
1372
1355
}
1373
1356
}
@@ -1421,9 +1404,8 @@ bool cmQtAutoGenInitializer::SetupWriteAutogenInfo()
1421
1404
ofs.WriteStrings (" AM_UIC_SEARCH_PATHS" , this ->Uic .SearchPaths );
1422
1405
}
1423
1406
} else {
1424
- std::string err = " AutoGen: Could not write file " ;
1425
- err += this ->AutogenTarget .InfoFile ;
1426
- cmSystemTools::Error (err);
1407
+ cmSystemTools::Error (cmStrCat (" AutoGen: Could not write file " ,
1408
+ this ->AutogenTarget .InfoFile ));
1427
1409
return false ;
1428
1410
}
1429
1411
@@ -1462,9 +1444,8 @@ bool cmQtAutoGenInitializer::SetupWriteRccInfo()
1462
1444
ofs.WriteStrings (" ARCC_OPTIONS" , qrc.Options );
1463
1445
ofs.WriteStrings (" ARCC_INPUTS" , qrc.Resources );
1464
1446
} else {
1465
- std::string err = " AutoRcc: Could not write file " ;
1466
- err += qrc.InfoFile ;
1467
- cmSystemTools::Error (err);
1447
+ cmSystemTools::Error (
1448
+ cmStrCat (" AutoRcc: Could not write file " , qrc.InfoFile ));
1468
1449
return false ;
1469
1450
}
1470
1451
}
@@ -1519,13 +1500,10 @@ bool cmQtAutoGenInitializer::AddToSourceGroup(std::string const& fileName,
1519
1500
if (!groupName.empty ()) {
1520
1501
sourceGroup = makefile->GetOrCreateSourceGroup (groupName);
1521
1502
if (sourceGroup == nullptr ) {
1522
- std::string err;
1523
- err += genNameUpper;
1524
- err += " error in " ;
1525
- err += property;
1526
- err += " : Could not find or create the source group " ;
1527
- err += cmQtAutoGen::Quoted (groupName);
1528
- cmSystemTools::Error (err);
1503
+ cmSystemTools::Error (
1504
+ cmStrCat (genNameUpper, " error in " , property,
1505
+ " : Could not find or create the source group " ,
1506
+ cmQtAutoGen::Quoted (groupName)));
1529
1507
return false ;
1530
1508
}
1531
1509
}
@@ -1617,12 +1595,8 @@ bool cmQtAutoGenInitializer::GetQtExecutable(GenVarsT& genVars,
1617
1595
bool ignoreMissingTarget) const
1618
1596
{
1619
1597
auto print_err = [this , &genVars](std::string const & err) {
1620
- std::string msg = genVars.GenNameUpper ;
1621
- msg += " for target " ;
1622
- msg += this ->Target ->GetName ();
1623
- msg += " : " ;
1624
- msg += err;
1625
- cmSystemTools::Error (msg);
1598
+ cmSystemTools::Error (cmStrCat (genVars.GenNameUpper , " for target " ,
1599
+ this ->Target ->GetName (), " : " , err));
1626
1600
};
1627
1601
1628
1602
// Custom executable
@@ -1682,11 +1656,8 @@ bool cmQtAutoGenInitializer::GetQtExecutable(GenVarsT& genVars,
1682
1656
std::make_shared<cmQtAutoGen::CompilerFeatures>();
1683
1657
return true ;
1684
1658
}
1685
- std::string err = " Could not find " ;
1686
- err += executable;
1687
- err += " executable target " ;
1688
- err += targetName;
1689
- print_err (err);
1659
+ print_err (cmStrCat (" Could not find " , executable, " executable target " ,
1660
+ targetName));
1690
1661
return false ;
1691
1662
}
1692
1663
}
0 commit comments