summaryrefslogtreecommitdiffstats
path: root/Source/CMakeBuildTargets.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2001-05-07 22:11:16 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2001-05-07 22:11:16 (GMT)
commit885e37da224353e242e7135b0fc8e6f2445a54c7 (patch)
tree17effe2cbc6b46afcd670ffe45f0fcbb8c7d01b6 /Source/CMakeBuildTargets.cxx
parent5066defc2378172be5bcfc22238d9cb68f05bb29 (diff)
downloadCMake-885e37da224353e242e7135b0fc8e6f2445a54c7.zip
CMake-885e37da224353e242e7135b0fc8e6f2445a54c7.tar.gz
CMake-885e37da224353e242e7135b0fc8e6f2445a54c7.tar.bz2
ENH: call configure from cmake
Diffstat (limited to 'Source/CMakeBuildTargets.cxx')
-rw-r--r--Source/CMakeBuildTargets.cxx24
1 files changed, 13 insertions, 11 deletions
diff --git a/Source/CMakeBuildTargets.cxx b/Source/CMakeBuildTargets.cxx
index 0fa4086..d813f35 100644
--- a/Source/CMakeBuildTargets.cxx
+++ b/Source/CMakeBuildTargets.cxx
@@ -104,14 +104,23 @@ int main(int ac, char** av)
std::string path = arg.substr(2);
mf.SetHomeOutputDirectory(path.c_str());
}
+ if(arg.find("-D",0) == 0)
+ {
+ std::string value = arg.substr(2);
+ mf.AddDefinition(value.c_str(), true);
+ }
}
}
// Only generate makefiles if not trying to make the cache
- if(!makeCache)
+ cmUnixMakefileGenerator* gen = new cmUnixMakefileGenerator;
+ mf.SetMakefileGenerator(gen);
+ if(makeCache)
{
- mf.SetMakefileGenerator(new cmUnixMakefileGenerator);
+ // generate only enough for the cache
+ gen->SetCacheOnlyOn();
+ // generate for this makefile and all below it
+ gen->SetRecurseOn();
}
-
// Read and parse the input makefile
mf.MakeStartDirectoriesCurrent();
@@ -137,14 +146,7 @@ int main(int ac, char** av)
Usage(av[0]);
return -1;
}
- if(makeCache)
- {
- mf.GenerateCacheOnly();
- }
- else
- {
- mf.GenerateMakefile();
- }
+ mf.GenerateMakefile();
cmCacheManager::GetInstance()->SaveCache(&mf);
if(makeCache)
{