diff options
author | Ken Martin <ken.martin@kitware.com> | 2002-08-28 18:51:10 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2002-08-28 18:51:10 (GMT) |
commit | d0be2896d7191e56818aaac48f7177b9d92a9693 (patch) | |
tree | 42c3a9c07f1ccd9fe8683051c921463e9d639dc7 /Source/cmUnixMakefileGenerator.cxx | |
parent | 4855fe5c10841fd3641b7405522de3278732987f (diff) | |
download | CMake-d0be2896d7191e56818aaac48f7177b9d92a9693.zip CMake-d0be2896d7191e56818aaac48f7177b9d92a9693.tar.gz CMake-d0be2896d7191e56818aaac48f7177b9d92a9693.tar.bz2 |
changed cache manager and registered generators to no longer be singletons
Diffstat (limited to 'Source/cmUnixMakefileGenerator.cxx')
-rw-r--r-- | Source/cmUnixMakefileGenerator.cxx | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Source/cmUnixMakefileGenerator.cxx b/Source/cmUnixMakefileGenerator.cxx index 915493b..6bd0cb9 100644 --- a/Source/cmUnixMakefileGenerator.cxx +++ b/Source/cmUnixMakefileGenerator.cxx @@ -2202,3 +2202,40 @@ void cmUnixMakefileGenerator::EnableLanguage(const char* lang) m_Makefile->AddDefinition("RUN_CONFIGURE", true); } } + +int cmUnixMakefileGenerator::TryCompile(const char *srcdir, + const char *bindir, + const char *) +{ + // now build the test + std::string makeCommand = m_Makefile->GetDefinition("CMAKE_MAKE_PROGRAM"); + if(makeCommand.size() == 0) + { + cmSystemTools::Error( + "Generator cannot find the appropriate make command."); + return 1; + } + makeCommand = cmSystemTools::ConvertToOutputPath(makeCommand.c_str()); + + /** + * Run an executable command and put the stdout in output. + */ + std::string output; + + std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); + cmSystemTools::ChangeDirectory(bindir); + + // now build + makeCommand += " all"; + + if (!cmSystemTools::RunCommand(makeCommand.c_str(), output)) + { + cmSystemTools::Error("Generator: execution of make failed."); + // return to the original directory + cmSystemTools::ChangeDirectory(cwd.c_str()); + return 1; + } + cmSystemTools::ChangeDirectory(cwd.c_str()); + return 0; +} + |