diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-10-25 13:17:56 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-10-27 06:44:26 (GMT) |
commit | b6278e9ff714d8bdacb54f055eac71fe073b28d8 (patch) | |
tree | af6b1724740b26ce08aad10987faf541a28bdcbb /Source/cmake.cxx | |
parent | 7a6caae1a78e8d67422b144ceffdd97595f67683 (diff) | |
download | CMake-b6278e9ff714d8bdacb54f055eac71fe073b28d8.zip CMake-b6278e9ff714d8bdacb54f055eac71fe073b28d8.tar.gz CMake-b6278e9ff714d8bdacb54f055eac71fe073b28d8.tar.bz2 |
cmake: Port find_package mode away from GetGeneratorTarget
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 16417fc..d5bc3d2 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -447,8 +447,8 @@ bool cmake::FindPackage(const std::vector<std::string>& args) (cmSystemTools::GetCurrentWorkingDirectory()); // read in the list file to fill the cache snapshot.SetDefaultDefinitions(); - cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(gg, snapshot)); - cmsys::auto_ptr<cmLocalGenerator> lg(gg->CreateLocalGenerator(mf.get())); + cmMakefile* mf = new cmMakefile(gg, snapshot); + gg->AddMakefile(mf); mf->SetArgcArgv(args); @@ -481,6 +481,8 @@ bool cmake::FindPackage(const std::vector<std::string>& args) std::vector<std::string> includeDirs; cmSystemTools::ExpandListArgument(includes, includeDirs); + gg->CreateGenerationObjects(); + cmLocalGenerator* lg = gg->LocalGenerators[0]; std::string includeFlags = lg->GetIncludeFlags(includeDirs, 0, language); std::string definitions = mf->GetSafeDefinition("PACKAGE_DEFINITIONS"); @@ -510,8 +512,9 @@ bool cmake::FindPackage(const std::vector<std::string>& args) std::string linkPath; std::string flags; std::string linkFlags; - gg->CreateGeneratorTargets(cmGlobalGenerator::AllTargets, lg.get()); - cmGeneratorTarget *gtgt = gg->GetGeneratorTarget(tgt); + gg->CreateGenerationObjects(); + cmGeneratorTarget *gtgt = gg->FindGeneratorTarget(tgt->GetName()); + cmLocalGenerator* lg = gtgt->GetLocalGenerator(); lg->GetTargetFlags(linkLibs, frameworkPath, linkPath, flags, linkFlags, gtgt, false); linkLibs = frameworkPath + linkPath + linkLibs; |