ENH: added new methods to convert to HomeRelative paths
This commit is contained in:
parent
4b1c392c9c
commit
25f75d9075
@ -491,6 +491,12 @@ void cmGlobalGenerator::ClearEnabledLanguages()
|
|||||||
|
|
||||||
void cmGlobalGenerator::Configure()
|
void cmGlobalGenerator::Configure()
|
||||||
{
|
{
|
||||||
|
// Setup the current output directory components for use by
|
||||||
|
// ConvertToRelativePath.
|
||||||
|
std::string outdir =
|
||||||
|
cmSystemTools::CollapseFullPath(m_CMakeInstance->GetHomeOutputDirectory());
|
||||||
|
cmSystemTools::SplitPath(outdir.c_str(), m_HomeOutputDirectoryComponents);
|
||||||
|
|
||||||
// Delete any existing cmLocalGenerators
|
// Delete any existing cmLocalGenerators
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
for (i = 0; i < m_LocalGenerators.size(); ++i)
|
for (i = 0; i < m_LocalGenerators.size(); ++i)
|
||||||
@ -522,8 +528,7 @@ void cmGlobalGenerator::Configure()
|
|||||||
sprintf(num,"%d",static_cast<int>(m_LocalGenerators.size()));
|
sprintf(num,"%d",static_cast<int>(m_LocalGenerators.size()));
|
||||||
this->GetCMakeInstance()->AddCacheEntry
|
this->GetCMakeInstance()->AddCacheEntry
|
||||||
("CMAKE_NUMBER_OF_LOCAL_GENERATORS", num,
|
("CMAKE_NUMBER_OF_LOCAL_GENERATORS", num,
|
||||||
"number of local generators",
|
"number of local generators", cmCacheManager::INTERNAL);
|
||||||
cmCacheManager::INTERNAL);
|
|
||||||
|
|
||||||
std::set<cmStdString> notFoundMap;
|
std::set<cmStdString> notFoundMap;
|
||||||
// after it is all done do a ConfigureFinalPass
|
// after it is all done do a ConfigureFinalPass
|
||||||
@ -1091,3 +1096,17 @@ void cmGlobalGenerator::SetupTests()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
std::string cmGlobalGenerator::ConvertToHomeRelativePath(const char* remote)
|
||||||
|
{
|
||||||
|
return (this->ConvertToRelativePath(m_HomeOutputDirectoryComponents,remote));
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
std::string
|
||||||
|
cmGlobalGenerator::ConvertToHomeRelativeOutputPath(const char* remote)
|
||||||
|
{
|
||||||
|
return cmSystemTools::ConvertToOutputPath
|
||||||
|
(this->ConvertToRelativePath(m_HomeOutputDirectoryComponents,remote).c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -138,6 +138,20 @@ public:
|
|||||||
std::string ConvertToRelativePath(const std::vector<std::string>& local,
|
std::string ConvertToRelativePath(const std::vector<std::string>& local,
|
||||||
const char* remote);
|
const char* remote);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert the given remote path to a relative path with respect to
|
||||||
|
* this generator's output directory. The remote path must use
|
||||||
|
* forward slashes and not already be escaped or quoted.
|
||||||
|
*/
|
||||||
|
std::string ConvertToHomeRelativePath(const char* remote);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert to an output path that is relative to the output
|
||||||
|
* directory. The remote path must use forward slashes and not
|
||||||
|
* already be escaped or quoted.
|
||||||
|
*/
|
||||||
|
std::string ConvertToHomeRelativeOutputPath(const char* remote);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Determine what program to use for building the project.
|
* Determine what program to use for building the project.
|
||||||
*/
|
*/
|
||||||
@ -151,6 +165,8 @@ protected:
|
|||||||
void ConfigureRelativePaths();
|
void ConfigureRelativePaths();
|
||||||
void SetupTests();
|
void SetupTests();
|
||||||
|
|
||||||
|
std::vector<std::string> m_HomeOutputDirectoryComponents;
|
||||||
|
|
||||||
bool m_ForceUnixPaths;
|
bool m_ForceUnixPaths;
|
||||||
cmStdString m_FindMakeProgramFile;
|
cmStdString m_FindMakeProgramFile;
|
||||||
cmStdString m_ConfiguredFilesPath;
|
cmStdString m_ConfiguredFilesPath;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user