summaryrefslogtreecommitdiff
path: root/Source/cmLocalUnixMakefileGenerator3.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-06-13 08:38:27 +0200
committerStephen Kelly <steveire@gmail.com>2015-06-13 08:38:27 +0200
commit0efe4944e1ae18b9204209b3ddf5811905e22357 (patch)
treeff0c6d700e59444dce059c52e56b61a6be205603 /Source/cmLocalUnixMakefileGenerator3.cxx
parentbc1211fa7d5c8262b075e010667aed41f5205a75 (diff)
downloadcmake-0efe4944e1ae18b9204209b3ddf5811905e22357.tar.gz
cmGlobalGenerator: Add ComputeHomeRelativeOutputPath method.
Fix generation of tgt/fast build targets. Commit 363caa2f (cmLocalGenerator: De-virtualize Configure()., 2015-05-30) moved the computation of HomeRelativeOutputPath from Configure-time to Generate-time, because it is only used at Generate-time. However, that commit caused the member for one local generator to be computed immediately before generating with that local generator, whereas previously the members of all local generators were computed before generating any of them. The HomeRelativeOutputPath is used by the GetRelativeTargetDirectory method, which is called by the cmGlobalUnixMakefileGenerator3::WriteConvenienceRules method. That method is called by the cmLocalUnixMakefileGenerator3::WriteLocalMakefile method when generating for the top-most (ie, the first) local generator. At that point, the HomeRelativeOutputPath is not yet computed. Fix that by computing the member just before generating anything. This will eventually be done in the cmLocalUnixMakefileGenerator3 constructor instead, but further refactoring is needed to make that possible.
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator3.cxx')
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx29
1 files changed, 16 insertions, 13 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 5c9768acaf..e292ba7883 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -100,19 +100,6 @@ cmLocalUnixMakefileGenerator3::~cmLocalUnixMakefileGenerator3()
//----------------------------------------------------------------------------
void cmLocalUnixMakefileGenerator3::Generate()
{
- // Compute the path to use when referencing the current output
- // directory from the top output directory.
- this->HomeRelativeOutputPath =
- this->Convert(this->Makefile->GetCurrentBinaryDirectory(), HOME_OUTPUT);
- if(this->HomeRelativeOutputPath == ".")
- {
- this->HomeRelativeOutputPath = "";
- }
- if(!this->HomeRelativeOutputPath.empty())
- {
- this->HomeRelativeOutputPath += "/";
- }
-
// Store the configuration name that will be generated.
if(const char* config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE"))
{
@@ -164,6 +151,22 @@ void cmLocalUnixMakefileGenerator3::Generate()
this->WriteDirectoryInformationFile();
}
+void cmLocalUnixMakefileGenerator3::ComputeHomeRelativeOutputPath()
+{
+ // Compute the path to use when referencing the current output
+ // directory from the top output directory.
+ this->HomeRelativeOutputPath =
+ this->Convert(this->Makefile->GetCurrentBinaryDirectory(), HOME_OUTPUT);
+ if(this->HomeRelativeOutputPath == ".")
+ {
+ this->HomeRelativeOutputPath = "";
+ }
+ if(!this->HomeRelativeOutputPath.empty())
+ {
+ this->HomeRelativeOutputPath += "/";
+ }
+}
+
//----------------------------------------------------------------------------
void cmLocalUnixMakefileGenerator3::ComputeObjectFilenames(
std::map<cmSourceFile const*, std::string>& mapping,