summaryrefslogtreecommitdiffstats
path: root/Source/cmakemain.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2003-04-03 03:48:12 (GMT)
committerBrad King <brad.king@kitware.com>2003-04-03 03:48:12 (GMT)
commita5ea72df8856aada1ac9cd9916466a078a6ff9d3 (patch)
treed1a36bdb4356124b2ffd6701a4bc160f25bb2c1f /Source/cmakemain.cxx
parent3bba5f587e719bed322e2d9aeca57283907b7ef9 (diff)
downloadCMake-a5ea72df8856aada1ac9cd9916466a078a6ff9d3.zip
CMake-a5ea72df8856aada1ac9cd9916466a078a6ff9d3.tar.gz
CMake-a5ea72df8856aada1ac9cd9916466a078a6ff9d3.tar.bz2
ENH: Improved documentation. Also modified behavior of "cmake" to not configure a project in the current directory unless . is given.
Diffstat (limited to 'Source/cmakemain.cxx')
-rw-r--r--Source/cmakemain.cxx30
1 files changed, 29 insertions, 1 deletions
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 6a0dc1f..37be15a 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -48,7 +48,21 @@ static const cmDocumentationEntry cmDocumentationDescription[] =
//----------------------------------------------------------------------------
static const cmDocumentationEntry cmDocumentationOptions[] =
{
- {"-i", "Run in wizard mode.", 0},
+ CMAKE_STANDARD_OPTIONS_TABLE,
+ {"-i", "Run in wizard mode.",
+ "Wizard mode runs cmake interactively without a GUI. The user is "
+ "prompted to answer questions about the project configuration. "
+ "The answers are used to set cmake cache values."},
+ {0,0,0}
+};
+
+//----------------------------------------------------------------------------
+static const cmDocumentationEntry cmDocumentationNOTE[] =
+{
+ {0,
+ "CMake no longer configures a project when run with no arguments. "
+ "In order to configure the project in the current directory, run\n"
+ " cmake .", 0},
{0,0,0}
};
@@ -71,6 +85,7 @@ int do_cmake(int ac, char** av)
cmDocumentation doc;
if(cmDocumentation::Type ht = doc.CheckOptions(ac, av))
{
+ // Construct and print requested documentation.
cmake hcm;
std::vector<cmDocumentationEntry> commands;
hcm.GetCommandDocumentation(commands);
@@ -80,6 +95,19 @@ int do_cmake(int ac, char** av)
doc.SetOptionsSection(cmDocumentationOptions);
doc.SetCommandsSection(&commands[0]);
doc.PrintDocumentation(ht, std::cout);
+
+ // If we were run with no arguments, but a CMakeLists.txt file
+ // exists, the user may have been trying to use the old behavior
+ // of cmake to build a project in-source. Print a message
+ // explaining the change to standard error and return an error
+ // condition in case the program is running from a script.
+ if((ac == 1) && cmSystemTools::FileExists("CMakeLists.txt"))
+ {
+ doc.ClearSections();
+ doc.AddSection("NOTE", cmDocumentationNOTE);
+ doc.Print(cmDocumentation::UsageForm, std::cerr);
+ return 1;
+ }
return 0;
}