ENH: Update documentation of computed directory properites.

- Fix documentation of get_directory_property command.
  - Convert its list of computed directory properties to be
    defined/documented directory properties.
This commit is contained in:
Brad King 2008-06-26 10:58:44 -04:00
parent 2ca9a70fd1
commit d8e05b43a1
2 changed files with 74 additions and 13 deletions

View File

@ -49,7 +49,7 @@ public:
*/ */
virtual const char* GetTerseDocumentation() virtual const char* GetTerseDocumentation()
{ {
return "Get a property of the directory."; return "Get a property of DIRECTORY scope.";
} }
/** /**
@ -58,17 +58,20 @@ public:
virtual const char* GetFullDocumentation() virtual const char* GetFullDocumentation()
{ {
return return
" get_directory_property(VAR [DIRECTORY dir] property)\n" " get_directory_property(<variable> [DIRECTORY <dir>] <prop-name>)\n"
"Get a property from the Directory. The value of the property is " "Store a property of directory scope in the named variable. "
"stored in the variable VAR. If the property is not found, " "If the property is not defined the empty-string is returned. "
"CMake will report an error. The properties include: VARIABLES, " "The DIRECTORY argument specifies another directory from which "
"CACHE_VARIABLES, COMMANDS, MACROS, INCLUDE_DIRECTORIES, " "to retrieve the property value. "
"LINK_DIRECTORIES, DEFINITIONS, INCLUDE_REGULAR_EXPRESSION, " "The specified directory must have already been traversed by "
"LISTFILE_STACK, PARENT_DIRECTORY, and " "CMake."
"DEFINITION varname. If the DIRECTORY argument is provided then " "\n"
"the property of the provided directory will be retrieved " " get_directory_property(<variable> [DIRECTORY <dir>]\n"
"instead of the current directory. You can only get properties " " DEFINITION <var-name>)\n"
"of a directory during or after it has been traversed by cmake."; "Get a variable definition from a directory. "
"This form is useful to get a variable definition from another "
"directory."
;
} }
cmTypeMacro(cmGetDirectoryPropertyCommand, cmCommand); cmTypeMacro(cmGetDirectoryPropertyCommand, cmCommand);

View File

@ -3191,7 +3191,7 @@ void cmMakefile::DefineProperties(cmake *cm)
"in your CMake scripts. It returns a list of what list files " "in your CMake scripts. It returns a list of what list files "
"are currently being processed, in order. So if one listfile " "are currently being processed, in order. So if one listfile "
"does an INCLUDE command then that is effectively pushing " "does an INCLUDE command then that is effectively pushing "
"the included listfile onto the stack."); "the included listfile onto the stack.", false);
cm->DefineProperty cm->DefineProperty
("TEST_INCLUDE_FILE", cmProperty::DIRECTORY, ("TEST_INCLUDE_FILE", cmProperty::DIRECTORY,
@ -3260,6 +3260,64 @@ void cmMakefile::DefineProperties(cmake *cm)
"for example typing make will cause the targets to be built. " "for example typing make will cause the targets to be built. "
"The same concept applies to the default build of other generators.", "The same concept applies to the default build of other generators.",
false); false);
cm->DefineProperty
("PARENT_DIRECTORY", cmProperty::DIRECTORY,
"Source directory that added current subdirectory.",
"This read-only property specifies the source directory that "
"added the current source directory as a subdirectory of the build. "
"In the top-level directory the value is the empty-string.", false);
cm->DefineProperty
("INCLUDE_REGULAR_EXPRESSION", cmProperty::DIRECTORY,
"Include file scanning regular expression.",
"This read-only property specifies the regular expression used "
"during dependency scanning to match include files that should "
"be followed. See the include_regular_expression command.", false);
cm->DefineProperty
("VARIABLES", cmProperty::DIRECTORY,
"List of variables defined in the current directory.",
"This read-only property specifies the list of CMake variables "
"currently defined. "
"It is intended for debugging purposes.", false);
cm->DefineProperty
("CACHE_VARIABLES", cmProperty::DIRECTORY,
"List of cache variables available in the current directory.",
"This read-only property specifies the list of CMake cache "
"variables currently defined. "
"It is intended for debugging purposes.", false);
cm->DefineProperty
("MACROS", cmProperty::DIRECTORY,
"List of macro commands available in the current directory.",
"This read-only property specifies the list of CMake macros "
"currently defined. "
"It is intended for debugging purposes. "
"See the macro command.", false);
cm->DefineProperty
("DEFINITIONS", cmProperty::DIRECTORY,
"For CMake 2.4 compatibility only. Use COMPILE_DEFINITIONS instead.",
"This read-only property specifies the list of flags given so far "
"to the add_definitions command. "
"It is intended for debugging purposes. "
"Use the COMPILE_DEFINITIONS instead.", false);
cm->DefineProperty
("INCLUDE_DIRECTORIES", cmProperty::DIRECTORY,
"List of preprocessor include file search directories.",
"This read-only property specifies the list of directories given "
"so far to the include_directories command. "
"It is intended for debugging purposes.", false);
cm->DefineProperty
("LINK_DIRECTORIES", cmProperty::DIRECTORY,
"List of linker search directories.",
"This read-only property specifies the list of directories given "
"so far to the link_directories command. "
"It is intended for debugging purposes.", false);
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------