Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
CMake
CMake
Commits
99337d34
Commit
99337d34
authored
Jan 23, 2019
by
Vitaly Stakhovsky
Browse files
cmSystemTools::Error(): new overload accepting std::string
parent
a7f5cd45
Changes
23
Hide whitespace changes
Inline
Side-by-side
Source/cmCPluginAPI.cxx
View file @
99337d34
...
...
@@ -720,7 +720,7 @@ void CCONV cmSourceFileSetName(void* arg, const char* name, const char* dir,
ext
!=
headerExts
.
end
();
++
ext
)
{
e
<<
" ."
<<
*
ext
;
}
cmSystemTools
::
Error
(
e
.
str
()
.
c_str
()
);
cmSystemTools
::
Error
(
e
.
str
());
}
void
CCONV
cmSourceFileSetName2
(
void
*
arg
,
const
char
*
name
,
const
char
*
dir
,
...
...
Source/cmCTest.cxx
View file @
99337d34
...
...
@@ -2173,7 +2173,7 @@ int cmCTest::Run(std::vector<std::string>& args, std::string* output)
// handle the simple commandline arguments
std
::
string
errormsg
;
if
(
!
this
->
HandleCommandLineArguments
(
i
,
args
,
errormsg
))
{
cmSystemTools
::
Error
(
errormsg
.
c_str
()
);
cmSystemTools
::
Error
(
errormsg
);
return
1
;
}
...
...
Source/cmCacheManager.cxx
View file @
99337d34
...
...
@@ -123,7 +123,7 @@ bool cmCacheManager::LoadCache(const std::string& path, bool internal,
std
::
ostringstream
error
;
error
<<
"Parse error in cache file "
<<
cacheFile
;
error
<<
" on line "
<<
lineno
<<
". Offending entry: "
<<
realbuffer
;
cmSystemTools
::
Error
(
error
.
str
()
.
c_str
()
);
cmSystemTools
::
Error
(
error
.
str
());
}
}
this
->
CacheMajorVersion
=
0
;
...
...
@@ -171,7 +171,7 @@ bool cmCacheManager::LoadCache(const std::string& path, bool internal,
<<
" where CMakeCache.txt was created. This may result "
"in binaries being created in the wrong place. If you "
"are not sure, reedit the CMakeCache.txt"
;
cmSystemTools
::
Error
(
message
.
str
()
.
c_str
()
);
cmSystemTools
::
Error
(
message
.
str
());
}
}
return
true
;
...
...
Source/cmComputeLinkInformation.cxx
View file @
99337d34
...
...
@@ -1237,7 +1237,7 @@ void cmComputeLinkInformation::AddFrameworkItem(std::string const& item)
std
::
ostringstream
e
;
e
<<
"Could not parse framework path
\"
"
<<
item
<<
"
\"
"
<<
"linked by target "
<<
this
->
Target
->
GetName
()
<<
"."
;
cmSystemTools
::
Error
(
e
.
str
()
.
c_str
()
);
cmSystemTools
::
Error
(
e
.
str
());
return
;
}
...
...
Source/cmComputeTargetDepends.cxx
View file @
99337d34
...
...
@@ -495,7 +495,7 @@ void cmComputeTargetDepends::ComplainAboutBadComponent(
e
<<
"At least one of these targets is not a STATIC_LIBRARY. "
<<
"Cyclic dependencies are allowed only among static libraries."
;
}
cmSystemTools
::
Error
(
e
.
str
()
.
c_str
()
);
cmSystemTools
::
Error
(
e
.
str
());
}
bool
cmComputeTargetDepends
::
IntraComponent
(
std
::
vector
<
int
>
const
&
cmap
,
...
...
Source/cmExportFileGenerator.cxx
View file @
99337d34
...
...
@@ -83,7 +83,7 @@ bool cmExportFileGenerator::GenerateImportFile()
std
::
string
se
=
cmSystemTools
::
GetLastSystemError
();
std
::
ostringstream
e
;
e
<<
"cannot write to file
\"
"
<<
this
->
MainImportFile
<<
"
\"
: "
<<
se
;
cmSystemTools
::
Error
(
e
.
str
()
.
c_str
()
);
cmSystemTools
::
Error
(
e
.
str
());
return
false
;
}
std
::
ostream
&
os
=
*
foutPtr
;
...
...
Source/cmExportInstallFileGenerator.cxx
View file @
99337d34
...
...
@@ -54,7 +54,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
<<
"
\"
...) "
<<
"includes target
\"
"
<<
te
->
Target
->
GetName
()
<<
"
\"
more than once in the export set."
;
cmSystemTools
::
Error
(
e
.
str
()
.
c_str
()
);
cmSystemTools
::
Error
(
e
.
str
());
return
false
;
}
}
...
...
@@ -112,7 +112,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
std
::
string
errorMessage
;
if
(
!
this
->
PopulateExportProperties
(
gt
,
properties
,
errorMessage
))
{
cmSystemTools
::
Error
(
errorMessage
.
c_str
()
);
cmSystemTools
::
Error
(
errorMessage
);
return
false
;
}
...
...
@@ -294,7 +294,7 @@ bool cmExportInstallFileGenerator::GenerateImportFileConfig(
std
::
string
se
=
cmSystemTools
::
GetLastSystemError
();
std
::
ostringstream
e
;
e
<<
"cannot write to file
\"
"
<<
fileName
<<
"
\"
: "
<<
se
;
cmSystemTools
::
Error
(
e
.
str
()
.
c_str
()
);
cmSystemTools
::
Error
(
e
.
str
());
return
false
;
}
std
::
ostream
&
os
=
exportFileStream
;
...
...
@@ -518,7 +518,7 @@ void cmExportInstallFileGenerator::ComplainAboutMissingTarget(
e
<<
"that is not in this export set, but "
<<
occurrences
<<
" times in others."
;
}
cmSystemTools
::
Error
(
e
.
str
()
.
c_str
()
);
cmSystemTools
::
Error
(
e
.
str
());
}
std
::
string
cmExportInstallFileGenerator
::
InstallNameDir
(
...
...
Source/cmGeneratorTarget.cxx
View file @
99337d34
...
...
@@ -203,7 +203,7 @@ std::string cmGeneratorTarget::GetExportName() const
std
::
ostringstream
e
;
e
<<
"EXPORT_NAME property
\"
"
<<
exportName
<<
"
\"
for
\"
"
<<
this
->
GetName
()
<<
"
\"
: is not valid."
;
cmSystemTools
::
Error
(
e
.
str
()
.
c_str
()
);
cmSystemTools
::
Error
(
e
.
str
());
return
""
;
}
return
exportName
;
...
...
@@ -4587,7 +4587,7 @@ PropertyType checkInterfacePropertyCompatibility(cmGeneratorTarget const* tgt,
<<
" property requirement
\n
of "
"dependency
\"
"
<<
theTarget
->
GetName
()
<<
"
\"
.
\n
"
;
cmSystemTools
::
Error
(
e
.
str
()
.
c_str
()
);
cmSystemTools
::
Error
(
e
.
str
());
break
;
}
propContent
=
consistent
.
second
;
...
...
@@ -4612,7 +4612,7 @@ PropertyType checkInterfacePropertyCompatibility(cmGeneratorTarget const* tgt,
"already. The INTERFACE_"
<<
p
<<
" property on
\n
dependency
\"
"
<<
theTarget
->
GetName
()
<<
"
\"
is in conflict.
\n
"
;
cmSystemTools
::
Error
(
e
.
str
()
.
c_str
()
);
cmSystemTools
::
Error
(
e
.
str
());
break
;
}
propContent
=
consistent
.
second
;
...
...
@@ -4632,7 +4632,7 @@ PropertyType checkInterfacePropertyCompatibility(cmGeneratorTarget const* tgt,
e
<<
"The INTERFACE_"
<<
p
<<
" property of
\"
"
<<
theTarget
->
GetName
()
<<
"
\"
does
\n
not agree with the value of "
<<
p
<<
" already determined
\n
for
\"
"
<<
tgt
->
GetName
()
<<
"
\"
.
\n
"
;
cmSystemTools
::
Error
(
e
.
str
()
.
c_str
()
);
cmSystemTools
::
Error
(
e
.
str
());
break
;
}
propContent
=
consistent
.
second
;
...
...
Source/cmGlobVerificationManager.cxx
View file @
99337d34
...
...
@@ -165,7 +165,7 @@ void cmGlobVerificationManager::AddCacheEntry(
message
<<
"
\n
"
<<
std
::
get
<
0
>
(
bt
);
std
::
get
<
1
>
(
bt
).
PrintTitle
(
message
);
}
cmSystemTools
::
Error
(
message
.
str
()
.
c_str
()
);
cmSystemTools
::
Error
(
message
.
str
());
}
else
{
value
.
Backtraces
.
emplace_back
(
variable
,
backtrace
);
}
...
...
Source/cmGlobalGenerator.cxx
View file @
99337d34
...
...
@@ -364,7 +364,7 @@ bool cmGlobalGenerator::FindMakeProgram(cmMakefile* mf)
err
<<
"CMake was unable to find a build program corresponding to
\"
"
<<
this
->
GetName
()
<<
"
\"
. CMAKE_MAKE_PROGRAM is not set. You "
<<
"probably need to select a different build tool."
;
cmSystemTools
::
Error
(
err
.
str
()
.
c_str
()
);
cmSystemTools
::
Error
(
err
.
str
());
cmSystemTools
::
SetFatalErrorOccured
();
return
false
;
}
...
...
@@ -1282,7 +1282,7 @@ bool cmGlobalGenerator::CheckALLOW_DUPLICATE_CUSTOM_TARGETS() const
<<
"duplicate custom targets. "
<<
"Consider using a Makefiles generator or fix the project to not "
<<
"use duplicate target names."
;
cmSystemTools
::
Error
(
e
.
str
()
.
c_str
()
);
cmSystemTools
::
Error
(
e
.
str
());
return
false
;
}
...
...
Source/cmGlobalGhsMultiGenerator.cxx
View file @
99337d34
...
...
@@ -93,7 +93,7 @@ bool cmGlobalGhsMultiGenerator::SetGeneratorToolset(std::string const& ts,
message
+=
prevTool
;
message
+=
"
\n
Either remove the CMakeCache.txt file and CMakeFiles "
"directory or choose a different binary directory."
;
cmSystemTools
::
Error
(
message
.
c_str
()
);
cmSystemTools
::
Error
(
message
);
return
false
;
}
else
{
/* store the toolset that is being used for this build */
...
...
@@ -178,7 +178,7 @@ void cmGlobalGhsMultiGenerator::GetToolset(cmMakefile* mf, std::string& tsd,
if
(
output
.
empty
())
{
std
::
string
msg
=
"No GHS toolsets found in GHS_TOOLSET_ROOT
\"
"
+
tsd
+
"
\"
."
;
cmSystemTools
::
Error
(
msg
.
c_str
()
);
cmSystemTools
::
Error
(
msg
);
tsd
=
""
;
}
else
{
tsd
+=
output
.
back
();
...
...
@@ -189,7 +189,7 @@ void cmGlobalGhsMultiGenerator::GetToolset(cmMakefile* mf, std::string& tsd,
tryPath
=
cmSystemTools
::
CollapseCombinedPath
(
tsd
,
ts
);
if
(
!
cmSystemTools
::
FileExists
(
tryPath
))
{
std
::
string
msg
=
"GHS toolset
\"
"
+
tryPath
+
"
\"
not found."
;
cmSystemTools
::
Error
(
msg
.
c_str
()
);
cmSystemTools
::
Error
(
msg
);
tsd
=
""
;
}
else
{
tsd
=
tryPath
;
...
...
Source/cmGlobalVisualStudio71Generator.cxx
View file @
99337d34
...
...
@@ -149,7 +149,7 @@ void cmGlobalVisualStudio71Generator::WriteProjectDepends(
m
+=
target
->
GetName
();
m
+=
" depends on unknown target: "
;
m
+=
name
;
cmSystemTools
::
Error
(
m
.
c_str
()
);
cmSystemTools
::
Error
(
m
);
}
fout
<<
"
\t\t
{"
<<
guid
<<
"} = {"
<<
guid
<<
"}
\n
"
;
}
...
...
Source/cmInstallExportGenerator.cxx
View file @
99337d34
...
...
@@ -127,7 +127,7 @@ void cmInstallExportGenerator::GenerateScript(std::ostream& os)
std
::
ostringstream
e
;
e
<<
"INSTALL(EXPORT) given unknown export
\"
"
<<
ExportSet
->
GetName
()
<<
"
\"
"
;
cmSystemTools
::
Error
(
e
.
str
()
.
c_str
()
);
cmSystemTools
::
Error
(
e
.
str
());
return
;
}
...
...
Source/cmLocalGenerator.cxx
View file @
99337d34
...
...
@@ -1794,7 +1794,7 @@ static void AddVisibilityCompileOption(std::string& flags,
std
::
ostringstream
e
;
e
<<
"Target "
<<
target
->
GetName
()
<<
" uses unsupported value
\"
"
<<
prop
<<
"
\"
for "
<<
flagDefine
<<
"."
;
cmSystemTools
::
Error
(
e
.
str
()
.
c_str
()
);
cmSystemTools
::
Error
(
e
.
str
());
return
;
}
std
::
string
option
=
std
::
string
(
opt
)
+
prop
;
...
...
@@ -2800,7 +2800,7 @@ void cmLocalGenerator::GenerateAppleInfoPList(cmGeneratorTarget* target,
std
::
ostringstream
e
;
e
<<
"Target "
<<
target
->
GetName
()
<<
" Info.plist template
\"
"
<<
inFile
<<
"
\"
could not be found."
;
cmSystemTools
::
Error
(
e
.
str
()
.
c_str
()
);
cmSystemTools
::
Error
(
e
.
str
());
return
;
}
...
...
@@ -2838,7 +2838,7 @@ void cmLocalGenerator::GenerateFrameworkInfoPList(
std
::
ostringstream
e
;
e
<<
"Target "
<<
target
->
GetName
()
<<
" Info.plist template
\"
"
<<
inFile
<<
"
\"
could not be found."
;
cmSystemTools
::
Error
(
e
.
str
()
.
c_str
()
);
cmSystemTools
::
Error
(
e
.
str
());
return
;
}
...
...
Source/cmOutputRequiredFilesCommand.cxx
View file @
99337d34
...
...
@@ -194,7 +194,7 @@ protected:
message
+=
includeFile
;
message
+=
" for file "
;
message
+=
info
->
FullPath
;
cmSystemTools
::
Error
(
message
.
c_str
(),
nullptr
);
cmSystemTools
::
Error
(
message
);
}
continue
;
}
...
...
Source/cmQtAutoGenInitializer.cxx
View file @
99337d34
...
...
@@ -111,7 +111,7 @@ static bool AddToSourceGroup(cmMakefile* makefile, std::string const& fileName,
ost
<<
": "
<<
property
;
ost
<<
": Could not find or create the source group "
;
ost
<<
cmQtAutoGen
::
Quoted
(
groupName
);
cmSystemTools
::
Error
(
ost
.
str
()
.
c_str
()
);
cmSystemTools
::
Error
(
ost
.
str
());
return
false
;
}
}
...
...
@@ -941,7 +941,7 @@ bool cmQtAutoGenInitializer::InitScanFiles()
if
(
!
qrc
.
Generated
)
{
std
::
string
error
;
if
(
!
RccListInputs
(
qrc
.
QrcFile
,
qrc
.
Resources
,
error
))
{
cmSystemTools
::
Error
(
error
.
c_str
()
);
cmSystemTools
::
Error
(
error
);
return
false
;
}
}
...
...
@@ -1219,7 +1219,7 @@ bool cmQtAutoGenInitializer::SetupCustomTargets()
if
(
!
cmSystemTools
::
MakeDirectory
(
this
->
Dir
.
Info
))
{
std
::
string
emsg
=
(
"AutoGen: Could not create directory: "
);
emsg
+=
Quoted
(
this
->
Dir
.
Info
);
cmSystemTools
::
Error
(
emsg
.
c_str
()
);
cmSystemTools
::
Error
(
emsg
);
return
false
;
}
...
...
@@ -1307,7 +1307,7 @@ bool cmQtAutoGenInitializer::SetupWriteAutogenInfo()
}
else
{
std
::
string
err
=
"AutoGen: Could not write file "
;
err
+=
this
->
AutogenTarget
.
InfoFile
;
cmSystemTools
::
Error
(
err
.
c_str
()
);
cmSystemTools
::
Error
(
err
);
return
false
;
}
...
...
@@ -1347,7 +1347,7 @@ bool cmQtAutoGenInitializer::SetupWriteRccInfo()
}
else
{
std
::
string
err
=
"AutoRcc: Could not write file "
;
err
+=
qrc
.
InfoFile
;
cmSystemTools
::
Error
(
err
.
c_str
()
);
cmSystemTools
::
Error
(
err
);
return
false
;
}
}
...
...
@@ -1512,7 +1512,7 @@ std::pair<bool, std::string> GetQtExecutable(
msg
+=
target
->
GetName
();
msg
+=
"): "
;
msg
+=
err
;
cmSystemTools
::
Error
(
msg
.
c_str
()
);
cmSystemTools
::
Error
(
msg
);
return
std
::
make_pair
(
false
,
""
);
}
...
...
Source/cmSystemTools.cxx
View file @
99337d34
...
...
@@ -270,6 +270,13 @@ void cmSystemTools::Error(const char* m1, const char* m2, const char* m3,
cmSystemTools
::
Message
(
message
.
c_str
(),
"Error"
);
}
void
cmSystemTools
::
Error
(
const
std
::
string
&
m
)
{
std
::
string
message
=
"CMake Error: "
+
m
;
cmSystemTools
::
s_ErrorOccured
=
true
;
cmSystemTools
::
Message
(
message
.
c_str
(),
"Error"
);
}
void
cmSystemTools
::
SetInterruptCallback
(
InterruptCallback
f
,
void
*
clientData
)
{
s_InterruptCallback
=
f
;
...
...
@@ -338,7 +345,7 @@ void cmSystemTools::ReportLastSystemError(const char* msg)
std
::
string
m
=
msg
;
m
+=
": System Error: "
;
m
+=
Superclass
::
GetLastSystemError
();
cmSystemTools
::
Error
(
m
.
c_str
()
);
cmSystemTools
::
Error
(
m
);
}
bool
cmSystemTools
::
IsInternallyOn
(
const
char
*
val
)
...
...
@@ -549,7 +556,7 @@ std::vector<std::string> cmSystemTools::HandleResponseFile(
error
+=
cmSystemTools
::
GetLastSystemError
();
error
+=
"):
\n
"
;
error
+=
arg
.
substr
(
1
);
cmSystemTools
::
Error
(
error
.
c_str
()
);
cmSystemTools
::
Error
(
error
);
}
else
{
std
::
string
line
;
cmSystemTools
::
GetLineFromStream
(
responseFile
,
line
);
...
...
@@ -1651,7 +1658,7 @@ bool cmSystemTools::CreateTar(const char* outFileName,
e
+=
outFileName
;
e
+=
"
\"
: "
;
e
+=
cmSystemTools
::
GetLastSystemError
();
cmSystemTools
::
Error
(
e
.
c_str
()
);
cmSystemTools
::
Error
(
e
);
return
false
;
}
cmArchiveWrite
::
Compress
compress
=
cmArchiveWrite
::
CompressNone
;
...
...
@@ -1684,7 +1691,7 @@ bool cmSystemTools::CreateTar(const char* outFileName,
}
}
if
(
!
a
)
{
cmSystemTools
::
Error
(
a
.
GetError
()
.
c_str
()
);
cmSystemTools
::
Error
(
a
.
GetError
());
return
false
;
}
return
true
;
...
...
@@ -3120,7 +3127,7 @@ bool cmSystemTools::CreateSymlink(const std::string& origName,
if
(
errorMessage
)
{
*
errorMessage
=
std
::
move
(
e
);
}
else
{
cmSystemTools
::
Error
(
e
.
c_str
()
);
cmSystemTools
::
Error
(
e
);
}
return
false
;
}
...
...
@@ -3141,7 +3148,7 @@ bool cmSystemTools::CreateLink(const std::string& origName,
if
(
errorMessage
)
{
*
errorMessage
=
std
::
move
(
e
);
}
else
{
cmSystemTools
::
Error
(
e
.
c_str
()
);
cmSystemTools
::
Error
(
e
);
}
return
false
;
}
...
...
Source/cmSystemTools.h
View file @
99337d34
...
...
@@ -70,6 +70,7 @@ public:
*/
static
void
Error
(
const
char
*
m
,
const
char
*
m2
=
nullptr
,
const
char
*
m3
=
nullptr
,
const
char
*
m4
=
nullptr
);
static
void
Error
(
const
std
::
string
&
m
);
/**
* Display a message.
...
...
Source/cmTryRunCommand.cxx
View file @
99337d34
...
...
@@ -121,7 +121,7 @@ bool cmTryRunCommand::InitialPass(std::vector<std::string> const& argv,
// now try running the command if it compiled
if
(
!
res
)
{
if
(
this
->
OutputFile
.
empty
())
{
cmSystemTools
::
Error
(
this
->
FindErrorMessage
.
c_str
()
);
cmSystemTools
::
Error
(
this
->
FindErrorMessage
);
}
else
{
// "run" it and capture the output
std
::
string
runOutputContents
;
...
...
@@ -354,7 +354,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs,
errorMessage
+=
" "
+
internalRunOutputName
+
" (advanced)
\n
"
;
}
errorMessage
+=
detailsString
;
cmSystemTools
::
Error
(
errorMessage
.
c_str
()
);
cmSystemTools
::
Error
(
errorMessage
);
return
;
}
...
...
Source/cmVariableRequiresCommand.cxx
View file @
99337d34
...
...
@@ -57,7 +57,7 @@ bool cmVariableRequiresCommand::InitialPass(
"One or more of the required variables is advanced."
" To set the variable, you must turn on advanced mode in cmake."
;
}
cmSystemTools
::
Error
(
message
.
c_str
()
);
cmSystemTools
::
Error
(
message
);
}
return
true
;
...
...
Prev
1
2
Next
Brad King
@brad.king
mentioned in commit
9f84cbd8
·
Jan 25, 2019
mentioned in commit
9f84cbd8
mentioned in commit 9f84cbd8c323a5a59b666a8bc8199e52a181bb35
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment