diff options
author | Ken Martin <ken.martin@kitware.com> | 2002-09-10 20:49:40 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2002-09-10 20:49:40 (GMT) |
commit | 38e412626b604d7f79cac82153047fc59b55597f (patch) | |
tree | c4b06f6f515e5486f287408575d9336c52645668 /Source/cmGlobalGenerator.cxx | |
parent | 820088cefc2831a887c141dc4daf6dd758c4c365 (diff) | |
download | CMake-38e412626b604d7f79cac82153047fc59b55597f.zip CMake-38e412626b604d7f79cac82153047fc59b55597f.tar.gz CMake-38e412626b604d7f79cac82153047fc59b55597f.tar.bz2 |
modified TryCompile
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index f20d3c2..164a138 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -138,7 +138,7 @@ void cmGlobalGenerator::LocalGenerate() } int cmGlobalGenerator::TryCompile(const char *, const char *bindir, - const char *) + const char *, const char *target) { // now build the test std::string makeCommand = @@ -159,8 +159,17 @@ int cmGlobalGenerator::TryCompile(const char *, const char *bindir, cmSystemTools::ChangeDirectory(bindir); // now build - makeCommand += " all"; - if (!cmSystemTools::RunCommand(makeCommand.c_str(), output)) + if (target) + { + makeCommand += " "; + makeCommand += target; + } + else + { + makeCommand += " all"; + } + int retVal; + if (!cmSystemTools::RunCommand(makeCommand.c_str(), output, retVal)) { cmSystemTools::Error("Generator: execution of make failed."); // return to the original directory @@ -168,7 +177,7 @@ int cmGlobalGenerator::TryCompile(const char *, const char *bindir, return 1; } cmSystemTools::ChangeDirectory(cwd.c_str()); - return 0; + return retVal; } cmLocalGenerator *cmGlobalGenerator::CreateLocalGenerator() |