summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-02-05 13:55:15 (GMT)
committerBrad King <brad.king@kitware.com>2016-02-05 14:26:44 (GMT)
commitc5eb21b6d1f4187778ad49545761a818e1126541 (patch)
tree1ee13587cb37984b90e9bd4cbcab178a2c0ed5b8 /Source
parenta5a5a6857241c21d306661d723b749839f4c6e1a (diff)
downloadCMake-c5eb21b6d1f4187778ad49545761a818e1126541.zip
CMake-c5eb21b6d1f4187778ad49545761a818e1126541.tar.gz
CMake-c5eb21b6d1f4187778ad49545761a818e1126541.tar.bz2
Fix dependency scanning configuration in subdirectories
Refactoring in commit v3.5.0-rc1~347^2~2 (Set the current dirs on the snapshot before creating the cmMakefile) accidentally changed the source and binary directories configured in `cmake -E cmake_depends` for use during dependency scanning. This can cause the wrong directory information to be loaded. It also breaks Fortran module dependency scanning for modules provided by targets in subdirectories that do not have Fortran_MODULE_DIRECTORY set. Fix the dependency scanning directory configuration and add a test to cover the Fortran module case in which the breakage was observed. Reported-by: Kelly Thompson <kgt@lanl.gov>
Diffstat (limited to 'Source')
-rw-r--r--Source/cmcmd.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 1dc304c..e9d77b2 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -813,10 +813,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
{
cm.SetGlobalGenerator(ggd);
cmState::Snapshot snapshot = cm.GetCurrentSnapshot();
- snapshot.GetDirectory().SetCurrentBinary
- (cmSystemTools::GetCurrentWorkingDirectory());
- snapshot.GetDirectory().SetCurrentSource
- (cmSystemTools::GetCurrentWorkingDirectory());
+ snapshot.GetDirectory().SetCurrentBinary(startOutDir);
+ snapshot.GetDirectory().SetCurrentSource(startDir);
cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(ggd, snapshot));
cmsys::auto_ptr<cmLocalGenerator> lgd(
ggd->CreateLocalGenerator(mf.get()));