diff options
author | Eric NOULARD <eric.noulard@gmail.com> | 2011-11-15 19:24:38 (GMT) |
---|---|---|
committer | Eric NOULARD <eric.noulard@gmail.com> | 2012-01-22 10:44:05 (GMT) |
commit | 83e34dd9e688b4721c70c56e66629bdc2768fa77 (patch) | |
tree | bae87f4bb777b7c9e73d77628f52da25add82b4c /Source/CPack | |
parent | c6a016944211b737c45385423fc7df10462e34ab (diff) | |
download | CMake-83e34dd9e688b4721c70c56e66629bdc2768fa77.zip CMake-83e34dd9e688b4721c70c56e66629bdc2768fa77.tar.gz CMake-83e34dd9e688b4721c70c56e66629bdc2768fa77.tar.bz2 |
Implement simple CMake script comment markup language.
The language is very simple. It use ##<keyword> special comment
which opens a structured documentation block and ##end closes it.
This may be used to extract documentation for macro as 'command'
and 'variables' such that cpack --help-command and --help-variable
does parse builtin modules files (CPack.cmake, CPackComponent.cmake,
...) in order to extract the corresponding doc.
Diffstat (limited to 'Source/CPack')
-rw-r--r-- | Source/CPack/cmCPackDocumentMacros.cxx | 2 | ||||
-rw-r--r-- | Source/CPack/cmCPackDocumentVariables.cxx | 6 | ||||
-rw-r--r-- | Source/CPack/cpack.cxx | 34 |
3 files changed, 33 insertions, 9 deletions
diff --git a/Source/CPack/cmCPackDocumentMacros.cxx b/Source/CPack/cmCPackDocumentMacros.cxx index 0dd51a9..1ff0351 100644 --- a/Source/CPack/cmCPackDocumentMacros.cxx +++ b/Source/CPack/cmCPackDocumentMacros.cxx @@ -74,5 +74,5 @@ void cmCPackDocumentMacros::GetMacrosDocumentation( "information." ); - v.push_back(e); + //v.push_back(e); } diff --git a/Source/CPack/cmCPackDocumentVariables.cxx b/Source/CPack/cmCPackDocumentVariables.cxx index 1c98e7c..ab806d2 100644 --- a/Source/CPack/cmCPackDocumentVariables.cxx +++ b/Source/CPack/cmCPackDocumentVariables.cxx @@ -5,12 +5,6 @@ void cmCPackDocumentVariables::DefineVariables(cmake* cm) { // Subsection: variables defined/used by cpack, // which are common to all CPack generators - cm->DefineProperty - ("CPACK_PACKAGE_NAME", cmProperty::VARIABLE, - "The name of the package (or application).", - "If not specified, defaults to the project name." - "", false, - "Variables common to all CPack generators"); cm->DefineProperty ("CPACK_PACKAGE_VENDOR", cmProperty::VARIABLE, diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index 2cfbf12..8e59fa0 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -520,11 +520,41 @@ int main (int argc, char *argv[]) doc.PrependSection("Options",cmDocumentationOptions); cmCPackDocumentVariables::DefineVariables(&cminst); + + std::vector<cmDocumentationEntry> commands; + + cminst.AddCMakePaths(); + std::string systemFile = + globalMF->GetModulesFile("CMakeDetermineSystem.cmake"); + if (!globalMF->ReadListFile(0, systemFile.c_str())) + { + cmCPack_Log(&log, cmCPackLog::LOG_ERROR, + "Error reading CMakeDetermineSystem.cmake" << std::endl); + return 1; + } + + systemFile = + globalMF->GetModulesFile("CMakeSystemSpecificInformation.cmake"); + if (!globalMF->ReadListFile(0, systemFile.c_str())) + { + cmCPack_Log(&log, cmCPackLog::LOG_ERROR, + "Error reading CMakeSystemSpecificInformation.cmake" + << std::endl); + return 1; + } + std::string cpFile = globalMF->GetModulesFile("CPack.cmake"); + doc.getStructuredDocFromFile(cpFile.c_str(), + commands,&cminst,"Variables common to all CPack generators"); + cpFile = globalMF->GetModulesFile("CPackComponent.cmake"); + doc.getStructuredDocFromFile(cpFile.c_str(), + commands,&cminst,"Variables common to all CPack generators"); + cpFile = globalMF->GetModulesFile("CPackRPM.cmake"); + doc.getStructuredDocFromFile(cpFile.c_str(), + commands,&cminst,"Variables specific to a CPack generator"); + std::map<std::string,cmDocumentationSection *> propDocs; cminst.GetPropertiesDocumentation(propDocs); doc.SetSections(propDocs); - - std::vector<cmDocumentationEntry> commands; cminst.GetCommandDocumentation(commands); cmCPackDocumentMacros::GetMacrosDocumentation(commands); doc.SetSection("Commands",commands); |