summaryrefslogtreecommitdiffstats
path: root/Source/CMakeBuildTargets.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2000-09-21 17:45:08 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2000-09-21 17:45:08 (GMT)
commit1e3ba0f1d72873233193ce69614fd4bd880e8fc5 (patch)
treeda0313b2bf9af52e9b17f639d78a940788c30a2a /Source/CMakeBuildTargets.cxx
parent749b7ff7a3556934f4a7d6ead0f9a4d3ade7fad0 (diff)
downloadCMake-1e3ba0f1d72873233193ce69614fd4bd880e8fc5.zip
CMake-1e3ba0f1d72873233193ce69614fd4bd880e8fc5.tar.gz
CMake-1e3ba0f1d72873233193ce69614fd4bd880e8fc5.tar.bz2
ENH: clean up code, and varible names
Diffstat (limited to 'Source/CMakeBuildTargets.cxx')
-rw-r--r--Source/CMakeBuildTargets.cxx29
1 files changed, 20 insertions, 9 deletions
diff --git a/Source/CMakeBuildTargets.cxx b/Source/CMakeBuildTargets.cxx
index 0da1410..eea02d9 100644
--- a/Source/CMakeBuildTargets.cxx
+++ b/Source/CMakeBuildTargets.cxx
@@ -2,6 +2,9 @@
#include "cmMakeDepend.h"
#include <iostream>
+
+// This is the main program used to gentrate makefile fragments
+// from CMakeLists.txt input files.
main(int ac, char** av)
{
if(ac < 2)
@@ -9,38 +12,46 @@ main(int ac, char** av)
std::cerr << "Usage: " << av[0] << " Makefile.in -Ipath ..." << std::endl;
return -1;
}
- cmUnixMakefile* mf = new cmUnixMakefile;
+ // Create a unix makefile
+ cmUnixMakefile mf;
+ // Create a depends object
cmMakeDepend md;
+ // Parse the command line
if(ac > 2)
{
for(int i =2; i < ac; i++)
{
std::string arg = av[i];
+ // Set the current source directory with a -S dir options
if(arg.find("-S",0) != std::string::npos)
{
std::string path = arg.substr(2);
- mf->SetCurrentDirectory(path.c_str());
+ mf.SetCurrentDirectory(path.c_str());
}
+ // Set the output or binary directory with a -B dir option
if(arg.find("-B",0) != std::string::npos)
{
std::string path = arg.substr(2);
- mf->SetOutputHomeDirectory(path.c_str());
+ mf.SetOutputHomeDirectory(path.c_str());
}
+ // Set the source home directory with a -H dir option
if(arg.find("-H",0) != std::string::npos)
{
std::string path = arg.substr(2);
- mf->SetHomeDirectory(path.c_str());
+ mf.SetHomeDirectory(path.c_str());
}
}
}
- if(!mf->ReadMakefile(av[1]))
+ // Read and parse the input makefile
+ if(!mf.ReadMakefile(av[1]))
{
std::cerr << "Usage: " << av[0] << " Makefile.in -Ipath ..." << std::endl;
return -1;
}
-
- md.SetMakefile(mf);
+ // Set the makefile object on the depend object
+ md.SetMakefile(&mf);
+ // compute the depend information
md.DoDepends();
- mf->OutputMakefile("CMakeTargets.make");
- delete mf;
+ // Ouput the result
+ mf.OutputMakefile("CMakeTargets.make");
}