summaryrefslogtreecommitdiffstats
path: root/Source/cmCommonTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-07-29 16:55:58 (GMT)
committerBrad King <brad.king@kitware.com>2015-07-29 17:20:03 (GMT)
commit70c21301b274a28dde75b4f2adb141f9b170eb80 (patch)
treeb847e901967286b5aada86ce5353848d29984644 /Source/cmCommonTargetGenerator.cxx
parent7371d8f3b49c020a14f6324ba5264d17c7dbbaee (diff)
downloadCMake-70c21301b274a28dde75b4f2adb141f9b170eb80.zip
CMake-70c21301b274a28dde75b4f2adb141f9b170eb80.tar.gz
CMake-70c21301b274a28dde75b4f2adb141f9b170eb80.tar.bz2
cmCommonTargetGenerator: Store working directory for relative paths
The Makefile generators run tools with the current working directory set to the subdirectory of the build tree for the each target. The Ninja generator runs tools with the current working directory set to the top of the build tree. Tell cmCommonTargetGenerator where the working directory will be so it can compute proper relative paths.
Diffstat (limited to 'Source/cmCommonTargetGenerator.cxx')
-rw-r--r--Source/cmCommonTargetGenerator.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index eb93ebc..8a5746a 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -20,8 +20,12 @@
#include "cmSystemTools.h"
#include "cmTarget.h"
-cmCommonTargetGenerator::cmCommonTargetGenerator(cmGeneratorTarget* gt)
- : GeneratorTarget(gt)
+cmCommonTargetGenerator::cmCommonTargetGenerator(
+ cmOutputConverter::RelativeRoot wd,
+ cmGeneratorTarget* gt
+ )
+ : WorkingDirectory(wd)
+ , GeneratorTarget(gt)
, Target(gt->Target)
, Makefile(gt->Makefile)
, LocalGenerator(static_cast<cmLocalCommonGenerator*>(gt->LocalGenerator))
@@ -152,7 +156,7 @@ void cmCommonTargetGenerator::AddFortranFlags(std::string& flags)
if (!mod_dir.empty())
{
mod_dir = this->Convert(mod_dir,
- cmLocalGenerator::START_OUTPUT,
+ this->WorkingDirectory,
cmLocalGenerator::SHELL);
}
else