diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2003-08-04 00:47:44 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2003-08-04 00:47:44 (GMT) |
commit | c7f1198a0062a24edf3166e5f4cfcdcbb8b556f7 (patch) | |
tree | 21c76e21802cf818682bdb187b2152f7e705f16f /Source | |
parent | 32bfe66b5d261bfc6c9f43f045f56651b8f012ea (diff) | |
download | CMake-c7f1198a0062a24edf3166e5f4cfcdcbb8b556f7.zip CMake-c7f1198a0062a24edf3166e5f4cfcdcbb8b556f7.tar.gz CMake-c7f1198a0062a24edf3166e5f4cfcdcbb8b556f7.tar.bz2 |
ENH: Add accessor for the list of commands
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGetCMakePropertyCommand.cxx | 16 | ||||
-rw-r--r-- | Source/cmGetCMakePropertyCommand.h | 2 | ||||
-rw-r--r-- | Source/cmake.h | 6 |
3 files changed, 22 insertions, 2 deletions
diff --git a/Source/cmGetCMakePropertyCommand.cxx b/Source/cmGetCMakePropertyCommand.cxx index 8788009..0b66b14 100644 --- a/Source/cmGetCMakePropertyCommand.cxx +++ b/Source/cmGetCMakePropertyCommand.cxx @@ -47,6 +47,22 @@ bool cmGetCMakePropertyCommand::InitialPass( output += vars[cc]; } } + else if ( args[1] == "COMMANDS" ) + { + cmake::RegisteredCommandsMap::iterator cmds + = m_Makefile->GetCMakeInstance()->GetCommands()->begin(); + for (cc=0 ; + cmds != m_Makefile->GetCMakeInstance()->GetCommands()->end(); + ++ cmds ) + { + if ( cc > 0 ) + { + output += ";"; + } + output += cmds->first.c_str(); + cc++; + } + } else { std::string emsg = "Unknown CMake property: " + args[1]; diff --git a/Source/cmGetCMakePropertyCommand.h b/Source/cmGetCMakePropertyCommand.h index ffb7c0e..5a2eaf3 100644 --- a/Source/cmGetCMakePropertyCommand.h +++ b/Source/cmGetCMakePropertyCommand.h @@ -57,7 +57,7 @@ public: "Get a property from the CMake. The value of the property is" "stored in the variable VAR. If the property is not found," "CMake will report an error. The properties include: VARIABLES, " - "CACHE_VARIABLES."; + "CACHE_VARIABLES, COMMANDS."; } cmTypeMacro(cmGetCMakePropertyCommand, cmCommand); diff --git a/Source/cmake.h b/Source/cmake.h index ccaa409..fc7b4ac 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -50,6 +50,8 @@ class cmVariableWatch; class cmake { public: + typedef std::map<cmStdString, cmCommand*> RegisteredCommandsMap; + ///! construct an instance of cmake cmake(); ///! destruct an instance of cmake @@ -193,6 +195,9 @@ class cmake */ cmCommand *GetCommand(const char *name); + /** Get list of all commands */ + RegisteredCommandsMap* GetCommands() { return &m_Commands; } + /** Check if a command exists. */ bool CommandExists(const char* name) const; @@ -242,7 +247,6 @@ class cmake protected: typedef cmGlobalGenerator* (*CreateGeneratorFunctionType)(); - typedef std::map<cmStdString, cmCommand*> RegisteredCommandsMap; typedef std::map<cmStdString, CreateGeneratorFunctionType> RegisteredGeneratorsMap; RegisteredCommandsMap m_Commands; RegisteredGeneratorsMap m_Generators; |