diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-04-21 14:34:08 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-04-21 14:34:08 (GMT) |
commit | 4d55c6540a7e1416beaa4a780cf77a2d8ce14530 (patch) | |
tree | b2b0b5890c94f438d7dfc3d511c3830c907e92a2 /Source/ctest.cxx | |
parent | 00095676ccdd3d16dd0c9251789e8fedad630fdf (diff) | |
download | CMake-4d55c6540a7e1416beaa4a780cf77a2d8ce14530.zip CMake-4d55c6540a7e1416beaa4a780cf77a2d8ce14530.tar.gz CMake-4d55c6540a7e1416beaa4a780cf77a2d8ce14530.tar.bz2 |
ENH: Report error and exit when the current directory is not specified
Diffstat (limited to 'Source/ctest.cxx')
-rw-r--r-- | Source/ctest.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Source/ctest.cxx b/Source/ctest.cxx index 0b3b7be..9a0ebdc 100644 --- a/Source/ctest.cxx +++ b/Source/ctest.cxx @@ -101,6 +101,15 @@ static const cmDocumentationEntry cmDocumentationSeeAlso[] = int main (int argc, char *argv[]) { cmSystemTools::EnableMSVCDebugHook(); + int nocwd = 0; + + if ( cmSystemTools::GetCurrentWorkingDirectory().size() == 0 ) + { + std::cerr << "Current working directory cannot be established." << std::endl; + nocwd = 1; + } + + // If there is a testing input file, check for documentation options // only if there are actually arguments. We want running without @@ -114,7 +123,7 @@ int main (int argc, char *argv[]) std::cout << "*********************************" << std::endl; } cmDocumentation doc; - if(doc.CheckOptions(argc, argv)) + if(doc.CheckOptions(argc, argv) || nocwd) { // Construct and print requested documentation. doc.SetName("ctest"); |