Skip to content
GitLab
Menu
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
50fbfee3
Commit
50fbfee3
authored
Aug 24, 2018
by
Vitaly Stakhovsky
Committed by
Brad King
Aug 27, 2018
Browse files
cmLocalGenerator: return directories as const std::string&
parent
e33c6c35
Changes
11
Hide whitespace changes
Inline
Side-by-side
Source/cmExtraCodeLiteGenerator.cxx
View file @
50fbfee3
...
...
@@ -122,7 +122,7 @@ std::vector<std::string> cmExtraCodeLiteGenerator::CreateProjectsByTarget(
for
(
cmLocalGenerator
*
lg
:
lgs
)
{
for
(
cmGeneratorTarget
*
lt
:
lg
->
GetGeneratorTargets
())
{
cmStateEnums
::
TargetType
type
=
lt
->
GetType
();
std
::
string
outputDir
=
lg
->
GetCurrentBinaryDirectory
();
std
::
string
const
&
outputDir
=
lg
->
GetCurrentBinaryDirectory
();
std
::
string
targetName
=
lt
->
GetName
();
std
::
string
filename
=
outputDir
+
"/"
+
targetName
+
".project"
;
retval
.
push_back
(
targetName
);
...
...
@@ -161,7 +161,7 @@ std::vector<std::string> cmExtraCodeLiteGenerator::CreateProjectsByProjectMaps(
// for each sub project in the workspace create a codelite project
for
(
auto
const
&
it
:
this
->
GlobalGenerator
->
GetProjectMap
())
{
std
::
string
outputDir
=
it
.
second
[
0
]
->
GetCurrentBinaryDirectory
();
std
::
string
const
&
outputDir
=
it
.
second
[
0
]
->
GetCurrentBinaryDirectory
();
std
::
string
projectName
=
it
.
second
[
0
]
->
GetProjectName
();
retval
.
push_back
(
projectName
);
std
::
string
filename
=
outputDir
+
"/"
+
projectName
+
".project"
;
...
...
@@ -184,7 +184,7 @@ std::vector<std::string> cmExtraCodeLiteGenerator::CreateProjectsByProjectMaps(
void
cmExtraCodeLiteGenerator
::
CreateProjectFile
(
const
std
::
vector
<
cmLocalGenerator
*>&
lgs
)
{
std
::
string
outputDir
=
lgs
[
0
]
->
GetCurrentBinaryDirectory
();
std
::
string
const
&
outputDir
=
lgs
[
0
]
->
GetCurrentBinaryDirectory
();
std
::
string
projectName
=
lgs
[
0
]
->
GetProjectName
();
std
::
string
filename
=
outputDir
+
"/"
;
...
...
Source/cmGeneratorTarget.cxx
View file @
50fbfee3
...
...
@@ -3565,8 +3565,9 @@ bool cmGeneratorTarget::StrictTargetComparison::operator()(
{
int
nameResult
=
strcmp
(
t1
->
GetName
().
c_str
(),
t2
->
GetName
().
c_str
());
if
(
nameResult
==
0
)
{
return
strcmp
(
t1
->
GetLocalGenerator
()
->
GetCurrentBinaryDirectory
(),
t2
->
GetLocalGenerator
()
->
GetCurrentBinaryDirectory
())
<
0
;
return
strcmp
(
t1
->
GetLocalGenerator
()
->
GetCurrentBinaryDirectory
().
c_str
(),
t2
->
GetLocalGenerator
()
->
GetCurrentBinaryDirectory
().
c_str
())
<
0
;
}
return
nameResult
<
0
;
}
...
...
Source/cmGlobalNinjaGenerator.cxx
View file @
50fbfee3
...
...
@@ -1011,8 +1011,7 @@ void cmGlobalNinjaGenerator::AppendTargetDepends(
std
::
set
<
std
::
string
>
const
&
utils
=
target
->
GetUtilities
();
for
(
std
::
string
const
&
util
:
utils
)
{
std
::
string
d
=
target
->
GetLocalGenerator
()
->
GetCurrentBinaryDirectory
()
+
std
::
string
(
"/"
)
+
util
;
target
->
GetLocalGenerator
()
->
GetCurrentBinaryDirectory
()
+
"/"
+
util
;
outputs
.
push_back
(
this
->
ConvertToNinjaPath
(
d
));
}
}
else
{
...
...
Source/cmGlobalVisualStudio10Generator.cxx
View file @
50fbfee3
...
...
@@ -1014,7 +1014,7 @@ void cmGlobalVisualStudio10Generator::PathTooLong(cmGeneratorTarget* target,
std
::
string
const
&
sfRel
)
{
size_t
len
=
(
strlen
(
target
->
GetLocalGenerator
()
->
GetCurrentBinaryDirectory
())
+
1
+
(
target
->
GetLocalGenerator
()
->
GetCurrentBinaryDirectory
()
.
length
(
)
+
1
+
sfRel
.
length
());
if
(
len
>
this
->
LongestSource
.
Length
)
{
this
->
LongestSource
.
Length
=
len
;
...
...
Source/cmGlobalXCodeGenerator.cxx
View file @
50fbfee3
...
...
@@ -3040,7 +3040,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
// Point Xcode at the top of the source tree.
{
std
::
string
pdir
=
this
->
RelativeToBinary
(
root
->
GetCurrentSourceDirectory
());
this
->
RelativeToBinary
(
root
->
GetCurrentSourceDirectory
()
.
c_str
()
);
this
->
RootObject
->
AddAttribute
(
"projectDirPath"
,
this
->
CreateString
(
pdir
));
this
->
RootObject
->
AddAttribute
(
"projectRoot"
,
this
->
CreateString
(
""
));
}
...
...
Source/cmLocalGenerator.cxx
View file @
50fbfee3
...
...
@@ -2522,14 +2522,14 @@ std::string const& cmLocalGenerator::GetBinaryDirectory() const
return
this
->
GetCMakeInstance
()
->
GetHomeOutputDirectory
();
}
const
char
*
cmLocalGenerator
::
GetCurrentBinaryDirectory
()
const
std
::
string
const
&
cmLocalGenerator
::
GetCurrentBinaryDirectory
()
const
{
return
this
->
StateSnapshot
.
GetDirectory
().
GetCurrentBinary
()
.
c_str
()
;
return
this
->
StateSnapshot
.
GetDirectory
().
GetCurrentBinary
();
}
const
char
*
cmLocalGenerator
::
GetCurrentSourceDirectory
()
const
std
::
string
const
&
cmLocalGenerator
::
GetCurrentSourceDirectory
()
const
{
return
this
->
StateSnapshot
.
GetDirectory
().
GetCurrentSource
()
.
c_str
()
;
return
this
->
StateSnapshot
.
GetDirectory
().
GetCurrentSource
();
}
std
::
string
cmLocalGenerator
::
GetTargetDirectory
(
...
...
Source/cmLocalGenerator.h
View file @
50fbfee3
...
...
@@ -296,8 +296,8 @@ public:
std
::
string
const
&
GetSourceDirectory
()
const
;
std
::
string
const
&
GetBinaryDirectory
()
const
;
const
char
*
GetCurrentBinaryDirectory
()
const
;
const
char
*
GetCurrentSourceDirectory
()
const
;
std
::
string
const
&
GetCurrentBinaryDirectory
()
const
;
std
::
string
const
&
GetCurrentSourceDirectory
()
const
;
/**
* Generate a Mac OS X application bundle Info.plist file.
...
...
Source/cmLocalVisualStudio7Generator.cxx
View file @
50fbfee3
...
...
@@ -118,7 +118,7 @@ void cmLocalVisualStudio7Generator::WriteProjectFiles()
if
(
this
->
GetCurrentBinaryDirectory
()
!=
this
->
GetSourceDirectory
())
{
if
(
!
cmSystemTools
::
MakeDirectory
(
this
->
GetCurrentBinaryDirectory
()))
{
cmSystemTools
::
Error
(
"Error creating directory "
,
this
->
GetCurrentBinaryDirectory
());
this
->
GetCurrentBinaryDirectory
()
.
c_str
()
);
}
}
...
...
Source/cmMakefileExecutableTargetGenerator.cxx
View file @
50fbfee3
...
...
@@ -456,7 +456,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
// clean set just in case.
exeCleanFiles
.
push_back
(
this
->
LocalGenerator
->
MaybeConvertToRelativePath
(
this
->
LocalGenerator
->
GetCurrentBinaryDirectory
(),
(
targetFullPath
+
".manifest"
)
.
c_str
())
);
targetFullPath
+
".manifest"
));
#endif
if
(
targetNameReal
!=
targetName
)
{
exeCleanFiles
.
push_back
(
this
->
LocalGenerator
->
MaybeConvertToRelativePath
(
...
...
Source/cmMakefileLibraryTargetGenerator.cxx
View file @
50fbfee3
...
...
@@ -635,7 +635,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
if
(
this
->
GeneratorTarget
->
GetType
()
!=
cmStateEnums
::
STATIC_LIBRARY
)
{
libCleanFiles
.
push_back
(
this
->
LocalGenerator
->
MaybeConvertToRelativePath
(
this
->
LocalGenerator
->
GetCurrentBinaryDirectory
(),
(
targetFullPath
+
".manifest"
)
.
c_str
())
);
targetFullPath
+
".manifest"
));
}
#endif
...
...
Source/cmVisualStudio10TargetGenerator.cxx
View file @
50fbfee3
...
...
@@ -250,7 +250,7 @@ cmVisualStudio10TargetGenerator::cmVisualStudio10TargetGenerator(
this
->
TargetCompileAsWinRT
=
false
;
this
->
IsMissingFiles
=
false
;
this
->
DefaultArtifactDir
=
this
->
LocalGenerator
->
GetCurrentBinaryDirectory
()
+
std
::
string
(
"/"
)
+
this
->
LocalGenerator
->
GetCurrentBinaryDirectory
()
+
"/"
+
this
->
LocalGenerator
->
GetTargetDirectory
(
this
->
GeneratorTarget
);
this
->
InSourceBuild
=
(
strcmp
(
this
->
Makefile
->
GetCurrentSourceDirectory
(),
...
...
@@ -1877,7 +1877,7 @@ void cmVisualStudio10TargetGenerator::WriteSource(Elem& e2,
std
::
string
sourceRel
=
this
->
ConvertPath
(
sf
->
GetFullPath
(),
true
);
size_t
const
maxLen
=
250
;
if
(
sf
->
GetCustomCommand
()
||
((
strlen
(
this
->
LocalGenerator
->
GetCurrentBinaryDirectory
())
+
1
+
((
this
->
LocalGenerator
->
GetCurrentBinaryDirectory
()
.
length
(
)
+
1
+
sourceRel
.
length
())
<=
maxLen
))
{
forceRelative
=
true
;
sourceFile
=
sourceRel
;
...
...
@@ -4131,8 +4131,7 @@ void cmVisualStudio10TargetGenerator::WriteMissingFilesWP80(Elem& e1)
// this can cause an overwrite problem if projects aren't organized in
// folders
std
::
string
manifestFile
=
this
->
LocalGenerator
->
GetCurrentBinaryDirectory
()
+
std
::
string
(
"/WMAppManifest.xml"
);
this
->
LocalGenerator
->
GetCurrentBinaryDirectory
()
+
"/WMAppManifest.xml"
;
std
::
string
artifactDir
=
this
->
LocalGenerator
->
GetTargetDirectory
(
this
->
GeneratorTarget
);
ConvertToWindowsSlash
(
artifactDir
);
...
...
Brad King
💬
@brad.king
mentioned in commit
9da844d8
·
Aug 28, 2018
mentioned in commit
9da844d8
mentioned in commit 9da844d8cbbd2c525265a551421dbf126ef328d1
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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