summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/cmGlobalGenerator.cxx50
-rw-r--r--Source/cmGlobalGenerator.h2
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx29
-rw-r--r--Source/cmake.cxx5
-rw-r--r--Tests/FindPackageModeMakefileTest/Makefile.in4
6 files changed, 58 insertions, 34 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index ab51625..0cdba30 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -2,5 +2,5 @@
set(CMake_VERSION_MAJOR 2)
set(CMake_VERSION_MINOR 8)
set(CMake_VERSION_PATCH 12)
-set(CMake_VERSION_TWEAK 20140112)
+set(CMake_VERSION_TWEAK 20140113)
#set(CMake_VERSION_RC 1)
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 549d51b..8a7eee4 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1387,35 +1387,37 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo()
}
//----------------------------------------------------------------------------
+void cmGlobalGenerator::CreateGeneratorTargets(cmMakefile *mf)
+{
+ cmGeneratorTargetsType generatorTargets;
+ cmTargets& targets = mf->GetTargets();
+ for(cmTargets::iterator ti = targets.begin();
+ ti != targets.end(); ++ti)
+ {
+ cmTarget* t = &ti->second;
+ cmGeneratorTarget* gt = new cmGeneratorTarget(t);
+ this->GeneratorTargets[t] = gt;
+ generatorTargets[t] = gt;
+ }
+
+ for(std::vector<cmTarget*>::const_iterator
+ j = mf->GetOwnedImportedTargets().begin();
+ j != mf->GetOwnedImportedTargets().end(); ++j)
+ {
+ cmGeneratorTarget* gt = new cmGeneratorTarget(*j);
+ this->GeneratorTargets[*j] = gt;
+ generatorTargets[*j] = gt;
+ }
+ mf->SetGeneratorTargets(generatorTargets);
+}
+
+//----------------------------------------------------------------------------
void cmGlobalGenerator::CreateGeneratorTargets()
{
// Construct per-target generator information.
for(unsigned int i=0; i < this->LocalGenerators.size(); ++i)
{
- cmGeneratorTargetsType generatorTargets;
-
- cmMakefile *mf = this->LocalGenerators[i]->GetMakefile();
-
- cmTargets& targets = mf->GetTargets();
- for(cmTargets::iterator ti = targets.begin();
- ti != targets.end(); ++ti)
- {
- cmTarget* t = &ti->second;
- cmGeneratorTarget* gt = new cmGeneratorTarget(t);
- this->GeneratorTargets[t] = gt;
- generatorTargets[t] = gt;
- }
-
- for(std::vector<cmTarget*>::const_iterator
- j = mf->GetOwnedImportedTargets().begin();
- j != mf->GetOwnedImportedTargets().end(); ++j)
- {
- cmGeneratorTarget* gt = new cmGeneratorTarget(*j);
- this->GeneratorTargets[*j] = gt;
- generatorTargets[*j] = gt;
- }
-
- mf->SetGeneratorTargets(generatorTargets);
+ this->CreateGeneratorTargets(this->LocalGenerators[i]->GetMakefile());
}
}
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 3733288..ebc2db5 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -432,6 +432,8 @@ private:
// Per-target generator information.
cmGeneratorTargetsType GeneratorTargets;
+ friend class cmake;
+ void CreateGeneratorTargets(cmMakefile* mf);
void CreateGeneratorTargets();
void ComputeGeneratorTargetObjects();
virtual void ComputeTargetObjects(cmGeneratorTarget* gt) const;
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index ec91b0f..65b01db 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -1107,27 +1107,46 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os)
/*deptype=*/ "",
/*rspfile=*/ "",
/*rspcontent*/ "",
- /*restat=*/ false,
+ /*restat=*/ true,
/*generator=*/ true);
- cmNinjaDeps implicitDeps;
+ cmNinjaDeps implicitDeps, outputs, temp;
+ outputs.push_back(NINJA_BUILD_FILE);
for (std::vector<cmLocalGenerator *>::const_iterator i =
this->LocalGenerators.begin(); i != this->LocalGenerators.end(); ++i) {
const std::vector<std::string>& lf = (*i)->GetMakefile()->GetListFiles();
implicitDeps.insert(implicitDeps.end(), lf.begin(), lf.end());
const std::vector<std::string>& of = (*i)->GetMakefile()->GetOutputFiles();
- implicitDeps.insert(implicitDeps.end(), of.begin(), of.end());
+ temp.insert(temp.end(), of.begin(), of.end());
}
+
+ //Add the CMakeCache.txt file to the implicit depends so that we catch
+ //when somebody manually modifies the file.
+ implicitDeps.push_back("CMakeCache.txt");
+
+ //make sure nothing is in implicit depends twice
std::sort(implicitDeps.begin(), implicitDeps.end());
implicitDeps.erase(std::unique(implicitDeps.begin(), implicitDeps.end()),
implicitDeps.end());
- implicitDeps.push_back("CMakeCache.txt");
+
+
+ //make sure nothing is in outputs depends twice
+ std::sort(temp.begin(), temp.end());
+ temp.erase(std::unique(temp.begin(), temp.end()),
+ temp.end());
+
+ //make sure that anything that is in implicitDeps is also NOT in outputs
+ std::set_difference(temp.begin(),
+ temp.end(),
+ implicitDeps.begin(),
+ implicitDeps.end(),
+ std::back_inserter(outputs));
this->WriteBuild(os,
"Re-run CMake if any of its inputs changed.",
"RERUN_CMAKE",
- /*outputs=*/ cmNinjaDeps(1, NINJA_BUILD_FILE),
+ outputs,
/*explicitDeps=*/ cmNinjaDeps(),
implicitDeps,
/*orderOnlyDeps=*/ cmNinjaDeps(),
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 1dd8a66..cf4b9c3 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -593,9 +593,10 @@ bool cmake::FindPackage(const std::vector<std::string>& args)
std::string linkPath;
std::string flags;
std::string linkFlags;
- cmGeneratorTarget gtgt(tgt);
+ gg->CreateGeneratorTargets(mf);
+ cmGeneratorTarget *gtgt = gg->GetGeneratorTarget(tgt);
lg->GetTargetFlags(linkLibs, frameworkPath, linkPath, flags, linkFlags,
- &gtgt);
+ gtgt);
linkLibs = frameworkPath + linkPath + linkLibs;
printf("%s\n", linkLibs.c_str() );
diff --git a/Tests/FindPackageModeMakefileTest/Makefile.in b/Tests/FindPackageModeMakefileTest/Makefile.in
index c91d8a0..e4df9d6 100644
--- a/Tests/FindPackageModeMakefileTest/Makefile.in
+++ b/Tests/FindPackageModeMakefileTest/Makefile.in
@@ -9,9 +9,9 @@ CMAKE_FOO = $(CMAKE) --find-package -DCMAKE_MODULE_PATH=$(CMAKE_CURRENT_BINARY_D
tmp = tmp.txt
-all: clean pngtest
+all: pngtest
-main.o: main.cpp
+main.o: clean main.cpp
@$(CMAKE_FOO) -DMODE=COMPILE >$(tmp)
@foo="`cat $(tmp)`"; \
printf '"%s" %s %s -c main.cpp\n' $(CMAKE_CXX_COMPILER) "$(CXXFLAGS)" "$$foo" >$(tmp)