summaryrefslogtreecommitdiffstats
path: root/Source/cmakemain.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2004-04-21 14:34:08 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2004-04-21 14:34:08 (GMT)
commit4d55c6540a7e1416beaa4a780cf77a2d8ce14530 (patch)
treeb2b0b5890c94f438d7dfc3d511c3830c907e92a2 /Source/cmakemain.cxx
parent00095676ccdd3d16dd0c9251789e8fedad630fdf (diff)
downloadCMake-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/cmakemain.cxx')
-rw-r--r--Source/cmakemain.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 3b29bf5..2e7ff84 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -110,7 +110,15 @@ int main(int ac, char** av)
int do_cmake(int ac, char** av)
{
cmDocumentation doc;
- if(doc.CheckOptions(ac, av))
+ int nocwd = 0;
+
+ if ( cmSystemTools::GetCurrentWorkingDirectory().size() == 0 )
+ {
+ std::cerr << "Current working directory cannot be established." << std::endl;
+ nocwd = 1;
+ }
+
+ if(doc.CheckOptions(ac, av) || nocwd)
{
// Construct and print requested documentation.
cmake hcm;