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
b6a957c9
Commit
b6a957c9
authored
Nov 23, 2018
by
bmanga
Browse files
cmOutputConverter: move ConvertToRelativePath to cmStateDirectory.
parent
05e4fa47
Changes
25
Hide whitespace changes
Inline
Side-by-side
Source/cmCommonTargetGenerator.cxx
View file @
b6a957c9
...
...
@@ -198,7 +198,7 @@ std::string cmCommonTargetGenerator::GetManifests()
manifests
.
reserve
(
manifest_srcs
.
size
());
for
(
cmSourceFile
const
*
manifest_src
:
manifest_srcs
)
{
manifests
.
push_back
(
this
->
LocalCommonGenerator
->
ConvertToOutputFormat
(
this
->
LocalCommonGenerator
->
ConvertToRelativePath
(
this
->
LocalCommonGenerator
->
Maybe
ConvertToRelativePath
(
this
->
LocalCommonGenerator
->
GetWorkingDirectory
(),
manifest_src
->
GetFullPath
()),
cmOutputConverter
::
SHELL
));
...
...
Source/cmDependsC.cxx
View file @
b6a957c9
...
...
@@ -100,7 +100,8 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
// Compute a path to the object file to write to the internal depend file.
// Any existing content of the internal depend file has already been
// loaded in ValidDeps with this path as a key.
std
::
string
obj_i
=
this
->
LocalGenerator
->
ConvertToRelativePath
(
binDir
,
obj
);
std
::
string
obj_i
=
this
->
LocalGenerator
->
MaybeConvertToRelativePath
(
binDir
,
obj
);
if
(
this
->
ValidDeps
!=
nullptr
)
{
std
::
map
<
std
::
string
,
DependencyVector
>::
const_iterator
tmpIt
=
...
...
@@ -234,7 +235,8 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
for
(
std
::
string
const
&
dep
:
dependencies
)
{
makeDepends
<<
obj_m
<<
": "
<<
cmSystemTools
::
ConvertToOutputPath
(
this
->
LocalGenerator
->
ConvertToRelativePath
(
binDir
,
dep
))
this
->
LocalGenerator
->
MaybeConvertToRelativePath
(
binDir
,
dep
))
<<
std
::
endl
;
internalDepends
<<
" "
<<
dep
<<
std
::
endl
;
}
...
...
Source/cmExtraEclipseCDT4Generator.cxx
View file @
b6a957c9
...
...
@@ -899,7 +899,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
for
(
cmLocalGenerator
*
lgen
:
this
->
GlobalGenerator
->
GetLocalGenerators
())
{
const
std
::
vector
<
cmGeneratorTarget
*>&
targets
=
lgen
->
GetGeneratorTargets
();
std
::
string
subdir
=
lgen
->
ConvertToRelativePath
(
std
::
string
subdir
=
lgen
->
Maybe
ConvertToRelativePath
(
this
->
HomeOutputDirectory
,
lgen
->
GetCurrentBinaryDirectory
());
if
(
subdir
==
"."
)
{
subdir
.
clear
();
...
...
Source/cmGhsMultiTargetGenerator.cxx
View file @
b6a957c9
...
...
@@ -150,7 +150,8 @@ void cmGhsMultiTargetGenerator::WriteTargetSpecifics(std::ostream& fout,
if
(
this
->
TagType
!=
GhsMultiGpj
::
SUBPROJECT
)
{
// set target binary file destination
outpath
=
this
->
GeneratorTarget
->
GetDirectory
(
config
);
outpath
=
this
->
LocalGenerator
->
ConvertToRelativePath
(
rootpath
,
outpath
);
outpath
=
this
->
LocalGenerator
->
MaybeConvertToRelativePath
(
rootpath
,
outpath
);
fout
<<
" :binDirRelative=
\"
"
<<
outpath
<<
"
\"
"
<<
std
::
endl
;
fout
<<
" -o
\"
"
<<
this
->
TargetNameReal
<<
"
\"
"
<<
std
::
endl
;
}
...
...
@@ -550,7 +551,7 @@ void cmGhsMultiTargetGenerator::WriteReferences(std::ostream& fout)
std
::
string
tpath
=
t
->
LocalGenerator
->
GetCurrentBinaryDirectory
();
std
::
string
rootpath
=
this
->
LocalGenerator
->
GetCurrentBinaryDirectory
();
std
::
string
outpath
=
this
->
LocalGenerator
->
ConvertToRelativePath
(
rootpath
,
tpath
)
+
"/"
+
this
->
LocalGenerator
->
Maybe
ConvertToRelativePath
(
rootpath
,
tpath
)
+
"/"
+
tname
+
"REF"
+
cmGlobalGhsMultiGenerator
::
FILE_EXTENSION
;
fout
<<
outpath
;
...
...
Source/cmGlobalGenerator.cxx
View file @
b6a957c9
...
...
@@ -33,7 +33,6 @@
#include "cmMSVC60LinkLineComputer.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmOutputConverter.h"
#include "cmPolicies.h"
#include "cmSourceFile.h"
#include "cmState.h"
...
...
@@ -2804,8 +2803,9 @@ 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
(
cmStateDirectory
cmDir
=
this
->
GetMakefiles
()[
0
]
->
GetStateSnapshot
().
GetDirectory
();
std
::
string
fname
=
cmDir
.
ConvertToRelPathIfNotContained
(
this
->
GetMakefiles
()[
0
]
->
GetState
()
->
GetBinaryDirectory
(),
outputs
[
0
]);
// Associate the hash with this output.
...
...
Source/cmGlobalGhsMultiGenerator.cxx
View file @
b6a957c9
...
...
@@ -297,7 +297,7 @@ void cmGlobalGhsMultiGenerator::WriteSubProjects(
if
(
projName
&&
projType
)
{
cmLocalGenerator
*
lg
=
target
->
GetLocalGenerator
();
std
::
string
dir
=
lg
->
GetCurrentBinaryDirectory
();
dir
=
root
->
ConvertToRelativePath
(
rootBinaryDir
,
dir
.
c_str
());
dir
=
root
->
Maybe
ConvertToRelativePath
(
rootBinaryDir
,
dir
.
c_str
());
if
(
dir
==
"."
)
{
dir
.
clear
();
}
else
{
...
...
Source/cmGlobalNinjaGenerator.cxx
View file @
b6a957c9
...
...
@@ -861,7 +861,7 @@ std::string const& cmGlobalNinjaGenerator::ConvertToNinjaPath(
cmLocalNinjaGenerator
*
ng
=
static_cast
<
cmLocalNinjaGenerator
*>
(
this
->
LocalGenerators
[
0
]);
std
::
string
const
&
bin_dir
=
ng
->
GetState
()
->
GetBinaryDirectory
();
std
::
string
convPath
=
ng
->
ConvertToRelativePath
(
bin_dir
,
path
);
std
::
string
convPath
=
ng
->
Maybe
ConvertToRelativePath
(
bin_dir
,
path
);
convPath
=
this
->
NinjaOutputPath
(
convPath
);
#ifdef _WIN32
std
::
replace
(
convPath
.
begin
(),
convPath
.
end
(),
'/'
,
'\\'
);
...
...
Source/cmGlobalUnixMakefileGenerator3.cxx
View file @
b6a957c9
...
...
@@ -325,7 +325,8 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
<<
"set(CMAKE_MAKEFILE_DEPENDS
\n
"
<<
"
\"
CMakeCache.txt
\"\n
"
;
for
(
std
::
string
const
&
f
:
lfiles
)
{
cmakefileStream
<<
"
\"
"
<<
lg
->
ConvertToRelativePath
(
currentBinDir
,
f
)
cmakefileStream
<<
"
\"
"
<<
lg
->
MaybeConvertToRelativePath
(
currentBinDir
,
f
)
<<
"
\"\n
"
;
}
cmakefileStream
<<
" )
\n\n
"
;
...
...
@@ -339,9 +340,11 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
cmakefileStream
<<
"# The corresponding makefile is:
\n
"
<<
"set(CMAKE_MAKEFILE_OUTPUTS
\n
"
<<
"
\"
"
<<
lg
->
ConvertToRelativePath
(
currentBinDir
,
makefileName
)
<<
lg
->
MaybeConvertToRelativePath
(
currentBinDir
,
makefileName
)
<<
"
\"\n
"
<<
"
\"
"
<<
lg
->
ConvertToRelativePath
(
currentBinDir
,
check
)
<<
"
\"
"
<<
lg
->
MaybeConvertToRelativePath
(
currentBinDir
,
check
)
<<
"
\"\n
"
;
cmakefileStream
<<
" )
\n\n
"
;
...
...
@@ -354,7 +357,8 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
const
std
::
vector
<
std
::
string
>&
outfiles
=
lg
->
GetMakefile
()
->
GetOutputFiles
();
for
(
std
::
string
const
&
outfile
:
outfiles
)
{
cmakefileStream
<<
"
\"
"
<<
lg
->
ConvertToRelativePath
(
binDir
,
outfile
)
cmakefileStream
<<
"
\"
"
<<
lg
->
MaybeConvertToRelativePath
(
binDir
,
outfile
)
<<
"
\"\n
"
;
}
...
...
@@ -365,7 +369,8 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
tmpStr
=
lg
->
GetCurrentBinaryDirectory
();
tmpStr
+=
cmake
::
GetCMakeFilesDirectory
();
tmpStr
+=
"/CMakeDirectoryInformation.cmake"
;
cmakefileStream
<<
"
\"
"
<<
lg
->
ConvertToRelativePath
(
binDir
,
tmpStr
)
cmakefileStream
<<
"
\"
"
<<
lg
->
MaybeConvertToRelativePath
(
binDir
,
tmpStr
)
<<
"
\"\n
"
;
}
cmakefileStream
<<
" )
\n\n
"
;
...
...
@@ -474,7 +479,7 @@ void cmGlobalUnixMakefileGenerator3::WriteDirectoryRules2(
// Begin the directory-level rules section.
std
::
string
dir
=
cmSystemTools
::
ConvertToOutputPath
(
lg
->
ConvertToRelativePath
(
cmSystemTools
::
ConvertToOutputPath
(
lg
->
Maybe
ConvertToRelativePath
(
lg
->
GetBinaryDirectory
(),
lg
->
GetCurrentBinaryDirectory
()));
lg
->
WriteDivider
(
ruleFileStream
);
ruleFileStream
<<
"# Directory level rules for directory "
<<
dir
<<
"
\n\n
"
;
...
...
@@ -526,9 +531,9 @@ void cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
if
(
fast
)
{
tname
+=
"/fast"
;
}
cmOutputConverter
conv
(
mf
->
GetStateSnapshot
());
tname
=
conv
.
ConvertToRelativePath
(
mf
->
GetState
()
->
GetBinaryDirectory
(),
tname
);
mf
->
GetStateSnapshot
().
GetDirectory
().
ConvertToRelPathIfNotContained
(
mf
->
GetState
()
->
GetBinaryDirectory
(),
tname
);
cmSystemTools
::
ConvertToOutputSlashes
(
tname
);
makeCommand
.
push_back
(
std
::
move
(
tname
));
}
...
...
Source/cmGlobalVisualStudio7Generator.cxx
View file @
b6a957c9
...
...
@@ -367,7 +367,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
if
(
vcprojName
)
{
cmLocalGenerator
*
lg
=
target
->
GetLocalGenerator
();
std
::
string
dir
=
lg
->
GetCurrentBinaryDirectory
();
dir
=
root
->
ConvertToRelativePath
(
rootBinaryDir
,
dir
.
c_str
());
dir
=
root
->
Maybe
ConvertToRelativePath
(
rootBinaryDir
,
dir
.
c_str
());
if
(
dir
==
"."
)
{
dir
.
clear
();
// msbuild cannot handle ".\" prefix
}
...
...
Source/cmGlobalXCodeGenerator.cxx
View file @
b6a957c9
...
...
@@ -3570,7 +3570,7 @@ std::string cmGlobalXCodeGenerator::RelativeToSource(const char* p)
std
::
string
cmGlobalXCodeGenerator
::
RelativeToBinary
(
const
char
*
p
)
{
return
this
->
CurrentLocalGenerator
->
ConvertToRelativePath
(
return
this
->
CurrentLocalGenerator
->
Maybe
ConvertToRelativePath
(
cmSystemTools
::
JoinPath
(
this
->
ProjectOutputDirectoryComponents
),
p
);
}
...
...
Source/cmListFileCache.cxx
View file @
b6a957c9
...
...
@@ -5,8 +5,8 @@
#include "cmListFileLexer.h"
#include "cmMessageType.h"
#include "cmMessenger.h"
#include "cmOutputConverter.h"
#include "cmState.h"
#include "cmStateDirectory.h"
#include "cmSystemTools.h"
#include <assert.h>
...
...
@@ -390,9 +390,8 @@ void cmListFileBacktrace::PrintTitle(std::ostream& out) const
}
cmListFileContext
lfc
=
this
->
TopEntry
->
Context
;
cmStateSnapshot
bottom
=
this
->
GetBottom
();
cmOutputConverter
converter
(
bottom
);
if
(
!
bottom
.
GetState
()
->
GetIsInTryCompile
())
{
lfc
.
FilePath
=
converter
.
ConvertToRelat
ivePath
(
lfc
.
FilePath
=
bottom
.
GetDirectory
()
.
ConvertToRel
P
at
hIfNotContained
(
bottom
.
GetState
()
->
GetSourceDirectory
(),
lfc
.
FilePath
);
}
out
<<
(
lfc
.
Line
?
" at "
:
" in "
)
<<
lfc
;
...
...
@@ -409,7 +408,6 @@ void cmListFileBacktrace::PrintCallStack(std::ostream& out) const
bool
first
=
true
;
cmStateSnapshot
bottom
=
this
->
GetBottom
();
cmOutputConverter
converter
(
bottom
);
for
(
Entry
const
*
cur
=
this
->
TopEntry
->
Parent
.
get
();
!
cur
->
IsBottom
();
cur
=
cur
->
Parent
.
get
())
{
if
(
cur
->
Context
.
Name
.
empty
())
{
...
...
@@ -423,7 +421,7 @@ void cmListFileBacktrace::PrintCallStack(std::ostream& out) const
}
cmListFileContext
lfc
=
cur
->
Context
;
if
(
!
bottom
.
GetState
()
->
GetIsInTryCompile
())
{
lfc
.
FilePath
=
converter
.
ConvertToRelat
ivePath
(
lfc
.
FilePath
=
bottom
.
GetDirectory
()
.
ConvertToRel
P
at
hIfNotContained
(
bottom
.
GetState
()
->
GetSourceDirectory
(),
lfc
.
FilePath
);
}
out
<<
" "
<<
lfc
<<
"
\n
"
;
...
...
Source/cmLocalCommonGenerator.cxx
View file @
b6a957c9
...
...
@@ -47,7 +47,7 @@ std::string cmLocalCommonGenerator::GetTargetFortranFlags(
target
->
GetFortranModuleDirectory
(
this
->
WorkingDirectory
);
if
(
!
mod_dir
.
empty
())
{
mod_dir
=
this
->
ConvertToOutputFormat
(
this
->
ConvertToRelativePath
(
this
->
WorkingDirectory
,
mod_dir
),
this
->
Maybe
ConvertToRelativePath
(
this
->
WorkingDirectory
,
mod_dir
),
cmOutputConverter
::
SHELL
);
}
else
{
mod_dir
=
...
...
Source/cmLocalGenerator.cxx
View file @
b6a957c9
...
...
@@ -316,7 +316,7 @@ void cmLocalGenerator::GenerateTestFiles()
for
(
cmStateSnapshot
const
&
i
:
children
)
{
// TODO: Use add_subdirectory instead?
std
::
string
outP
=
i
.
GetDirectory
().
GetCurrentBinary
();
outP
=
this
->
ConvertToRelativePath
(
parentBinDir
,
outP
);
outP
=
this
->
Maybe
ConvertToRelativePath
(
parentBinDir
,
outP
);
outP
=
cmOutputConverter
::
EscapeForCMake
(
outP
);
fout
<<
"subdirs("
<<
outP
<<
")"
<<
std
::
endl
;
}
...
...
@@ -2294,7 +2294,7 @@ std::string cmLocalGenerator::ConstructComment(
std
::
string
currentBinaryDir
=
this
->
GetCurrentBinaryDirectory
();
for
(
std
::
string
const
&
o
:
ccg
.
GetOutputs
())
{
comment
+=
sep
;
comment
+=
this
->
ConvertToRelativePath
(
currentBinaryDir
,
o
);
comment
+=
this
->
Maybe
ConvertToRelativePath
(
currentBinaryDir
,
o
);
sep
=
", "
;
}
return
comment
;
...
...
@@ -2551,15 +2551,15 @@ std::string cmLocalGenerator::GetObjectFileNameWithoutTarget(
std
::
string
const
&
fullPath
=
source
.
GetFullPath
();
// Try referencing the source relative to the source tree.
std
::
string
relFromSource
=
this
->
ConvertToRelativePath
(
this
->
GetCurrentSourceDirectory
(),
fullPath
);
std
::
string
relFromSource
=
this
->
MaybeConvertToRelativePath
(
this
->
GetCurrentSourceDirectory
(),
fullPath
);
assert
(
!
relFromSource
.
empty
());
bool
relSource
=
!
cmSystemTools
::
FileIsFullPath
(
relFromSource
);
bool
subSource
=
relSource
&&
relFromSource
[
0
]
!=
'.'
;
// Try referencing the source relative to the binary tree.
std
::
string
relFromBinary
=
this
->
ConvertToRelativePath
(
this
->
GetCurrentBinaryDirectory
(),
fullPath
);
std
::
string
relFromBinary
=
this
->
MaybeConvertToRelativePath
(
this
->
GetCurrentBinaryDirectory
(),
fullPath
);
assert
(
!
relFromBinary
.
empty
());
bool
relBinary
=
!
cmSystemTools
::
FileIsFullPath
(
relFromBinary
);
bool
subBinary
=
relBinary
&&
relFromBinary
[
0
]
!=
'.'
;
...
...
@@ -2658,6 +2658,13 @@ std::string const& cmLocalGenerator::GetCurrentSourceDirectory() const
return
this
->
StateSnapshot
.
GetDirectory
().
GetCurrentSource
();
}
std
::
string
cmLocalGenerator
::
MaybeConvertToRelativePath
(
std
::
string
const
&
local_path
,
std
::
string
const
&
remote_path
)
const
{
return
this
->
StateSnapshot
.
GetDirectory
().
ConvertToRelPathIfNotContained
(
local_path
,
remote_path
);
}
std
::
string
cmLocalGenerator
::
GetTargetDirectory
(
const
cmGeneratorTarget
*
/*unused*/
)
const
{
...
...
Source/cmLocalGenerator.h
View file @
b6a957c9
...
...
@@ -301,6 +301,16 @@ public:
std
::
string
const
&
GetCurrentBinaryDirectory
()
const
;
std
::
string
const
&
GetCurrentSourceDirectory
()
const
;
/**
* Convert the given remote path to a relative path with respect to
* the given local path. Both paths must use forward slashes and not
* already be escaped or quoted.
* The conversion is skipped if the paths are not both in the source
* or both in the binary tree.
*/
std
::
string
MaybeConvertToRelativePath
(
std
::
string
const
&
local_path
,
std
::
string
const
&
remote_path
)
const
;
/**
* Generate a macOS application bundle Info.plist file.
*/
...
...
Source/cmLocalNinjaGenerator.cxx
View file @
b6a957c9
...
...
@@ -54,7 +54,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
->
HomeRelativeOutputPath
=
this
->
Maybe
ConvertToRelativePath
(
this
->
GetBinaryDirectory
(),
this
->
GetCurrentBinaryDirectory
());
if
(
this
->
HomeRelativeOutputPath
==
"."
)
{
this
->
HomeRelativeOutputPath
.
clear
();
...
...
@@ -141,7 +141,8 @@ std::string cmLocalNinjaGenerator::ConvertToIncludeReference(
format
);
}
return
this
->
ConvertToOutputFormat
(
this
->
ConvertToRelativePath
(
this
->
GetBinaryDirectory
(),
path
),
format
);
this
->
MaybeConvertToRelativePath
(
this
->
GetBinaryDirectory
(),
path
),
format
);
}
// Private methods.
...
...
@@ -584,8 +585,8 @@ std::string cmLocalNinjaGenerator::MakeCustomLauncher(
if
(
!
outputs
.
empty
())
{
output
=
outputs
[
0
];
if
(
ccg
.
GetWorkingDirectory
().
empty
())
{
output
=
this
->
ConvertToRelativePath
(
this
->
GetCurrentBinaryDirectory
(),
output
);
output
=
this
->
MaybeConvertToRelativePath
(
this
->
GetCurrentBinaryDirectory
(),
output
);
}
output
=
this
->
ConvertToOutputFormat
(
output
,
cmOutputConverter
::
SHELL
);
}
...
...
Source/cmLocalUnixMakefileGenerator3.cxx
View file @
b6a957c9
...
...
@@ -2088,12 +2088,3 @@ void cmLocalUnixMakefileGenerator3::CreateCDCommand(
[
&
prefix
](
std
::
string
const
&
s
)
{
return
prefix
+
s
;
});
}
}
std
::
string
cmLocalUnixMakefileGenerator3
::
MaybeConvertToRelativePath
(
std
::
string
const
&
base
,
std
::
string
const
&
path
)
{
if
(
!
this
->
GetStateSnapshot
().
GetDirectory
().
ContainsBoth
(
base
,
path
))
{
return
path
;
}
return
cmSystemTools
::
ForceToRelativePath
(
base
,
path
);
}
Source/cmLocalUnixMakefileGenerator3.h
View file @
b6a957c9
...
...
@@ -183,9 +183,6 @@ public:
// Eclipse generator.
void
GetIndividualFileTargets
(
std
::
vector
<
std
::
string
>&
targets
);
std
::
string
MaybeConvertToRelativePath
(
std
::
string
const
&
base
,
std
::
string
const
&
path
);
protected:
void
WriteLocalMakefile
();
...
...
Source/cmLocalVisualStudio7Generator.cxx
View file @
b6a957c9
...
...
@@ -803,8 +803,8 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(
target
->
GetProperty
(
"Fortran_MODULE_DIRECTORY"
);
std
::
string
modDir
;
if
(
target_mod_dir
)
{
modDir
=
this
->
ConvertToRelativePath
(
this
->
GetCurrentBinaryDirectory
(),
target_mod_dir
);
modDir
=
this
->
Maybe
ConvertToRelativePath
(
this
->
GetCurrentBinaryDirectory
(),
target_mod_dir
);
}
else
{
modDir
=
"."
;
}
...
...
@@ -1306,7 +1306,7 @@ void cmLocalVisualStudio7GeneratorInternals::OutputLibraries(
for
(
ItemVector
::
const_iterator
l
=
libs
.
begin
();
l
!=
libs
.
end
();
++
l
)
{
if
(
l
->
IsPath
)
{
std
::
string
rel
=
lg
->
ConvertToRelativePath
(
currentBinDir
,
l
->
Value
.
c_str
());
lg
->
Maybe
ConvertToRelativePath
(
currentBinDir
,
l
->
Value
.
c_str
());
fout
<<
lg
->
ConvertToXMLOutputPath
(
rel
.
c_str
())
<<
" "
;
}
else
if
(
!
l
->
Target
||
l
->
Target
->
GetType
()
!=
cmStateEnums
::
INTERFACE_LIBRARY
)
{
...
...
@@ -1332,7 +1332,7 @@ void cmLocalVisualStudio7GeneratorInternals::OutputObjects(
i
!=
objs
.
end
();
++
i
)
{
if
(
!
(
*
i
)
->
GetObjectLibrary
().
empty
())
{
std
::
string
const
&
objFile
=
(
*
i
)
->
GetFullPath
();
std
::
string
rel
=
lg
->
ConvertToRelativePath
(
currentBinDir
,
objFile
);
std
::
string
rel
=
lg
->
Maybe
ConvertToRelativePath
(
currentBinDir
,
objFile
);
fout
<<
sep
<<
lg
->
ConvertToXMLOutputPath
(
rel
.
c_str
());
sep
=
" "
;
}
...
...
@@ -1358,7 +1358,7 @@ void cmLocalVisualStudio7Generator::OutputLibraryDirectories(
// Switch to a relative path specification if it is shorter.
if
(
cmSystemTools
::
FileIsFullPath
(
dir
.
c_str
()))
{
std
::
string
rel
=
this
->
ConvertToRelativePath
(
currentBinDir
,
dir
.
c_str
());
this
->
Maybe
ConvertToRelativePath
(
currentBinDir
,
dir
.
c_str
());
if
(
rel
.
size
()
<
dir
.
size
())
{
dir
=
rel
;
}
...
...
Source/cmLocalVisualStudioGenerator.cxx
View file @
b6a957c9
...
...
@@ -210,9 +210,10 @@ std::string cmLocalVisualStudioGenerator::ConstructScript(
}
if
(
workingDirectory
.
empty
())
{
script
+=
this
->
ConvertToOutputFormat
(
this
->
ConvertToRelativePath
(
this
->
GetCurrentBinaryDirectory
(),
cmd
),
cmOutputConverter
::
SHELL
);
script
+=
this
->
ConvertToOutputFormat
(
this
->
MaybeConvertToRelativePath
(
this
->
GetCurrentBinaryDirectory
(),
cmd
),
cmOutputConverter
::
SHELL
);
}
else
{
script
+=
this
->
ConvertToOutputFormat
(
cmd
.
c_str
(),
SHELL
);
}
...
...
Source/cmOutputConverter.cxx
View file @
b6a957c9
...
...
@@ -10,7 +10,6 @@
#include <vector>
#include "cmState.h"
#include "cmStateDirectory.h"
#include "cmSystemTools.h"
cmOutputConverter
::
cmOutputConverter
(
cmStateSnapshot
const
&
snapshot
)
...
...
@@ -72,17 +71,6 @@ std::string cmOutputConverter::ConvertDirectorySeparatorsForShell(
return
result
;
}
std
::
string
cmOutputConverter
::
ConvertToRelativePath
(
std
::
string
const
&
local_path
,
std
::
string
const
&
remote_path
)
const
{
if
(
!
this
->
StateSnapshot
.
GetDirectory
().
ContainsBoth
(
local_path
,
remote_path
))
{
return
remote_path
;
}
return
cmSystemTools
::
ForceToRelativePath
(
local_path
,
remote_path
);
}
static
bool
cmOutputConverterIsShellOperator
(
const
std
::
string
&
str
)
{
static
std
::
set
<
std
::
string
>
shellOperators
;
...
...
Prev
1
2
Next
Brad King
@brad.king
mentioned in commit
60c06620
·
Jan 29, 2019
mentioned in commit
60c06620
mentioned in commit 60c06620a690f0cbeeaa3fba762e19cd031669ca
Toggle commit list
Write
Preview
Markdown
is supported
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