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
34c6e995
Commit
34c6e995
authored
Sep 06, 2016
by
Stephen Kelly
Browse files
Convert: Avoid HOME_OUTPUT enum when converting to relative paths
parent
839c65bc
Changes
9
Hide whitespace changes
Inline
Side-by-side
Source/cmDependsC.cxx
View file @
34c6e995
...
...
@@ -240,7 +240,7 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
// convert the dependencies to paths relative to the home output
// directory. We must do the same here.
std
::
string
obj_i
=
this
->
LocalGenerator
->
ConvertToRelativePath
(
obj
,
cmOutputConverter
::
HOME_OUTPUT
);
this
->
LocalGenerator
->
GetBinaryDirectory
(),
obj
);
std
::
string
obj_m
=
this
->
LocalGenerator
->
ConvertToOutputFormat
(
obj_i
,
cmOutputConverter
::
MAKERULE
);
internalDepends
<<
obj_i
<<
std
::
endl
;
...
...
Source/cmDependsFortran.cxx
View file @
34c6e995
...
...
@@ -332,7 +332,7 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj,
// Write the include dependencies to the output stream.
std
::
string
obj_i
=
this
->
LocalGenerator
->
ConvertToRelativePath
(
obj
,
cmOutputConverter
::
HOME_OUTPUT
);
this
->
LocalGenerator
->
GetBinaryDirectory
(),
obj
);
std
::
string
obj_m
=
this
->
LocalGenerator
->
ConvertToOutputFormat
(
obj_i
,
cmOutputConverter
::
MAKERULE
);
internalDepends
<<
obj_i
<<
std
::
endl
;
...
...
Source/cmExtraEclipseCDT4Generator.cxx
View file @
34c6e995
...
...
@@ -914,7 +914,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
const
std
::
vector
<
cmGeneratorTarget
*>
targets
=
(
*
it
)
->
GetGeneratorTargets
();
std
::
string
subdir
=
(
*
it
)
->
ConvertToRelativePath
(
(
*
it
)
->
Get
Current
BinaryDirectory
(),
cmOutputConverter
::
HOME_OUTPUT
);
(
*
it
)
->
GetBinaryDirectory
(),
(
*
it
)
->
GetCurrentBinaryDirectory
()
);
if
(
subdir
==
"."
)
{
subdir
=
""
;
}
...
...
Source/cmGlobalGenerator.cxx
View file @
34c6e995
...
...
@@ -2579,7 +2579,7 @@ void cmGlobalGenerator::AddRuleHash(const std::vector<std::string>& outputs,
// Shorten the output name (in expected use case).
cmOutputConverter
converter
(
this
->
GetMakefiles
()[
0
]
->
GetStateSnapshot
());
std
::
string
fname
=
converter
.
ConvertToRelativePath
(
outputs
[
0
],
cmOutputConverter
::
HOME_OUTPUT
);
this
->
GetMakefiles
()[
0
]
->
GetState
()
->
GetBinaryDirectory
(),
outputs
[
0
]
);
// Associate the hash with this output.
this
->
RuleHashes
[
fname
]
=
hash
;
...
...
Source/cmGlobalNinjaGenerator.cxx
View file @
34c6e995
...
...
@@ -760,8 +760,8 @@ std::string cmGlobalNinjaGenerator::ConvertToNinjaPath(const std::string& path)
{
cmLocalNinjaGenerator
*
ng
=
static_cast
<
cmLocalNinjaGenerator
*>
(
this
->
LocalGenerators
[
0
]);
std
::
string
convPath
=
ng
->
ConvertToRelativePath
(
path
,
cmOutputConverter
::
HOME_OUTPUT
);
std
::
string
convPath
=
ng
->
ConvertToRelativePath
(
this
->
LocalGenerators
[
0
]
->
GetState
()
->
GetBinaryDirectory
(),
path
);
convPath
=
this
->
NinjaOutputPath
(
convPath
);
#ifdef _WIN32
std
::
replace
(
convPath
.
begin
(),
convPath
.
end
(),
'/'
,
'\\'
);
...
...
Source/cmGlobalUnixMakefileGenerator3.cxx
View file @
34c6e995
...
...
@@ -356,8 +356,8 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
for
(
std
::
vector
<
std
::
string
>::
const_iterator
k
=
outfiles
.
begin
();
k
!=
outfiles
.
end
();
++
k
)
{
cmakefileStream
<<
"
\"
"
<<
lg
->
ConvertToRelativePath
(
*
k
,
cmOutputConverter
::
HOME_OUTPUT
)
<<
lg
->
ConvertToRelativePath
(
lg
->
GetBinaryDirectory
(),
*
k
)
<<
"
\"\n
"
;
}
...
...
@@ -370,8 +370,8 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
tmpStr
+=
cmake
::
GetCMakeFilesDirectory
();
tmpStr
+=
"/CMakeDirectoryInformation.cmake"
;
cmakefileStream
<<
"
\"
"
<<
lg
->
ConvertToRelativePath
(
tmpStr
,
cmOutputConverter
::
HOME_OUTPUT
)
<<
lg
->
ConvertToRelativePath
(
lg
->
GetBinaryDirectory
(),
tmpStr
)
<<
"
\"\n
"
;
}
cmakefileStream
<<
" )
\n\n
"
;
...
...
@@ -532,7 +532,8 @@ void cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
tname
+=
"/fast"
;
}
cmOutputConverter
conv
(
mf
->
GetStateSnapshot
());
tname
=
conv
.
ConvertToRelativePath
(
tname
,
cmOutputConverter
::
HOME_OUTPUT
);
tname
=
conv
.
ConvertToRelativePath
(
mf
->
GetState
()
->
GetBinaryDirectory
(),
tname
);
cmSystemTools
::
ConvertToOutputSlashes
(
tname
);
makeCommand
.
push_back
(
tname
);
if
(
this
->
Makefiles
.
empty
())
{
...
...
Source/cmLocalNinjaGenerator.cxx
View file @
34c6e995
...
...
@@ -51,7 +51,7 @@ void cmLocalNinjaGenerator::Generate()
// Compute the path to use when referencing the current output
// directory from the top output directory.
this
->
HomeRelativeOutputPath
=
this
->
ConvertToRelativePath
(
this
->
Get
Current
BinaryDirectory
(),
cmOutputConverter
::
HOME_OUTPUT
);
this
->
GetBinaryDirectory
(),
this
->
GetCurrentBinaryDirectory
()
);
if
(
this
->
HomeRelativeOutputPath
==
"."
)
{
this
->
HomeRelativeOutputPath
=
""
;
}
...
...
Source/cmLocalUnixMakefileGenerator3.cxx
View file @
34c6e995
...
...
@@ -151,7 +151,7 @@ void cmLocalUnixMakefileGenerator3::ComputeHomeRelativeOutputPath()
// Compute the path to use when referencing the current output
// directory from the top output directory.
this
->
HomeRelativeOutputPath
=
this
->
ConvertToRelativePath
(
this
->
Get
Current
BinaryDirectory
(),
cmOutputConverter
::
HOME_OUTPUT
);
this
->
GetBinaryDirectory
(),
this
->
GetCurrentBinaryDirectory
()
);
if
(
this
->
HomeRelativeOutputPath
==
"."
)
{
this
->
HomeRelativeOutputPath
=
""
;
}
...
...
@@ -1865,7 +1865,7 @@ void cmLocalUnixMakefileGenerator3::WriteDependLanguageInfo(
i
!=
includes
.
end
();
++
i
)
{
cmakefileStream
<<
"
\"
"
<<
this
->
ConvertToRelativePath
(
*
i
,
cmOutputConverter
::
HOME_OUTPUT
)
this
->
GetBinaryDirectory
(),
*
i
)
<<
"
\"\n
"
;
}
cmakefileStream
<<
" )
\n
"
;
...
...
@@ -1930,7 +1930,7 @@ std::string cmLocalUnixMakefileGenerator3::GetRecursiveMakeCall(
if
(
!
tgt
.
empty
())
{
// The make target is always relative to the top of the build tree.
std
::
string
tgt2
=
this
->
ConvertToRelativePath
(
t
gt
,
cmOutputConverter
::
HOME_OUTPUT
);
this
->
ConvertToRelativePath
(
t
his
->
GetBinaryDirectory
(),
tgt
);
// The target may have been written with windows paths.
cmSystemTools
::
ConvertToOutputSlashes
(
tgt2
);
...
...
Source/cmMakefileTargetGenerator.cxx
View file @
34c6e995
...
...
@@ -317,7 +317,7 @@ void cmMakefileTargetGenerator::MacOSXContentGeneratorType::operator()(
this
->
Generator
->
LocalGenerator
->
ConvertToRelativePath
(
this
->
Generator
->
LocalGenerator
->
GetCurrentBinaryDirectory
(),
output
));
output
=
this
->
Generator
->
LocalGenerator
->
ConvertToRelativePath
(
output
,
cmOutputConverter
::
HOME_OUTPUT
);
this
->
Generator
->
LocalGenerator
->
GetBinaryDirectory
(),
output
);
// Create a rule to copy the content into the bundle.
std
::
vector
<
std
::
string
>
depends
;
...
...
@@ -1275,7 +1275,7 @@ void cmMakefileTargetGenerator::WriteTargetDriverRule(
std
::
string
buildTargetRuleName
=
dir
;
buildTargetRuleName
+=
relink
?
"/preinstall"
:
"/build"
;
buildTargetRuleName
=
this
->
LocalGenerator
->
ConvertToRelativePath
(
buildTargetRuleName
,
cmOutputConverter
::
HOME_OUTPUT
);
this
->
LocalGenerator
->
GetBinaryDirectory
(),
buildTargetRuleName
);
// Build the list of target outputs to drive.
std
::
vector
<
std
::
string
>
depends
;
...
...
Brad King
@brad.king
mentioned in commit
160a7ad6
·
Sep 20, 2016
mentioned in commit
160a7ad6
mentioned in commit 160a7ad64092299096f79b2ff1adf5bbcc8cad77
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