summaryrefslogtreecommitdiffstats
path: root/Source/cmcmd.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmcmd.cxx')
-rw-r--r--Source/cmcmd.cxx15
1 files changed, 10 insertions, 5 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index a074444..21b126b 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -35,8 +35,7 @@
#include <stdlib.h> // required for atoi
#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE)
-// defined in binexplib.cxx
-bool DumpFile(const char* filename, FILE *fout);
+#include "bindexplib.h"
#endif
void CMakeCommandUsage(const char* program)
@@ -240,13 +239,16 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
return 1;
}
std::string objfile;
+ bindexplib deffile;
while(cmSystemTools::GetLineFromStream(fin, objfile))
{
- if (!DumpFile(objfile.c_str(), fout))
+ if( !deffile.AddObjectFile(objfile.c_str()))
{
return 1;
}
}
+ deffile.WriteFile(fout);
+ fclose(fout);
return 0;
}
#endif
@@ -765,15 +767,18 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
startOutDir = cmSystemTools::CollapseFullPath(startOutDir);
cm.SetHomeDirectory(homeDir);
cm.SetHomeOutputDirectory(homeOutDir);
+ cm.GetCurrentSnapshot().SetDefaultDefinitions();
if(cmGlobalGenerator* ggd = cm.CreateGlobalGenerator(gen))
{
cm.SetGlobalGenerator(ggd);
cmState::Snapshot snapshot = cm.GetCurrentSnapshot();
+ snapshot.GetDirectory().SetCurrentBinary
+ (cmSystemTools::GetCurrentWorkingDirectory());
+ snapshot.GetDirectory().SetCurrentSource
+ (cmSystemTools::GetCurrentWorkingDirectory());
cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(ggd, snapshot));
cmsys::auto_ptr<cmLocalGenerator> lgd(
ggd->CreateLocalGenerator(mf.get()));
- lgd->GetMakefile()->SetCurrentSourceDirectory(startDir);
- lgd->GetMakefile()->SetCurrentBinaryDirectory(startOutDir);
// Actually scan dependencies.
return lgd->UpdateDependencies(depInfo.c_str(),