diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2006-05-10 22:15:09 -0400 |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2006-05-10 22:15:09 -0400 |
commit | e2c41d8436f8c82bd269ee831b23b98aafd9bb5a (patch) | |
tree | 51802bd4898d24d77f1ca62ed6f4117a0cc62f99 | |
parent | ec4fbc338c6f5ed25700cd453326f90cc1313f39 (diff) | |
download | cmake-e2c41d8436f8c82bd269ee831b23b98aafd9bb5a.tar.gz |
ENH: move changes from main tree
62 files changed, 480 insertions, 332 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e37e0d4d0..f2065591c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -272,6 +272,7 @@ IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") SET(CPACK_NSIS_MODIFY_PATH ON) ELSE(WIN32 AND NOT UNIX) SET(CPACK_STRIP_FILES "bin/ccmake;bin/cmake;bin/cpack;bin/ctest") + SET(CPACK_SOURCE_STRIP_FILES "") SET(CPACK_PACKAGE_EXECUTABLES "ccmake" "CMake") ENDIF(WIN32 AND NOT UNIX) INCLUDE(CPack) diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake index d5e9b4167d..316f269c11 100644 --- a/Modules/CPack.cmake +++ b/Modules/CPack.cmake @@ -121,6 +121,7 @@ SET(CPACK_GENERATOR "${CPACK_SOURCE_GENERATOR}") SET(CPACK_TOPLEVEL_TAG "${CPACK_SOURCE_TOPLEVEL_TAG}") SET(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}") SET(CPACK_IGNORE_FILES "${CPACK_SOURCE_IGNORE_FILES}") +SET(CPACK_STRIP_FILES "${CPACK_SOURCE_STRIP_FILES}") cpack_encode_variables() CONFIGURE_FILE("${cpack_source_input_file}" diff --git a/Modules/NSIS.InstallOptions.ini.in b/Modules/NSIS.InstallOptions.ini.in index 1472a519f4..aed2df9e74 100644 --- a/Modules/NSIS.InstallOptions.ini.in +++ b/Modules/NSIS.InstallOptions.ini.in @@ -1,5 +1,5 @@ [Settings] -NumFields=3 +NumFields=4 [Field 1] Type=label @@ -10,20 +10,28 @@ Top=0 Bottom=20 [Field 2] -Type=checkbox -Text=Check this option to add the path to the system PATH +Type=radiobutton +Text=Do not add @CPACK_PACKAGE_NAME@ to the system PATH Left=0 Right=-1 Top=30 Bottom=40 -State=0 +State=1 [Field 3] -Type=checkbox -Text=If administrator, add to the PATH for all users. +Type=radiobutton +Text=Add @CPACK_PACKAGE_NAME@ to the system PATH for all users Left=0 Right=-1 Top=40 Bottom=50 -State=1 +State=0 +[Field 4] +Type=radiobutton +Text=Add @CPACK_PACKAGE_NAME@ to the system PATH for current user +Left=0 +Right=-1 +Top=50 +Bottom=60 +State=0 diff --git a/Modules/NSIS.template.in b/Modules/NSIS.template.in index 780b5721b7..95951266ba 100644 --- a/Modules/NSIS.template.in +++ b/Modules/NSIS.template.in @@ -14,8 +14,9 @@ Var STARTMENU_FOLDER Var SV_ALLUSERS Var START_MENU - Var ADD_TO_PATH + Var DO_NOT_ADD_TO_PATH Var ADD_TO_PATH_ALL_USERS + Var ADD_TO_PATH_CURRENT_USER ;-------------------------------- ;Include Modern UI @@ -66,6 +67,7 @@ Function .onInit StrCmp "@CPACK_NSIS_MODIFY_PATH@" "ON" 0 noOptionsPage !insertmacro MUI_INSTALLOPTIONS_EXTRACT "NSIS.InstallOptions.ini" + noOptionsPage: FunctionEnd @@ -441,9 +443,10 @@ FunctionEnd Section "Add to path" Push $INSTDIR\bin ;Read a value from an InstallOptions INI file - !insertmacro MUI_INSTALLOPTIONS_READ $ADD_TO_PATH "NSIS.InstallOptions.ini" "Field 2" "State" + !insertmacro MUI_INSTALLOPTIONS_READ $DO_NOT_ADD_TO_PATH "NSIS.InstallOptions.ini" "Field 2" "State" !insertmacro MUI_INSTALLOPTIONS_READ $ADD_TO_PATH_ALL_USERS "NSIS.InstallOptions.ini" "Field 3" "State" - StrCmp $ADD_TO_PATH "1" 0 doNotAddToPath + !insertmacro MUI_INSTALLOPTIONS_READ $ADD_TO_PATH_CURRENT_USER "NSIS.InstallOptions.ini" "Field 4" "State" + StrCmp $DO_NOT_ADD_TO_PATH "1" doNotAddToPath 0 Call AddToPath doNotAddToPath: SectionEnd @@ -498,12 +501,15 @@ Section "Installer Section" InstSection Push "StartMenu" Push "$STARTMENU_FOLDER" Call ConditionalAddToRegisty - Push "AddToPath" - Push "$ADD_TO_PATH" + Push "DoNotAddToPath" + Push "$DO_NOT_ADD_TO_PATH" Call ConditionalAddToRegisty Push "AddToPathAllUsers" Push "$ADD_TO_PATH_ALL_USERS" Call ConditionalAddToRegisty + Push "AddToPathCurrentUser" + Push "$ADD_TO_PATH_CURRENT_USER" + Call ConditionalAddToRegisty @CPACK_NSIS_EXTRA_INSTALL_COMMANDS@ @@ -516,6 +522,7 @@ SectionEnd Function InstallOptionsPage !insertmacro MUI_HEADER_TEXT "Install Options" "Chose options for installing @CPACK_PACKAGE_INSTALL_DIRECTORY@" !insertmacro MUI_INSTALLOPTIONS_DISPLAY "NSIS.InstallOptions.ini" + FunctionEnd ;-------------------------------- @@ -550,11 +557,13 @@ Section "Uninstall" ReadRegStr $START_MENU SHCTX \ "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_DIRECTORY@" "StartMenu" ;MessageBox MB_OK "Start menu is in: $START_MENU" - ReadRegStr $ADD_TO_PATH SHCTX \ - "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_DIRECTORY@" "AddToPath" + ReadRegStr $DO_NOT_ADD_TO_PATH SHCTX \ + "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_DIRECTORY@" "DoNotAddToPath" ReadRegStr $ADD_TO_PATH_ALL_USERS SHCTX \ "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_DIRECTORY@" "AddToPathAllUsers" - ;MessageBox MB_OK "Add to path: $ADD_TO_PATH all users: $ADD_TO_PATH_ALL_USERS" + ReadRegStr $ADD_TO_PATH_CURRENT_USER SHCTX \ + "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_DIRECTORY@" "AddToPathCurrentUser" + ;MessageBox MB_OK "Add to path: $DO_NOT_ADD_TO_PATH all users: $ADD_TO_PATH_ALL_USERS" @CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS@ @@ -613,7 +622,7 @@ Section "Uninstall" DeleteRegKey /ifempty SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" Push $INSTDIR\bin - StrCmp $ADD_TO_PATH "1" 0 doNotRemoveFromPath + StrCmp $DO_NOT_ADD_TO_PATH_ "1" doNotRemoveFromPath 0 Call un.RemoveFromPath doNotRemoveFromPath: SectionEnd diff --git a/Source/CPack/cmCPackGenericGenerator.cxx b/Source/CPack/cmCPackGenericGenerator.cxx index 8d5c832a67..4d34cd3d74 100644 --- a/Source/CPack/cmCPackGenericGenerator.cxx +++ b/Source/CPack/cmCPackGenericGenerator.cxx @@ -282,6 +282,7 @@ int cmCPackGenericGenerator::InstallProject() = this->GetOption("CPACK_INSTALL_CMAKE_PROJECTS"); const char* cmakeGenerator = this->GetOption("CPACK_CMAKE_GENERATOR"); + std::string currentWorkingDirectory = cmSystemTools::GetCurrentWorkingDirectory(); if ( cmakeProjects && *cmakeProjects ) { if ( !cmakeGenerator ) diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index 3143c2a5f9..f421c83924 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -245,6 +245,7 @@ int main (int argc, char *argv[]) { if ( cmSystemTools::FileExists(cpackConfigFile.c_str()) ) { + cpackConfigFile = cmSystemTools::CollapseFullPath(cpackConfigFile.c_str()); if ( !mf->ReadListFile(0, cpackConfigFile.c_str()) ) { cmCPack_Log(&log, cmCPackLog::LOG_ERROR, @@ -337,23 +338,15 @@ int main (int argc, char *argv[]) } if ( !mf->GetDefinition("CPACK_INSTALL_COMMANDS") && - !mf->GetDefinition("CPACK_INSTALLED_DIRECTORIES") ) + !mf->GetDefinition("CPACK_INSTALLED_DIRECTORIES") && + !mf->GetDefinition("CPACK_INSTALL_CMAKE_PROJECTS") ) { - cmsys::SystemTools::ConvertToUnixSlashes(cpackProjectDirectory); - std::string makeInstallFile - = cpackProjectDirectory + "/cmake_install.cmake"; - if ( !cmsys::SystemTools::FileExists(makeInstallFile.c_str()) ) - { cmCPack_Log(&log, cmCPackLog::LOG_ERROR, - "Cannot find installation file: " << makeInstallFile.c_str() - << std::endl); - cmCPack_Log(&log, cmCPackLog::LOG_ERROR, - "Please specify build tree of the project that uses CMake, " - "specify CPACK_INSTALL_COMMANDS, or specify " - "CPACK_INSTALLED_DIRECTORIES." + "Please specify build tree of the project that uses CMake using " + " CPACK_INSTALL_CMAKE_PROJECTS, specify CPACK_INSTALL_COMMANDS, or " + "specify CPACK_INSTALLED_DIRECTORIES." << std::endl); parsed = 0; - } } } } diff --git a/Source/CTest/cmCTestGenericHandler.cxx b/Source/CTest/cmCTestGenericHandler.cxx index 6f0fb72a1f..4ce1d5beff 100644 --- a/Source/CTest/cmCTestGenericHandler.cxx +++ b/Source/CTest/cmCTestGenericHandler.cxx @@ -54,7 +54,8 @@ void cmCTestGenericHandler::SetOption(const char* op, const char* value) } //---------------------------------------------------------------------- -void cmCTestGenericHandler::SetPersistentOption(const char* op, const char* value) +void cmCTestGenericHandler::SetPersistentOption(const char* op, + const char* value) { this->SetOption(op, value); if ( !op ) diff --git a/Source/CTest/cmCTestHandlerCommand.cxx b/Source/CTest/cmCTestHandlerCommand.cxx index 89420bf499..09fd82ac3f 100644 --- a/Source/CTest/cmCTestHandlerCommand.cxx +++ b/Source/CTest/cmCTestHandlerCommand.cxx @@ -38,8 +38,8 @@ cmCTestHandlerCommand::cmCTestHandlerCommand() bool cmCTestHandlerCommand::InitialPass( std::vector<std::string> const& args) { - if ( !this->ProcessArguments(args, (unsigned int)this->Last, &*this->Arguments.begin(), - this->Values) ) + if ( !this->ProcessArguments(args, (unsigned int)this->Last, + &*this->Arguments.begin(),this->Values) ) { return false; } diff --git a/Source/CTest/cmCTestReadCustomFilesCommand.h b/Source/CTest/cmCTestReadCustomFilesCommand.h index 08febdfae2..cb870af6a8 100644 --- a/Source/CTest/cmCTestReadCustomFilesCommand.h +++ b/Source/CTest/cmCTestReadCustomFilesCommand.h @@ -67,8 +67,8 @@ public: { return " CTEST_READ_CUSTOM_FILES( directory ... )\n" - "Read all the CTestCustom.ctest or CTestCustom.cmake files from the given " - "directory."; + "Read all the CTestCustom.ctest or CTestCustom.cmake files from " + "the given directory."; } cmTypeMacro(cmCTestReadCustomFilesCommand, cmCTestCommand); diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 736e38d957..72788c00d9 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -167,7 +167,8 @@ cmCTestScriptHandler::~cmCTestScriptHandler() //---------------------------------------------------------------------- // just adds an argument to the vector -void cmCTestScriptHandler::AddConfigurationScript(const char *script, bool pscope) +void cmCTestScriptHandler::AddConfigurationScript(const char *script, + bool pscope) { this->ConfigurationScripts.push_back(script); this->ScriptProcessScope.push_back(pscope); @@ -253,7 +254,8 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg) int pipe = cmSystemTools::WaitForLine(cp, line, 100.0, out, err); while(pipe != cmsysProcess_Pipe_None) { - cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Output: " << line << "\n"); + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Output: " + << line << "\n"); if(pipe == cmsysProcess_Pipe_STDERR) { cmCTestLog(this->CTest, ERROR_MESSAGE, line << "\n"); @@ -927,7 +929,8 @@ void cmCTestScriptHandler::RestoreBackupDirectories() } } -bool cmCTestScriptHandler::RunScript(cmCTest* ctest, const char *sname, bool InProcess) +bool cmCTestScriptHandler::RunScript(cmCTest* ctest, const char *sname, + bool InProcess) { cmCTestScriptHandler* sh = new cmCTestScriptHandler(); sh->SetCTestInstance(ctest); diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 9e2b3b1d06..5da776f29c 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -111,7 +111,8 @@ bool cmCTestSubdirCommand::InitialPass(std::vector<std::string> const& args) } fname += "/"; fname += testFilename; - bool readit = this->Makefile->ReadListFile( this->Makefile->GetCurrentListFile(), + bool readit = + this->Makefile->ReadListFile(this->Makefile->GetCurrentListFile(), fname.c_str()); cmSystemTools::ChangeDirectory(cwd.c_str()); if(!readit) diff --git a/Source/CTest/cmCTestUpdateCommand.cxx b/Source/CTest/cmCTestUpdateCommand.cxx index 7d274b8d79..2c116c04b9 100644 --- a/Source/CTest/cmCTestUpdateCommand.cxx +++ b/Source/CTest/cmCTestUpdateCommand.cxx @@ -51,7 +51,8 @@ cmCTestGenericHandler* cmCTestUpdateCommand::InitializeHandler() = this->Makefile->GetDefinition("CTEST_CHECKOUT_COMMAND"); if ( !initialCheckoutCommand ) { - initialCheckoutCommand = this->Makefile->GetDefinition("CTEST_CVS_CHECKOUT"); + initialCheckoutCommand = + this->Makefile->GetDefinition("CTEST_CVS_CHECKOUT"); } cmCTestGenericHandler* handler diff --git a/Source/cmAddExecutableCommand.cxx b/Source/cmAddExecutableCommand.cxx index b440e03a07..d44fa9aa89 100644 --- a/Source/cmAddExecutableCommand.cxx +++ b/Source/cmAddExecutableCommand.cxx @@ -51,7 +51,8 @@ bool cmAddExecutableCommand::InitialPass(std::vector<std::string> const& args) if (s == args.end()) { - this->SetError("called with incorrect number of arguments, no sources provided"); + this->SetError + ("called with incorrect number of arguments, no sources provided"); return false; } diff --git a/Source/cmAddSubDirectoryCommand.cxx b/Source/cmAddSubDirectoryCommand.cxx index a134c594ee..e6957813da 100644 --- a/Source/cmAddSubDirectoryCommand.cxx +++ b/Source/cmAddSubDirectoryCommand.cxx @@ -17,7 +17,8 @@ #include "cmAddSubDirectoryCommand.h" // cmAddSubDirectoryCommand -bool cmAddSubDirectoryCommand::InitialPass(std::vector<std::string> const& args) +bool cmAddSubDirectoryCommand::InitialPass +(std::vector<std::string> const& args) { if(args.size() < 1 ) { @@ -103,7 +104,11 @@ bool cmAddSubDirectoryCommand::InitialPass(std::vector<std::string> const& args) if (!cmSystemTools::FindLastString(binPath.c_str(), this->Makefile->GetHomeDirectory())) { - this->SetError("A full source directory was specified that is not in the source tree but no binary directory was specified. If you specify an out of tree source directory then you must provide the binary directory as well."); + this->SetError("A full source directory was specified that is not " + "in the source tree but no binary directory was " + "specified. If you specify an out of tree source " + "directory then you must provide the binary " + "directory as well."); return false; } cmSystemTools::ReplaceString(binPath,this->Makefile->GetHomeDirectory(), diff --git a/Source/cmAddTestCommand.cxx b/Source/cmAddTestCommand.cxx index 00cda185f4..cf50401c0b 100644 --- a/Source/cmAddTestCommand.cxx +++ b/Source/cmAddTestCommand.cxx @@ -22,10 +22,9 @@ // cmExecutableCommand bool cmAddTestCommand::InitialPass(std::vector<std::string> const& args) { - // First argument is the name of the test - // Second argument is the name of the executable to run (a target or external - // program) - // Remaining arguments are the arguments to pass to the executable + // First argument is the name of the test Second argument is the name of + // the executable to run (a target or external program) Remaining arguments + // are the arguments to pass to the executable if(args.size() < 2 ) { this->SetError("called with incorrect number of arguments"); diff --git a/Source/cmAuxSourceDirectoryCommand.cxx b/Source/cmAuxSourceDirectoryCommand.cxx index 892ed4aaf7..37dee8c299 100644 --- a/Source/cmAuxSourceDirectoryCommand.cxx +++ b/Source/cmAuxSourceDirectoryCommand.cxx @@ -20,7 +20,8 @@ #include <cmsys/Directory.hxx> // cmAuxSourceDirectoryCommand -bool cmAuxSourceDirectoryCommand::InitialPass(std::vector<std::string> const& args) +bool cmAuxSourceDirectoryCommand::InitialPass +(std::vector<std::string> const& args) { if(args.size() < 2 || args.size() > 2) { @@ -68,7 +69,8 @@ bool cmAuxSourceDirectoryCommand::InitialPass(std::vector<std::string> const& ar // add the file as a class file so // depends can be done cmSourceFile cmfile; - cmfile.SetName(fullname.c_str(), this->Makefile->GetCurrentDirectory(), + cmfile.SetName(fullname.c_str(), + this->Makefile->GetCurrentDirectory(), this->Makefile->GetSourceExtensions(), this->Makefile->GetHeaderExtensions()); cmfile.SetProperty("ABSTRACT","0"); diff --git a/Source/cmAuxSourceDirectoryCommand.h b/Source/cmAuxSourceDirectoryCommand.h index b6cad1dcdb..09fc5f8e26 100644 --- a/Source/cmAuxSourceDirectoryCommand.h +++ b/Source/cmAuxSourceDirectoryCommand.h @@ -66,19 +66,20 @@ public: return " AUX_SOURCE_DIRECTORY(dir VARIABLE)\n" "Collects the names of all the source files in the specified " - "directory and stores the list in the variable provided. This command " - "is intended to be used by projects that use explicit template " - "instantiation. Template instantiation files can be stored in a " - "\"Templates\" subdirectory and collected automatically using this " - "command to avoid manually listing all instantiations.\n" - "It is tempting to use this command to avoid writing the list of source " - "files for a library or executable target. While this seems to work, " - "there is no way for CMake to generate a build system that knows when a " - "new source file has been added. Normally the generated build system " - "knows when it needs to rerun CMake because the CMakeLists.txt file " - "is modified to add a new source. When the source is just added to " - "the directory without modifying this file, one would have to manually " - "rerun CMake to generate a build system incorporating the new file."; + "directory and stores the list in the variable provided. This " + "command is intended to be used by projects that use explicit " + "template instantiation. Template instantiation files can be " + "stored in a \"Templates\" subdirectory and collected automatically " + "using this command to avoid manually listing all instantiations.\n" + "It is tempting to use this command to avoid writing the list of " + "source files for a library or executable target. While this seems " + "to work, there is no way for CMake to generate a build system that " + "knows when a new source file has been added. Normally the " + "generated build system knows when it needs to rerun CMake because " + "the CMakeLists.txt file is modified to add a new source. When the " + "source is just added to the directory without modifying this file, " + "one would have to manually rerun CMake to generate a build system " + "incorporating the new file."; } cmTypeMacro(cmAuxSourceDirectoryCommand, cmCommand); diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index cfba26bbd8..e7fc7e0495 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -723,15 +723,16 @@ bool cmCTest::AddIfExists(SetOfStrings& files, const char* file) //---------------------------------------------------------------------- bool cmCTest::CTestFileExists(const std::string& filename) { - std::string testingDir = this->BinaryDir + "/Testing/" + this->CurrentTag + "/" + - filename; + std::string testingDir = this->BinaryDir + "/Testing/" + + this->CurrentTag + "/" + filename; return cmSystemTools::FileExists(testingDir.c_str()); } //---------------------------------------------------------------------- cmCTestGenericHandler* cmCTest::GetInitializedHandler(const char* handler) { - cmCTest::t_TestingHandlers::iterator it = this->TestingHandlers.find(handler); + cmCTest::t_TestingHandlers::iterator it = + this->TestingHandlers.find(handler); if ( it == this->TestingHandlers.end() ) { return 0; @@ -743,7 +744,8 @@ cmCTestGenericHandler* cmCTest::GetInitializedHandler(const char* handler) //---------------------------------------------------------------------- cmCTestGenericHandler* cmCTest::GetHandler(const char* handler) { - cmCTest::t_TestingHandlers::iterator it = this->TestingHandlers.find(handler); + cmCTest::t_TestingHandlers::iterator it = + this->TestingHandlers.find(handler); if ( it == this->TestingHandlers.end() ) { return 0; @@ -1369,7 +1371,8 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output) this->ShowOnly = true; } - if(this->CheckArgument(arg, "-SP", "--script-new-process") && i < args.size() - 1 ) + if(this->CheckArgument(arg, "-SP", "--script-new-process") && + i < args.size() - 1 ) { this->RunConfigurationScript = true; i++; @@ -1382,7 +1385,8 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output) } } - if(this->CheckArgument(arg, "-SR", "--script-run") && i < args.size() - 1 ) + if(this->CheckArgument(arg, "-SR", "--script-run") && + i < args.size() - 1 ) { SRArgumentSpecified = true; this->RunConfigurationScript = true; @@ -1701,8 +1705,8 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output) i++; this->GetHandler("test")->SetPersistentOption("TestsToRunInformation", args[i].c_str()); - this->GetHandler("memcheck")->SetPersistentOption("TestsToRunInformation", - args[i].c_str()); + this->GetHandler("memcheck")-> + SetPersistentOption("TestsToRunInformation",args[i].c_str()); } if(this->CheckArgument(arg, "-U", "--union")) { @@ -1712,20 +1716,20 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output) if(this->CheckArgument(arg, "-R", "--tests-regex") && i < args.size() - 1) { i++; - this->GetHandler("test")->SetPersistentOption("IncludeRegularExpression", - args[i].c_str()); - this->GetHandler("memcheck")->SetPersistentOption("IncludeRegularExpression", - args[i].c_str()); + this->GetHandler("test")-> + SetPersistentOption("IncludeRegularExpression", args[i].c_str()); + this->GetHandler("memcheck")-> + SetPersistentOption("IncludeRegularExpression", args[i].c_str()); } if(this->CheckArgument(arg, "-E", "--exclude-regex") && i < args.size() - 1) { i++; - this->GetHandler("test")->SetPersistentOption("ExcludeRegularExpression", - args[i].c_str()); - this->GetHandler("memcheck")->SetPersistentOption("ExcludeRegularExpression", - args[i].c_str()); + this->GetHandler("test")-> + SetPersistentOption("ExcludeRegularExpression", args[i].c_str()); + this->GetHandler("memcheck")-> + SetPersistentOption("ExcludeRegularExpression", args[i].c_str()); } if(this->CheckArgument(arg, "--overwrite") && i < args.size() - 1) diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index fb6385e4a9..a0a231f1b5 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -423,8 +423,8 @@ bool cmCacheManager::SaveCache(const char* path) fout << "########################\n"; fout << "\n"; - for( std::map<cmStdString, CacheEntry>::const_iterator i = this->Cache.begin(); - i != this->Cache.end(); ++i) + for( std::map<cmStdString, CacheEntry>::const_iterator i = + this->Cache.begin(); i != this->Cache.end(); ++i) { const CacheEntry& ce = (*i).second; CacheEntryType t = ce.Type; @@ -724,8 +724,8 @@ void cmCacheManager::PrintCache(std::ostream& out) const { out << "=================================================" << std::endl; out << "CMakeCache Contents:" << std::endl; - for(std::map<cmStdString, CacheEntry>::const_iterator i = this->Cache.begin(); - i != this->Cache.end(); ++i) + for(std::map<cmStdString, CacheEntry>::const_iterator i = + this->Cache.begin(); i != this->Cache.end(); ++i) { if((*i).second.Type != INTERNAL) { diff --git a/Source/cmCommandArgumentLexer.cxx b/Source/cmCommandArgumentLexer.cxx index 47cb6d80b6..2b1c9dd0ea 100644 --- a/Source/cmCommandArgumentLexer.cxx +++ b/Source/cmCommandArgumentLexer.cxx @@ -165,7 +165,8 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; #define YY_LESS_LINENO(n) -/* Return all but the first "n" matched characters back to the input stream. */ +/* Return all but the first "n" matched characters back to the input + stream. */ #define yyless(n) \ do \ { \ @@ -245,9 +246,9 @@ struct yy_buffer_state * still have a bunch of tokens to match, though, because of * possible backing-up. * - * When we actually see the EOF, we change the status to "new" - * (via cmCommandArgument_yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. + * When we actually see the EOF, we change the status to "new" (via + * cmCommandArgument_yyrestart()), so that the user can continue scanning + * by just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 @@ -264,22 +265,29 @@ struct yy_buffer_state ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ : NULL) -/* Same as previous macro, but useful when we know that the buffer stack is not - * NULL or when we need an lvalue. For internal use only. +/* Same as previous macro, but useful when we know that the buffer stack is + * not NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] void cmCommandArgument_yyrestart (FILE *input_file ,yyscan_t yyscanner ); -void cmCommandArgument_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -YY_BUFFER_STATE cmCommandArgument_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner ); -void cmCommandArgument_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void cmCommandArgument_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void cmCommandArgument_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); +void cmCommandArgument_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , + yyscan_t yyscanner ); +YY_BUFFER_STATE cmCommandArgument_yy_create_buffer (FILE *file,int size , + yyscan_t yyscanner ); +void cmCommandArgument_yy_delete_buffer (YY_BUFFER_STATE b , + yyscan_t yyscanner ); +void cmCommandArgument_yy_flush_buffer (YY_BUFFER_STATE b , + yyscan_t yyscanner ); +void cmCommandArgument_yypush_buffer_state (YY_BUFFER_STATE new_buffer , + yyscan_t yyscanner ); void cmCommandArgument_yypop_buffer_state (yyscan_t yyscanner ); static void cmCommandArgument_yyensure_buffer_stack (yyscan_t yyscanner ); static void cmCommandArgument_yy_load_buffer_state (yyscan_t yyscanner ); -static void cmCommandArgument_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); +static void cmCommandArgument_yy_init_buffer (YY_BUFFER_STATE b, + FILE *file , + yyscan_t yyscanner ); #define YY_FLUSH_BUFFER cmCommandArgument_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner) @@ -630,8 +638,8 @@ static int input (yyscan_t yyscanner ); #define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) #endif -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". +/* Gets input and stuffs it into "buf". number of characters read, or + * YY_NULL, is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ @@ -1171,7 +1179,8 @@ static int yy_get_next_buffer (yyscan_t yyscanner) return ret_val; } -/* yy_get_previous_state - get the state just before the EOB char was reached */ +/* yy_get_previous_state - get the state just before the EOB char was + reached */ static yy_state_type yy_get_previous_state (yyscan_t yyscanner) { @@ -1352,10 +1361,10 @@ static int yy_get_next_buffer (yyscan_t yyscanner) YY_CURRENT_BUFFER_LVALUE = new_buffer; cmCommandArgument_yy_load_buffer_state(yyscanner ); - /* We don't actually know whether we did this switch during - * EOF (cmCommandArgument_yywrap()) processing, but the only time this flag - * is looked at is after cmCommandArgument_yywrap() is called, so it's safe - * to go ahead and always set it. + /* We don't actually know whether we did this switch during EOF + * (cmCommandArgument_yywrap()) processing, but the only time this flag is + * looked at is after cmCommandArgument_yywrap() is called, so it's safe to + * go ahead and always set it. */ yyg->yy_did_buffer_switch_on_eof = 1; } @@ -1369,11 +1378,10 @@ static void cmCommandArgument_yy_load_buffer_state (yyscan_t yyscanner) yyg->yy_hold_char = *yyg->yy_c_buf_p; } -/** Allocate and initialize an input buffer state. - * @param file A readable stream. - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * @param yyscanner The scanner object. - * @return the allocated buffer state. +/** Allocate and initialize an input buffer state. @param file A readable + * stream. @param size The character buffer size in bytes. When in doubt, + * use @c YY_BUF_SIZE. @param yyscanner The scanner object. @return the + * allocated buffer state. */ YY_BUFFER_STATE cmCommandArgument_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) { @@ -1438,9 +1446,10 @@ extern int isatty (int ); b->yy_input_file = file; b->yy_fill_buffer = 1; - /* If b is the current buffer, then cmCommandArgument_yy_init_buffer was _probably_ - * called from cmCommandArgument_yyrestart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. + /* If b is the current buffer, then cmCommandArgument_yy_init_buffer was + * _probably_ called from cmCommandArgument_yyrestart() or through + * yy_get_next_buffer. In that case, we don't want to reset the lineno + * or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; @@ -1452,9 +1461,9 @@ extern int isatty (int ); errno = oerrno; } -/** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * @param yyscanner The scanner object. +/** Discard all buffered characters. On the next scan, YY_INPUT will be + * called. @param b the buffer state to be flushed, usually @c + * YY_CURRENT_BUFFER. @param yyscanner The scanner object. */ void cmCommandArgument_yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) { @@ -1577,10 +1586,9 @@ static void cmCommandArgument_yyensure_buffer_stack (yyscan_t yyscanner) } } -/** Setup the input buffer state to scan directly from a user-specified character buffer. - * @param base the character buffer - * @param size the size in bytes of the character buffer - * @param yyscanner The scanner object. +/** Setup the input buffer state to scan directly from a user-specified + * character buffer. @param base the character buffer @param size the size + * in bytes of the character buffer @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ YY_BUFFER_STATE cmCommandArgument_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) @@ -1612,12 +1620,11 @@ YY_BUFFER_STATE cmCommandArgument_yy_scan_buffer (char * base, yy_size_t size return b; } -/** Setup the input buffer state to scan a string. The next call to cmCommandArgument_yylex() will - * scan from a @e copy of @a str. - * @param str a NUL-terminated string to scan - * @param yyscanner The scanner object. - * @return the newly allocated buffer state object. - * @note If you want to scan bytes that may contain NUL values, then use +/** Setup the input buffer state to scan a string. The next call to + * cmCommandArgument_yylex() will scan from a @e copy of @a str. @param str + * a NUL-terminated string to scan @param yyscanner The scanner object. + * @return the newly allocated buffer state object. @note If you want to + * scan bytes that may contain NUL values, then use * cmCommandArgument_yy_scan_bytes() instead. */ YY_BUFFER_STATE cmCommandArgument_yy_scan_string (yyconst char * yy_str , yyscan_t yyscanner) @@ -1626,12 +1633,11 @@ YY_BUFFER_STATE cmCommandArgument_yy_scan_string (yyconst char * yy_str , yyscan return cmCommandArgument_yy_scan_bytes(yy_str,strlen(yy_str) ,yyscanner); } -/** Setup the input buffer state to scan the given bytes. The next call to cmCommandArgument_yylex() will - * scan from a @e copy of @a bytes. - * @param bytes the byte buffer to scan - * @param len the number of bytes in the buffer pointed to by @a bytes. - * @param yyscanner The scanner object. - * @return the newly allocated buffer state object. +/** Setup the input buffer state to scan the given bytes. The next call to + * cmCommandArgument_yylex() will scan from a @e copy of @a bytes. @param + * bytes the byte buffer to scan @param len the number of bytes in the buffer + * pointed to by @a bytes. @param yyscanner The scanner object. @return the + * newly allocated buffer state object. */ YY_BUFFER_STATE cmCommandArgument_yy_scan_bytes (yyconst char * bytes, int len , yyscan_t yyscanner) { @@ -1799,7 +1805,12 @@ void cmCommandArgument_yyset_column (int column_no , yyscan_t yyscanner) /* column is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "cmCommandArgument_yyset_column called with no buffer" , yyscanner); + { + yy_fatal_error + ("cmCommandArgument_yyset_column called with no buffer" , + yyscanner); + } + yycolumn = column_no; } @@ -1869,9 +1880,10 @@ static int yy_init_globals (yyscan_t yyscanner) /* User-visible API */ -/* cmCommandArgument_yylex_init is special because it creates the scanner itself, so it is - * the ONLY reentrant function that doesn't take the scanner as the last argument. - * That's why we explicitly handle the declaration, instead of using our macros. +/* cmCommandArgument_yylex_init is special because it creates the scanner + * itself, so it is the ONLY reentrant function that doesn't take the scanner + * as the last argument. That's why we explicitly handle the declaration, + * instead of using our macros. */ int cmCommandArgument_yylex_init(yyscan_t* ptr_yy_globals) @@ -1894,7 +1906,8 @@ int cmCommandArgument_yylex_init(yyscan_t* ptr_yy_globals) return yy_init_globals ( *ptr_yy_globals ); } -/* cmCommandArgument_yylex_destroy is for both reentrant and non-reentrant scanners. */ +/* cmCommandArgument_yylex_destroy is for both reentrant and non-reentrant + scanners. */ int cmCommandArgument_yylex_destroy (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; @@ -1924,7 +1937,8 @@ int cmCommandArgument_yylex_destroy (yyscan_t yyscanner) */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner) +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , + yyscan_t yyscanner) { register int i; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; @@ -1964,7 +1978,8 @@ void *cmCommandArgument_yyrealloc (void * ptr, yy_size_t size , yyscan_t) void cmCommandArgument_yyfree (void * ptr , yyscan_t) { - free( (char *) ptr ); /* see cmCommandArgument_yyrealloc() for (char *) cast */ + free( (char *) ptr ); + /* see cmCommandArgument_yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" diff --git a/Source/cmCommandArgumentParser.cxx b/Source/cmCommandArgumentParser.cxx index 8fa88d1eee..1f219dd9c0 100644 --- a/Source/cmCommandArgumentParser.cxx +++ b/Source/cmCommandArgumentParser.cxx @@ -1,7 +1,8 @@ /* A Bison parser, made by GNU Bison 2.1. */ -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +/* Skeleton parser for Yacc-like parsing with Bison, Copyright (C) 1984, + 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, + Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -118,7 +119,9 @@ This file must be translated to C and modified to build everywhere. Run bison like this: - bison --yacc --name-prefix=cmCommandArgument_yy --defines=cmCommandArgumentParserTokens.h -ocmCommandArgumentParser.cxx cmCommandArgumentParser.y + bison --yacc --name-prefix=cmCommandArgument_yy + --defines=cmCommandArgumentParserTokens.h -ocmCommandArgumentParser.cxx + cmCommandArgumentParser.y Modify cmCommandArgumentParser.cxx: - remove TABs @@ -162,7 +165,8 @@ static void cmCommandArgumentError(yyscan_t yyscanner, const char* message); #endif #ifdef _MSC_VER # pragma warning (disable: 4102) /* Unused goto label. */ -# pragma warning (disable: 4065) /* Switch statement contains default but no case. */ +# pragma warning (disable: 4065) /* Switch statement contains default but no + case. */ #endif @@ -1287,8 +1291,10 @@ yyreduce: case 15: #line 166 "cmCommandArgumentParser.y" { - (yyval.str) = yyGetParser->ExpandSpecialVariable((yyvsp[-2].str),(yyvsp[-1].str)); - //std::cerr << __LINE__ << " here: [" << $<str>1 << "] [" << $<str>2 << "] [" << $<str>3 << "]" << std::endl; + (yyval.str) = + yyGetParser->ExpandSpecialVariable((yyvsp[-2].str),(yyvsp[-1].str)); + //std::cerr << __LINE__ << " here: [" << $<str>1 << "] [" << $<str>2 << "] + //[" << $<str>3 << "]" << std::endl; } break; @@ -1296,7 +1302,8 @@ yyreduce: #line 172 "cmCommandArgumentParser.y" { (yyval.str) = yyGetParser->ExpandVariable((yyvsp[-1].str)); - //std::cerr << __LINE__ << " here: [" << $<str>1 << "] [" << $<str>2 << "] [" << $<str>3 << "]" << std::endl; + //std::cerr << __LINE__ << " here: [" << $<str>1 << "] [" << $<str>2 << "] + //[" << $<str>3 << "]" << std::endl; } break; diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx index 570cc2d6ed..51a4d3ad6c 100644 --- a/Source/cmCommandArgumentParserHelper.cxx +++ b/Source/cmCommandArgumentParserHelper.cxx @@ -63,7 +63,8 @@ char* cmCommandArgumentParserHelper::AddString(const char* str) return stVal; } -char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key, const char* var) +char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key, + const char* var) { if ( !key ) { @@ -85,7 +86,8 @@ char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key, cons } return this->EmptyVariable; } - cmSystemTools::Error("Key ", key, " is not used yet. For now only $ENV{..} is allowed"); + cmSystemTools::Error("Key ", key, + " is not used yet. For now only $ENV{..} is allowed"); return 0; } @@ -131,8 +133,8 @@ char* cmCommandArgumentParserHelper::CombineUnions(char* in1, char* in2) return out; } -void cmCommandArgumentParserHelper::AllocateParserType(cmCommandArgumentParserHelper::ParserType* pt, - const char* str, int len) +void cmCommandArgumentParserHelper::AllocateParserType +(cmCommandArgumentParserHelper::ParserType* pt,const char* str, int len) { pt->str = 0; if ( len == 0 ) @@ -147,10 +149,10 @@ void cmCommandArgumentParserHelper::AllocateParserType(cmCommandArgumentParserHe strncpy(pt->str, str, len); pt->str[len] = 0; this->Variables.push_back(pt->str); - // std::cout << (void*) pt->str << " " << pt->str << " JPAllocateParserType" << std::endl; } -bool cmCommandArgumentParserHelper::HandleEscapeSymbol(cmCommandArgumentParserHelper::ParserType* pt, char symbol) +bool cmCommandArgumentParserHelper::HandleEscapeSymbol +(cmCommandArgumentParserHelper::ParserType* pt, char symbol) { if ( this->NoEscapeMode ) { @@ -204,8 +206,6 @@ int cmCommandArgumentParserHelper::ParseString(const char* str, int verb) { return 0; } - //printf("Do some parsing: %s\n", str); - this->Verbose = verb; this->InputBuffer = str; this->InputBufferPos = 0; @@ -220,8 +220,6 @@ int cmCommandArgumentParserHelper::ParseString(const char* str, int verb) cmCommandArgument_yylex_destroy(yyscanner); if ( res != 0 ) { - //str << "CAL_Parser returned: " << res << std::endl; - //std::cerr << "When parsing: [" << str << "]" << std::endl; return 0; } @@ -229,7 +227,8 @@ int cmCommandArgumentParserHelper::ParseString(const char* str, int verb) if ( Verbose ) { - std::cerr << "Expanding [" << str << "] produced: [" << this->Result.c_str() << "]" << std::endl; + std::cerr << "Expanding [" << str << "] produced: [" + << this->Result.c_str() << "]" << std::endl; } return 1; } @@ -248,9 +247,6 @@ void cmCommandArgumentParserHelper::CleanupParser() int cmCommandArgumentParserHelper::LexInput(char* buf, int maxlen) { - //std::cout << "JPLexInput "; - //std::cout.write(buf, maxlen); - //std::cout << std::endl; if ( maxlen < 1 ) { return 0; @@ -274,19 +270,8 @@ int cmCommandArgumentParserHelper::LexInput(char* buf, int maxlen) void cmCommandArgumentParserHelper::Error(const char* str) { unsigned long pos = static_cast<unsigned long>(this->InputBufferPos); - //fprintf(stderr, "Argument Parser Error: %s (%lu / Line: %d)\n", str, pos, this->CurrentLine); cmOStringStream ostr; ostr << str << " (" << pos << ")"; - /* - int cc; - std::cerr << "String: ["; - for ( cc = 0; cc < 30 && *(this->InputBuffer.c_str() + this->InputBufferPos + cc); - cc ++ ) - { - std::cerr << *(this->InputBuffer.c_str() + this->InputBufferPos + cc); - } - std::cerr << "]" << std::endl; - */ this->ErrorString = ostr.str(); } diff --git a/Source/cmCommandArgumentParserTokens.h b/Source/cmCommandArgumentParserTokens.h index 377b6a2eaf..c14b7669c1 100644 --- a/Source/cmCommandArgumentParserTokens.h +++ b/Source/cmCommandArgumentParserTokens.h @@ -1,7 +1,8 @@ /* A Bison parser, made by GNU Bison 2.1. */ -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +/* Skeleton parser for Yacc-like parsing with Bison, Copyright (C) 1984, + 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, + Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/Source/cmConfigureFileCommand.cxx b/Source/cmConfigureFileCommand.cxx index b382f86650..ccfe3d4b49 100644 --- a/Source/cmConfigureFileCommand.cxx +++ b/Source/cmConfigureFileCommand.cxx @@ -30,7 +30,8 @@ bool cmConfigureFileCommand::InitialPass(std::vector<std::string> const& args) this->OuputFile = args[1]; if ( !this->Makefile->CanIWriteThisFile(this->OuputFile.c_str()) ) { - std::string e = "attempted to configure a file: " + this->OuputFile + " into a source directory."; + std::string e = "attempted to configure a file: " + this->OuputFile + + " into a source directory."; this->SetError(e.c_str()); cmSystemTools::SetFatalErrorOccured(); return false; diff --git a/Source/cmCreateTestSourceList.h b/Source/cmCreateTestSourceList.h index efee5f3a53..b484c087d6 100644 --- a/Source/cmCreateTestSourceList.h +++ b/Source/cmCreateTestSourceList.h @@ -72,13 +72,13 @@ public: "DriverName is the name of the test driver program. The rest of " "the arguments consist of a list of test source files, can be " "semicolon separated. Each test source file should have a function in " - "it that is the same name as the file with no extension (foo.cxx should " - "have int foo();) DriverName will be able to call each of the tests by " - "name on the command line. If EXTRA_INCLUDE is specified, then the " - "next argument is included into the generated file. If FUNCTION is " - "specified, then the next argument is taken as a function name that " - "is passed a pointer to ac and av. This can be used to add extra " - "command line processing to each test. The cmake variable " + "it that is the same name as the file with no extension (foo.cxx " + "should have int foo();) DriverName will be able to call each of the " + "tests by name on the command line. If EXTRA_INCLUDE is specified, " + "then the next argument is included into the generated file. If " + "FUNCTION is specified, then the next argument is taken as a function " + "name that is passed a pointer to ac and av. This can be used to add " + "extra command line processing to each test. The cmake variable " "CMAKE_TESTDRIVER_BEFORE_TESTMAIN can be set to have code that will be " "placed directly before calling the test main function. " "CMAKE_TESTDRIVER_AFTER_TESTMAIN can be set to have code that will be " diff --git a/Source/cmDepends.cxx b/Source/cmDepends.cxx index 7ea0e7ebd4..f6d577c77a 100644 --- a/Source/cmDepends.cxx +++ b/Source/cmDepends.cxx @@ -105,7 +105,8 @@ bool cmDepends::CheckDependencies(std::istream& internalDepends) bool okay = true; while(internalDepends.getline(this->Dependee, this->MaxPath)) { - if ( this->Dependee[0] == 0 || this->Dependee[0] == '#' || this->Dependee[0] == '\r' ) + if ( this->Dependee[0] == 0 || this->Dependee[0] == '#' || + this->Dependee[0] == '\r' ) { continue; } diff --git a/Source/cmDepends.h b/Source/cmDepends.h index e4278a6554..d6269af2e0 100644 --- a/Source/cmDepends.h +++ b/Source/cmDepends.h @@ -41,7 +41,8 @@ public: /** Set the full path to the top of the build tree. This is the base path from which dependencies are referenced as relative paths. */ - void SetHomeOutputDirectory(const char *dir) {this->HomeOutputDirectory = dir;}; + void SetHomeOutputDirectory(const char *dir) { + this->HomeOutputDirectory = dir;}; /** should this be verbose in its output */ void SetVerbose(bool verb) { this->Verbose = verb; } diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx index 13ebdcdaab..ad1d021529 100644 --- a/Source/cmDependsC.cxx +++ b/Source/cmDependsC.cxx @@ -112,8 +112,8 @@ bool cmDependsC::WriteDependencies(const char *src, const char *obj, } else { - for(std::vector<std::string>::const_iterator i = this->IncludePath->begin(); - i != this->IncludePath->end(); ++i) + for(std::vector<std::string>::const_iterator i = + this->IncludePath->begin(); i != this->IncludePath->end(); ++i) { // Construct the name of the file as if it were in the current // include directory. Avoid using a leading "./". @@ -370,7 +370,8 @@ bool cmDependsC::FileExistsOrIsGenerated(const std::string& fname, // Note that CMAKE_GENERATED_FILES is written with a conversion // relative to the home output directory. std::string rname = - cmSystemTools::RelativePath(this->HomeOutputDirectory.c_str(), fname.c_str()); + cmSystemTools::RelativePath(this->HomeOutputDirectory.c_str(), + fname.c_str()); if(this->FileIsGenerated(rname, scanned, dependencies)) { return true; @@ -387,8 +388,8 @@ bool cmDependsC::FileIsGenerated(const std::string& fname, std::set<cmStdString>& dependencies) { if(this->GeneratedFiles && - std::set<cmStdString>::const_iterator(this->GeneratedFiles->find(fname)) != - this->GeneratedFiles->end()) + std::set<cmStdString>::const_iterator(this->GeneratedFiles->find(fname)) + != this->GeneratedFiles->end()) { // If the file does not really exist yet pretend it has already // been scanned. When it exists later then dependencies will be diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index 22cff0eebf..e1ed81c5dd 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -311,8 +311,8 @@ bool cmDependsFortran::FindIncludeFile(const char* dir, } // Search the include path for the file. - for(std::vector<std::string>::const_iterator i = this->IncludePath->begin(); - i != this->IncludePath->end(); ++i) + for(std::vector<std::string>::const_iterator i = + this->IncludePath->begin(); i != this->IncludePath->end(); ++i) { fullName = *i; fullName += "/"; diff --git a/Source/cmDependsFortranParser.cxx b/Source/cmDependsFortranParser.cxx index 42c9953dc6..2f64764814 100644 --- a/Source/cmDependsFortranParser.cxx +++ b/Source/cmDependsFortranParser.cxx @@ -1,7 +1,7 @@ /* A Bison parser, made by GNU Bison 1.875d. */ -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +/* Skeleton parser for Yacc-like parsing with Bison, Copyright (C) 1984, + 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -157,7 +157,9 @@ This file must be translated to C and modified to build everywhere. Run bison like this: - bison --yacc --name-prefix=cmDependsFortran_yy --defines=cmDependsFortranParserTokens.h -ocmDependsFortranParser.cxx cmDependsFortranParser.y + bison --yacc --name-prefix=cmDependsFortran_yy + --defines=cmDependsFortranParserTokens.h -ocmDependsFortranParser.cxx + cmDependsFortranParser.y Modify cmDependsFortranParser.cxx: - remove TABs @@ -1387,7 +1389,8 @@ yyerrlab: YYPOPSTACK; if (yyssp == yyss) YYABORT; - YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); + YYDSYMPRINTF ("Error: popping", yystos[*yyssp], + yyvsp, yylsp); yydestruct (yystos[*yyssp], yyvsp); } } diff --git a/Source/cmDependsJavaParserHelper.cxx b/Source/cmDependsJavaParserHelper.cxx index b9d0775d01..da3cd0b5cc 100644 --- a/Source/cmDependsJavaParserHelper.cxx +++ b/Source/cmDependsJavaParserHelper.cxx @@ -39,7 +39,9 @@ cmDependsJavaParserHelper::~cmDependsJavaParserHelper() this->CleanupParser(); } -void cmDependsJavaParserHelper::CurrentClass::AddFileNamesForPrinting(std::vector<cmStdString> *files, const char* prefix, const char* sep) +void cmDependsJavaParserHelper::CurrentClass +::AddFileNamesForPrinting(std::vector<cmStdString> *files, + const char* prefix, const char* sep) { cmStdString rname = ""; if ( prefix ) @@ -66,11 +68,8 @@ void cmDependsJavaParserHelper::DeallocateParserType(char** pt) } if (!*pt) { - //*pt = 0; return; } - // std::cout << (void*) *pt << " " << *pt << " this->DeallocateParserType" << std::endl; - //delete [] *pt; *pt = 0; this->UnionsAvailable --; } @@ -109,11 +108,11 @@ void cmDependsJavaParserHelper::AddPackagesImport(const char* sclass) this->PackagesImport.push_back(sclass); } -void cmDependsJavaParserHelper::SafePrintMissing(const char* str, int line, int cnt) +void cmDependsJavaParserHelper::SafePrintMissing(const char* str, + int line, int cnt) { if ( str ) { - //std::cout << (void*) str << " JPSafePrintMissing" << std::endl; std::cout << line << " String " << cnt << " exists: "; unsigned int cc; for ( cc = 0; cc < strlen(str); cc ++ ) @@ -140,7 +139,8 @@ void cmDependsJavaParserHelper::Print(const char* place, const char* str) } } -void cmDependsJavaParserHelper::CombineUnions(char** out, const char* in1, char** in2, +void cmDependsJavaParserHelper::CombineUnions(char** out, + const char* in1, char** in2, const char* sep) { size_t len = 1; @@ -174,11 +174,11 @@ void cmDependsJavaParserHelper::CombineUnions(char** out, const char* in1, char* { this->DeallocateParserType(in2); } - // std::cout << (void*) *out << " " << *out << " JPAllocateParserType" << std::endl; this->UnionsAvailable ++; } -void cmDependsJavaParserHelper::CheckEmpty(int line, int cnt, cmDependsJavaParserHelper::ParserType* pt) +void cmDependsJavaParserHelper +::CheckEmpty(int line, int cnt, cmDependsJavaParserHelper::ParserType* pt) { int cc; int kk = -cnt + 1; @@ -190,13 +190,15 @@ void cmDependsJavaParserHelper::CheckEmpty(int line, int cnt, cmDependsJavaParse } } -void cmDependsJavaParserHelper::PrepareElement(cmDependsJavaParserHelper::ParserType* me) +void cmDependsJavaParserHelper +::PrepareElement(cmDependsJavaParserHelper::ParserType* me) { // Inititalize self me->str = 0; } -void cmDependsJavaParserHelper::AllocateParserType(cmDependsJavaParserHelper::ParserType* pt, +void cmDependsJavaParserHelper +::AllocateParserType(cmDependsJavaParserHelper::ParserType* pt, const char* str, int len) { pt->str = 0; @@ -213,7 +215,6 @@ void cmDependsJavaParserHelper::AllocateParserType(cmDependsJavaParserHelper::Pa strncpy(pt->str, str, len); pt->str[len] = 0; this->Allocates.push_back(pt->str); - // std::cout << (void*) pt->str << " " << pt->str << " JPAllocateParserType" << std::endl; } void cmDependsJavaParserHelper::StartClass(const char* cls) @@ -289,8 +290,6 @@ int cmDependsJavaParserHelper::ParseString(const char* str, int verb) { return 0; } - //printf("Do some parsing: %s\n", str); - this->Verbose = verb; this->InputBuffer = str; this->InputBufferPos = 0; @@ -312,7 +311,8 @@ int cmDependsJavaParserHelper::ParseString(const char* str, int verb) { if ( this->CurrentPackage.size() > 0 ) { - std::cout << "Current package is: " << this->CurrentPackage.c_str() << std::endl; + std::cout << "Current package is: " << + this->CurrentPackage.c_str() << std::endl; } std::cout << "Imports packages:"; if ( this->PackagesImport.size() > 0 ) @@ -342,8 +342,8 @@ int cmDependsJavaParserHelper::ParseString(const char* str, int verb) this->PrintClasses(); if ( this->UnionsAvailable != 0 ) { - std::cout << "There are still " << this->UnionsAvailable << " unions available" << std::endl; - //return 0; + std::cout << "There are still " << + this->UnionsAvailable << " unions available" << std::endl; } } this->CleanupParser(); @@ -365,9 +365,6 @@ void cmDependsJavaParserHelper::CleanupParser() int cmDependsJavaParserHelper::LexInput(char* buf, int maxlen) { - //std::cout << "JPLexInput "; - //std::cout.write(buf, maxlen); - //std::cout << std::endl; if ( maxlen < 1 ) { return 0; @@ -390,10 +387,12 @@ int cmDependsJavaParserHelper::LexInput(char* buf, int maxlen) void cmDependsJavaParserHelper::Error(const char* str) { unsigned long pos = static_cast<unsigned long>(this->InputBufferPos); - fprintf(stderr, "JPError: %s (%lu / Line: %d)\n", str, pos, this->CurrentLine); + fprintf(stderr, "JPError: %s (%lu / Line: %d)\n", + str, pos, this->CurrentLine); int cc; std::cerr << "String: ["; - for ( cc = 0; cc < 30 && *(this->InputBuffer.c_str() + this->InputBufferPos + cc); + for ( cc = 0; + cc < 30 && *(this->InputBuffer.c_str() + this->InputBufferPos + cc); cc ++ ) { std::cerr << *(this->InputBuffer.c_str() + this->InputBufferPos + cc); @@ -401,7 +400,8 @@ void cmDependsJavaParserHelper::Error(const char* str) std::cerr << "]" << std::endl; } -void cmDependsJavaParserHelper::UpdateCombine(const char* str1, const char* str2) +void cmDependsJavaParserHelper::UpdateCombine(const char* str1, + const char* str2) { if ( this->CurrentCombine == "" && str1 != 0) { diff --git a/Source/cmDependsJavaParserHelper.h b/Source/cmDependsJavaParserHelper.h index cf5d29a9ff..171518e01d 100644 --- a/Source/cmDependsJavaParserHelper.h +++ b/Source/cmDependsJavaParserHelper.h @@ -99,7 +99,8 @@ private: void PrintClasses(); void Print(const char* place, const char* str); - void CombineUnions(char** out, const char* in1, char** in2, const char* sep); + void CombineUnions(char** out, const char* in1, char** in2, + const char* sep); void SafePrintMissing(const char* str, int line, int cnt); void CleanupParser(); diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx index 359833c582..2b148eaf2e 100644 --- a/Source/cmDocumentation.cxx +++ b/Source/cmDocumentation.cxx @@ -170,7 +170,8 @@ bool cmDocumentation::PrintCopyright(std::ostream& os) //---------------------------------------------------------------------------- bool cmDocumentation::PrintVersion(std::ostream& os) { - os << this->GetNameString() << " version " << cmVersion::GetCMakeVersion() << "\n"; + os << this->GetNameString() << " version " + << cmVersion::GetCMakeVersion() << "\n"; return true; } @@ -200,8 +201,10 @@ bool cmDocumentation::PrintDocumentation(Type ht, std::ostream& os) switch (ht) { case cmDocumentation::Usage: return this->PrintDocumentationUsage(os); - case cmDocumentation::Single: return this->PrintDocumentationSingle(os); - case cmDocumentation::SingleModule: return this->PrintDocumentationSingleModule(os); + case cmDocumentation::Single: + return this->PrintDocumentationSingle(os); + case cmDocumentation::SingleModule: + return this->PrintDocumentationSingleModule(os); case cmDocumentation::List: return this->PrintDocumentationList(os); case cmDocumentation::ModuleList: return this->PrintModuleList(os); case cmDocumentation::Full: return this->PrintDocumentationFull(os); @@ -242,7 +245,8 @@ bool cmDocumentation::CreateModulesSection() } //---------------------------------------------------------------------------- -bool cmDocumentation::CreateSingleModule(const char* fname, const char* moduleName) +bool cmDocumentation::CreateSingleModule(const char* fname, + const char* moduleName) { std::ifstream fin(fname); if(!fin) @@ -510,7 +514,8 @@ void cmDocumentation::SetUsageSection(const cmDocumentationEntry* section) } //---------------------------------------------------------------------------- -void cmDocumentation::SetDescriptionSection(const cmDocumentationEntry* section) +void cmDocumentation +::SetDescriptionSection(const cmDocumentationEntry* section) { this->SetSection(0, section, 0, this->DescriptionSection); } @@ -530,7 +535,8 @@ void cmDocumentation::SetCommandsSection(const cmDocumentationEntry* section) } //---------------------------------------------------------------------------- -void cmDocumentation::SetGeneratorsSection(const cmDocumentationEntry* section) +void cmDocumentation +::SetGeneratorsSection(const cmDocumentationEntry* section) { this->SetSection(cmDocumentationGeneratorsHeader, section, 0, this->GeneratorsSection); @@ -787,7 +793,8 @@ void cmDocumentation::PrintParagraph(std::ostream& os, const char* text) } //---------------------------------------------------------------------------- -void cmDocumentation::PrintPreformattedText(std::ostream& os, const char* text) +void cmDocumentation +::PrintPreformattedText(std::ostream& os, const char* text) { bool newline = true; for(const char* ptr = text; *ptr; ++ptr) @@ -815,7 +822,8 @@ void cmDocumentation::PrintParagraphText(std::ostream& os, const char* text) } //---------------------------------------------------------------------------- -void cmDocumentation::PrintPreformattedHTML(std::ostream& os, const char* text) +void cmDocumentation +::PrintPreformattedHTML(std::ostream& os, const char* text) { os << "<pre>"; this->PrintHTMLEscapes(os, text); @@ -1085,7 +1093,8 @@ bool cmDocumentation::PrintDocumentationMan(std::ostream& os) this->CreateManDocumentation(); os << ".TH " << this->GetNameString() << " 1 \"" << cmSystemTools::GetCurrentDateTime("%B %d, %Y").c_str() - << "\" \"" << this->GetNameString() << " " << cmVersion::GetCMakeVersion() + << "\" \"" << this->GetNameString() + << " " << cmVersion::GetCMakeVersion() << "\"\n"; this->Print(ManForm, os); return true; @@ -1251,7 +1260,6 @@ const char* cmDocumentation::GetNameString() //---------------------------------------------------------------------------- bool cmDocumentation::IsOption(const char* arg) { - return ((arg[0] == '-') || - (strcmp(arg, "/V") == 0) || + return ((arg[0] == '-') || (strcmp(arg, "/V") == 0) || (strcmp(arg, "/?") == 0)); } diff --git a/Source/cmDumpDocumentation.cxx b/Source/cmDumpDocumentation.cxx index 65447dd588..493d70f62e 100644 --- a/Source/cmDumpDocumentation.cxx +++ b/Source/cmDumpDocumentation.cxx @@ -51,7 +51,8 @@ static const cmDocumentationEntry cmDocumentationDescription[] = //---------------------------------------------------------------------------- static const cmDocumentationEntry cmDocumentationOptions[] = { - {"--all-for-coverage", "Dump all documentation to stdout. For testing.", 0}, + {"--all-for-coverage", + "Dump all documentation to stdout. For testing.", 0}, {0,0,0} }; diff --git a/Source/cmElseCommand.cxx b/Source/cmElseCommand.cxx index 96af1ca919..939f7d899c 100644 --- a/Source/cmElseCommand.cxx +++ b/Source/cmElseCommand.cxx @@ -18,6 +18,8 @@ bool cmElseCommand::InitialPass(std::vector<std::string> const&) { - this->SetError("An ELSE command was found outside of a proper IF ENDIF structure. Or its arguments did not match the opening IF command."); + this->SetError("An ELSE command was found outside of a proper " + "IF ENDIF structure. Or its arguments did not match " + "the opening IF command."); return false; } diff --git a/Source/cmEnableLanguageCommand.cxx b/Source/cmEnableLanguageCommand.cxx index 2aa586ea9d..c7788840e7 100644 --- a/Source/cmEnableLanguageCommand.cxx +++ b/Source/cmEnableLanguageCommand.cxx @@ -17,11 +17,13 @@ #include "cmEnableLanguageCommand.h" // cmEnableLanguageCommand -bool cmEnableLanguageCommand::InitialPass(std::vector<std::string> const& args) +bool cmEnableLanguageCommand +::InitialPass(std::vector<std::string> const& args) { if(args.size() < 1 ) { - this->SetError("ENABLE_LANGUAGE called with incorrect number of arguments"); + this->SetError + ("ENABLE_LANGUAGE called with incorrect number of arguments"); return false; } this->Makefile->EnableLanguage(args); diff --git a/Source/cmEndForEachCommand.cxx b/Source/cmEndForEachCommand.cxx index aa9a333f7d..717e44d257 100644 --- a/Source/cmEndForEachCommand.cxx +++ b/Source/cmEndForEachCommand.cxx @@ -16,9 +16,12 @@ =========================================================================*/ #include "cmEndForEachCommand.h" -bool cmEndForEachCommand::InvokeInitialPass(std::vector<cmListFileArgument> const&) +bool cmEndForEachCommand +::InvokeInitialPass(std::vector<cmListFileArgument> const&) { - this->SetError("An ENDFOREACH command was found outside of a proper FOREACH ENDFOREACH structure. Or its arguments did not match the opening FOREACH command."); + this->SetError("An ENDFOREACH command was found outside of a proper " + "FOREACH ENDFOREACH structure. Or its arguments did " + "not match the opening FOREACH command."); return false; } diff --git a/Source/cmEndIfCommand.cxx b/Source/cmEndIfCommand.cxx index a16403eafe..8fe3a1b528 100644 --- a/Source/cmEndIfCommand.cxx +++ b/Source/cmEndIfCommand.cxx @@ -25,7 +25,9 @@ bool cmEndIfCommand::InitialPass(std::vector<std::string> const&) return true; } - this->SetError("An ENDIF command was found outside of a proper IF ENDIF structure. Or its arguments did not match the opening IF command."); + this->SetError("An ENDIF command was found outside of a proper " + "IF ENDIF structure. Or its arguments did not match " + "the opening IF command."); return false; } diff --git a/Source/cmEndWhileCommand.cxx b/Source/cmEndWhileCommand.cxx index 6d62e78a44..4a49ddedbb 100644 --- a/Source/cmEndWhileCommand.cxx +++ b/Source/cmEndWhileCommand.cxx @@ -16,9 +16,12 @@ =========================================================================*/ #include "cmEndWhileCommand.h" -bool cmEndWhileCommand::InvokeInitialPass(std::vector<cmListFileArgument> const&) +bool cmEndWhileCommand +::InvokeInitialPass(std::vector<cmListFileArgument> const&) { - this->SetError("An ENDWHILE command was found outside of a proper WHILE ENDWHILE structure. Or its arguments did not match the opening WHILE command."); + this->SetError("An ENDWHILE command was found outside of a proper " + "WHILE ENDWHILE structure. Or its arguments did not " + "match the opening WHILE command."); return false; } diff --git a/Source/cmExecProgramCommand.cxx b/Source/cmExecProgramCommand.cxx index b201b72efe..3acf36a0ef 100644 --- a/Source/cmExecProgramCommand.cxx +++ b/Source/cmExecProgramCommand.cxx @@ -112,7 +112,8 @@ bool cmExecProgramCommand::InitialPass(std::vector<std::string> const& args) } else { - result = cmSystemTools::RunCommand(command.c_str(), output, retVal, 0, verbose); + result = cmSystemTools::RunCommand(command.c_str(), output, + retVal, 0, verbose); } if(!result) { diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx index fec9070237..835144fbd6 100644 --- a/Source/cmExecuteProcessCommand.cxx +++ b/Source/cmExecuteProcessCommand.cxx @@ -22,7 +22,8 @@ void cmExecuteProcessCommandFixText(std::vector<char>& output); // cmExecuteProcessCommand -bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args) +bool cmExecuteProcessCommand +::InitialPass(std::vector<std::string> const& args) { if(args.size() < 1 ) { @@ -241,11 +242,13 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args) } if(!output_file.empty()) { - cmsysProcess_SetPipeFile(cp, cmsysProcess_Pipe_STDOUT, output_file.c_str()); + cmsysProcess_SetPipeFile(cp, cmsysProcess_Pipe_STDOUT, + output_file.c_str()); } if(!error_file.empty()) { - cmsysProcess_SetPipeFile(cp, cmsysProcess_Pipe_STDERR, error_file.c_str()); + cmsysProcess_SetPipeFile(cp, cmsysProcess_Pipe_STDERR, + error_file.c_str()); } // Set the timeout if any. @@ -297,11 +300,13 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args) // Store the output obtained. if(!output_variable.empty() && tempOutput.size()) { - this->Makefile->AddDefinition(output_variable.c_str(), &*tempOutput.begin()); + this->Makefile->AddDefinition(output_variable.c_str(), + &*tempOutput.begin()); } if(!merge_output && !error_variable.empty() && tempError.size()) { - this->Makefile->AddDefinition(error_variable.c_str(), &*tempError.begin()); + this->Makefile->AddDefinition(error_variable.c_str(), + &*tempError.begin()); } // Store the result of running the process. diff --git a/Source/cmExecuteProcessCommand.h b/Source/cmExecuteProcessCommand.h index bca11a516a..f69c414c74 100644 --- a/Source/cmExecuteProcessCommand.h +++ b/Source/cmExecuteProcessCommand.h @@ -91,9 +91,9 @@ public: "the result of running the processes. This will be an integer return " "code from the last child or a string describing an error condition. " "If OUTPUT_VARIABLE or ERROR_VARIABLE are given the variable named " - "will be set with the contents of the standard output and standard error " - "pipes respectively. If the same variable is named for both pipes " - "their output will be merged in the order produced. " + "will be set with the contents of the standard output and standard " + "error pipes respectively. If the same variable is named for both " + "pipes their output will be merged in the order produced. " "If INPUT_FILE, OUTPUT_FILE, or ERROR_FILE is given the file named " "will be attached to the standard input of the first process, " "standard output of the last process, or standard error of all " diff --git a/Source/cmExportLibraryDependencies.cxx b/Source/cmExportLibraryDependencies.cxx index 9cddd0fd4d..a5d66e75b2 100644 --- a/Source/cmExportLibraryDependencies.cxx +++ b/Source/cmExportLibraryDependencies.cxx @@ -23,12 +23,12 @@ #include <cmsys/auto_ptr.hxx> // cmExecutableCommand -bool cmExportLibraryDependenciesCommand::InitialPass(std::vector<std::string> const& args) +bool cmExportLibraryDependenciesCommand +::InitialPass(std::vector<std::string> const& args) { - // First argument is the name of the test - // Second argument is the name of the executable to run (a target or external - // program) - // Remaining arguments are the arguments to pass to the executable + // First argument is the name of the test Second argument is the name of + // the executable to run (a target or external program) Remaining arguments + // are the arguments to pass to the executable if(args.size() < 1 ) { this->SetError("called with incorrect number of arguments"); diff --git a/Source/cmExportLibraryDependencies.h b/Source/cmExportLibraryDependencies.h index dc46fc8385..e8af97e1be 100644 --- a/Source/cmExportLibraryDependencies.h +++ b/Source/cmExportLibraryDependencies.h @@ -22,7 +22,8 @@ /** \class cmExportLibraryDependenciesCommand * \brief Add a test to the lists of tests to run. * - * cmExportLibraryDependenciesCommand adds a test to the list of tests to run . + * cmExportLibraryDependenciesCommand adds a test to the list of tests to run + * */ class cmExportLibraryDependenciesCommand : public cmCommand { @@ -57,7 +58,8 @@ public: */ virtual const char* GetTerseDocumentation() { - return "Write out the dependency information for all targets of a project."; + return + "Write out the dependency information for all targets of a project."; } /** diff --git a/Source/cmExprLexer.cxx b/Source/cmExprLexer.cxx index 7a025f2c9e..093e206ee0 100644 --- a/Source/cmExprLexer.cxx +++ b/Source/cmExprLexer.cxx @@ -165,7 +165,8 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; #define YY_LESS_LINENO(n) -/* Return all but the first "n" matched characters back to the input stream. */ +/* Return all but the first "n" matched characters back to the input + stream. */ #define yyless(n) \ do \ { \ @@ -264,8 +265,8 @@ struct yy_buffer_state ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ : NULL) -/* Same as previous macro, but useful when we know that the buffer stack is not - * NULL or when we need an lvalue. For internal use only. +/* Same as previous macro, but useful when we know that the buffer stack is + * not NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] @@ -327,7 +328,8 @@ typedef int yy_state_type; #define yytext_ptr yytext_r static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); +static yy_state_type yy_try_NUL_trans (yy_state_type current_state , + yyscan_t yyscanner); static int yy_get_next_buffer (yyscan_t yyscanner ); static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); @@ -456,7 +458,8 @@ This file must be translated to C and modified to build everywhere. Run flex like this: - flex --prefix=cmExpr_yy --header-file=cmExprLexer.h -ocmExprLexer.cxx cmExprLexer.in.l + flex --prefix=cmExpr_yy --header-file=cmExprLexer.h -ocmExprLexer.cxx + cmExprLexer.in.l Modify cmExprLexer.cxx: - remove TABs @@ -535,7 +538,8 @@ struct yyguts_t /* User-defined. Not touched by flex. */ YY_EXTRA_TYPE yyextra_r; - /* The rest are the same as the globals declared in the non-reentrant scanner. */ + /* The rest are the same as the globals declared in the non-reentrant + scanner. */ FILE *yyin_r, *yyout_r; size_t yy_buffer_stack_top; /**< index of top of stack. */ size_t yy_buffer_stack_max; /**< capacity of stack. */ @@ -1137,7 +1141,8 @@ static int yy_get_next_buffer (yyscan_t yyscanner) return ret_val; } -/* yy_get_previous_state - get the state just before the EOB char was reached */ +/* yy_get_previous_state - get the state just before the EOB char was + reached */ static yy_state_type yy_get_previous_state (yyscan_t yyscanner) { diff --git a/Source/cmExprLexer.h b/Source/cmExprLexer.h index 2804528219..aa61053f22 100644 --- a/Source/cmExprLexer.h +++ b/Source/cmExprLexer.h @@ -300,7 +300,8 @@ extern int cmExpr_yylex (yyscan_t yyscanner); #define YY_DECL int cmExpr_yylex (yyscan_t yyscanner) #endif /* !YY_DECL */ -/* yy_get_previous_state - get the state just before the EOB char was reached */ +/* yy_get_previous_state - get the state just before the EOB char was + reached */ #undef YY_NEW_FILE #undef YY_FLUSH_BUFFER diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx index 118cbfb70b..c6097c4587 100644 --- a/Source/cmFLTKWrapUICommand.cxx +++ b/Source/cmFLTKWrapUICommand.cxx @@ -136,8 +136,18 @@ void cmFLTKWrapUICommand::FinalPass() } if (!found) { - std::string msg = "In CMake 2.2 the FLTK_WRAP_UI command sets a variable to the list of source files that should be added to your executable or library. It appears that you have not added these source files to your target. You should change your CMakeLists.txt file to directly add the generated files to the target. For example FTLK_WRAP_UI(foo src1 src2 src3) will create a variable named foo_FLTK_UI_SRCS that contains the list of sources to add to your target when you call ADD_LIBRARY or ADD_EXECUTABLE. For now CMake 2.2 will add the sources to your target for you as was done in CMake 2.0 and earlier. In the future this may become an error. "; - msg += "The problem was found while processing the source directory: "; + std::string msg = + "In CMake 2.2 the FLTK_WRAP_UI command sets a variable to the list of " + "source files that should be added to your executable or library. It " + "appears that you have not added these source files to your target. You " + "should change your CMakeLists.txt file to directly add the generated " + "files to the target. For example FTLK_WRAP_UI(foo src1 src2 src3) " + "will create a variable named foo_FLTK_UI_SRCS that contains the list " + "of sources to add to your target when you call ADD_LIBRARY or " + "ADD_EXECUTABLE. For now CMake will add the sources to your target " + "for you as was done in CMake 2.0 and earlier. In the future this may " + "become an error."; + msg +="The problem was found while processing the source directory: "; msg += this->Makefile->GetStartDirectory(); cmSystemTools::Message(msg.c_str(),"Warning"); // first we add the rules for all the .fl to .h and .cxx files @@ -146,8 +156,8 @@ void cmFLTKWrapUICommand::FinalPass() // Generate code for all the .fl files for(size_t classNum = 0; classNum < lastHeadersClass; classNum++) { - this->Makefile->GetTargets()[this->Target].GetSourceFiles().push_back( - this->GeneratedSourcesClasses[classNum]); + this->Makefile->GetTargets()[this->Target].GetSourceFiles(). + push_back(this->GeneratedSourcesClasses[classNum]); } } } diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 3139b5b739..0eb8f45559 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -788,9 +788,11 @@ bool cmFileCommand::HandleInstallCommand( cmSystemTools::RemoveFile(soname.c_str()); cmSystemTools::RemoveFile(libname.c_str()); - if (!cmSystemTools::CreateSymlink(soname_nopath.c_str(), libname.c_str()) ) + if (!cmSystemTools::CreateSymlink(soname_nopath.c_str(), + libname.c_str()) ) { - std::string errstring = "error when creating symlink from: " + libname + " to " + soname_nopath; + std::string errstring = "error when creating symlink from: " + + libname + " to " + soname_nopath; this->SetError(errstring.c_str()); return false; } @@ -798,9 +800,11 @@ bool cmFileCommand::HandleInstallCommand( smanifest_files += libname.substr(destDirLength);; if ( toFile != soname ) { - if ( !cmSystemTools::CreateSymlink(fromName.c_str(), soname.c_str()) ) + if ( !cmSystemTools::CreateSymlink(fromName.c_str(), + soname.c_str()) ) { - std::string errstring = "error when creating symlink from: " + soname + " to " + fromName; + std::string errstring = "error when creating symlink from: " + + soname + " to " + fromName; this->SetError(errstring.c_str()); return false; } @@ -832,9 +836,11 @@ bool cmFileCommand::HandleInstallCommand( cmSystemTools::RemoveFile(exename.c_str()); - if (!cmSystemTools::CreateSymlink(exename_nopath.c_str(), exename.c_str()) ) + if (!cmSystemTools::CreateSymlink(exename_nopath.c_str(), + exename.c_str()) ) { - std::string errstring = "error when creating symlink from: " + exename + " to " + exename_nopath; + std::string errstring = "error when creating symlink from: " + + exename + " to " + exename_nopath; this->SetError(errstring.c_str()); return false; } @@ -955,18 +961,23 @@ bool cmFileCommand::HandleRelativePathCommand( if(!cmSystemTools::FileIsFullPath(directoryName.c_str())) { - std::string errstring = "RelativePath must be passed a full path to the directory: " + directoryName; + std::string errstring = + "RelativePath must be passed a full path to the directory: " + + directoryName; this->SetError(errstring.c_str()); return false; } if(!cmSystemTools::FileIsFullPath(fileName.c_str())) { - std::string errstring = "RelativePath must be passed a full path to the directory: " + directoryName; + std::string errstring = + "RelativePath must be passed a full path to the directory: " + + directoryName; this->SetError(errstring.c_str()); return false; } - std::string res = cmSystemTools::RelativePath(directoryName.c_str(), fileName.c_str()); + std::string res = cmSystemTools::RelativePath(directoryName.c_str(), + fileName.c_str()); this->Makefile->AddDefinition(outVar.c_str(), res.c_str()); return true; diff --git a/Source/cmFileCommand.h b/Source/cmFileCommand.h index 926a0adb1f..249cbb6093 100644 --- a/Source/cmFileCommand.h +++ b/Source/cmFileCommand.h @@ -68,7 +68,8 @@ public: " FILE(APPEND filename \"message to write\"... )\n" " FILE(READ filename variable)\n" " FILE(GLOB variable [RELATIVE path] [globbing expressions]...)\n" - " FILE(GLOB_RECURSE variable [RELATIVE path] [globbing expressions]...)\n" + " FILE(GLOB_RECURSE variable [RELATIVE path] \n" + " [globbing expressions]...)\n" " FILE(REMOVE [directory]...)\n" " FILE(REMOVE_RECURSE [directory]...)\n" " FILE(MAKE_DIRECTORY [directory]...)\n" diff --git a/Source/cmFileTimeComparison.cxx b/Source/cmFileTimeComparison.cxx index e0e3c86b6e..66a1771723 100644 --- a/Source/cmFileTimeComparison.cxx +++ b/Source/cmFileTimeComparison.cxx @@ -84,7 +84,8 @@ bool cmFileTimeComparisonInternal::Stat(const char* fname, return false; } #else - // Windows version. Get the modification time from extended file attributes. + // Windows version. Get the modification time from extended file + // attributes. WIN32_FILE_ATTRIBUTE_DATA fdata; if(!GetFileAttributesEx(fname, GetFileExInfoStandard, &fdata)) { @@ -116,13 +117,15 @@ cmFileTimeComparison::~cmFileTimeComparison() } //---------------------------------------------------------------------------- -bool cmFileTimeComparison::FileTimeCompare(const char* f1, const char* f2, int* result) +bool cmFileTimeComparison::FileTimeCompare(const char* f1, + const char* f2, int* result) { return this->Internals->FileTimeCompare(f1, f2, result); } //---------------------------------------------------------------------------- -int cmFileTimeComparisonInternal::Compare(cmFileTimeComparison_Type* s1, cmFileTimeComparison_Type* s2) +int cmFileTimeComparisonInternal::Compare(cmFileTimeComparison_Type* s1, + cmFileTimeComparison_Type* s2) { #if !defined(_WIN32) || defined(__CYGWIN__) # if cmsys_STAT_HAS_ST_MTIM diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index 8600fa8389..e2fc963046 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -106,8 +106,9 @@ cmFindBase::cmFindBase() " libraries or headers.\n" " \"ONLY\" - Only try to find frameworks.\n" " \"NEVER\". - Never try to find frameworks.\n" - "On Darwin or systems supporting OSX Application Bundles, the cmake variable" - " CMAKE_FIND_APPBUNDLE can be set to empty or one of the following:\n" + "On Darwin or systems supporting OSX Application Bundles, the cmake " + "variable CMAKE_FIND_APPBUNDLE can be set to empty or one of the " + "following:\n" " \"FIRST\" - Try to find application bundles before standard\n" " programs. This is the default on Darwin.\n" " \"LAST\" - Try to find application bundles after standard\n" @@ -358,7 +359,8 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn) } else if(this->Names.size() == 1) { - this->VariableDocumentation += "the " + this->Names[0] + " library be found"; + this->VariableDocumentation += "the " + + this->Names[0] + " library be found"; } else { @@ -367,7 +369,8 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn) { this->VariableDocumentation += ", " + this->Names[j]; } - this->VariableDocumentation += " or " + this->Names[this->Names.size() - 1] + " libraries be found"; + this->VariableDocumentation += " or " + + this->Names[this->Names.size() - 1] + " libraries be found"; } } @@ -400,24 +403,28 @@ void cmFindBase::ExpandPaths(std::vector<std::string> userPaths) { this->AddAppBundlePaths(); } - if(!this->NoCMakeEnvironmentPath && !(this->SearchFrameworkOnly || this->SearchAppBundleOnly)) + if(!this->NoCMakeEnvironmentPath && + !(this->SearchFrameworkOnly || this->SearchAppBundleOnly)) { // Add CMAKE_*_PATH environment variables this->AddEnvironmentVairables(); } - if(!this->NoCMakePath && !(this->SearchFrameworkOnly || this->SearchAppBundleOnly)) + if(!this->NoCMakePath && + !(this->SearchFrameworkOnly || this->SearchAppBundleOnly)) { // Add CMake varibles of the same name as the previous environment // varibles CMAKE_*_PATH to be used most of the time with -D // command line options this->AddCMakeVairables(); } - if(!this->NoSystemEnvironmentPath && !(this->SearchFrameworkOnly || this->SearchAppBundleOnly)) + if(!this->NoSystemEnvironmentPath && + !(this->SearchFrameworkOnly || this->SearchAppBundleOnly)) { // add System environment PATH and (LIB or INCLUDE) this->AddSystemEnvironmentVairables(); } - if(!this->NoCMakeSystemPath && !(this->SearchFrameworkOnly || this->SearchAppBundleOnly)) + if(!this->NoCMakeSystemPath && + !(this->SearchFrameworkOnly || this->SearchAppBundleOnly)) { // Add CMAKE_SYSTEM_*_PATH variables which are defined in platform files this->AddCMakeSystemVariables(); @@ -569,14 +576,16 @@ void cmFindBase::AddCMakeSystemVariables() } if(this->SearchAppBundleLast) { - if(const char* path = this->Makefile->GetDefinition("CMAKE_SYSTEM_APPBUNDLE_PATH")) + if(const char* path = + this->Makefile->GetDefinition("CMAKE_SYSTEM_APPBUNDLE_PATH")) { cmSystemTools::ExpandListArgument(path, this->SearchPaths); } } if(this->SearchFrameworkLast) { - if(const char* path = this->Makefile->GetDefinition("CMAKE_SYSTEM_FRAMEWORK_PATH")) + if(const char* path = + this->Makefile->GetDefinition("CMAKE_SYSTEM_FRAMEWORK_PATH")) { cmSystemTools::ExpandListArgument(path, this->SearchPaths); } @@ -601,7 +610,8 @@ void cmFindBase::ExpandRegistryAndCleanPath() cmSystemTools::ConvertToUnixSlashes(*i); // copy each finalPath combined with SearchPathSuffixes // to the SearchPaths ivar - for(std::vector<std::string>::iterator j = this->SearchPathSuffixes.begin(); + for(std::vector<std::string>::iterator j = + this->SearchPathSuffixes.begin(); j != this->SearchPathSuffixes.end(); ++j) { std::string p = *i + std::string("/") + *j; @@ -631,11 +641,14 @@ void cmFindBase::PrintFindStuff() std::cerr << "SearchAppBundleOnly: " << this->SearchAppBundleOnly << "\n"; std::cerr << "SearchAppBundleFirst: " << this->SearchAppBundleFirst << "\n"; std::cerr << "VariableName " << this->VariableName << "\n"; - std::cerr << "VariableDocumentation " << this->VariableDocumentation << "\n"; + std::cerr << "VariableDocumentation " + << this->VariableDocumentation << "\n"; std::cerr << "NoDefaultPath " << this->NoDefaultPath << "\n"; - std::cerr << "NoCMakeEnvironmentPath " << this->NoCMakeEnvironmentPath << "\n"; + std::cerr << "NoCMakeEnvironmentPath " + << this->NoCMakeEnvironmentPath << "\n"; std::cerr << "NoCMakePath " << this->NoCMakePath << "\n"; - std::cerr << "NoSystemEnvironmentPath " << this->NoSystemEnvironmentPath << "\n"; + std::cerr << "NoSystemEnvironmentPath " + << this->NoSystemEnvironmentPath << "\n"; std::cerr << "NoCMakeSystemPath " << this->NoCMakeSystemPath << "\n"; std::cerr << "EnvironmentPath " << this->EnvironmentPath << "\n"; std::cerr << "CMakePathName " << this->CMakePathName << "\n"; @@ -670,7 +683,8 @@ bool cmFindBase::CheckForVariableInCache() if(cacheValue) { cmCacheManager::CacheIterator it = - this->Makefile->GetCacheManager()->GetCacheIterator(this->VariableName.c_str()); + this->Makefile->GetCacheManager()-> + GetCacheIterator(this->VariableName.c_str()); if(!it.IsAtEnd()) { const char* hs = it.GetProperty("HELPSTRING"); diff --git a/Source/cmFindFileCommand.cxx b/Source/cmFindFileCommand.cxx index b2682979c8..04d0af7f6e 100644 --- a/Source/cmFindFileCommand.cxx +++ b/Source/cmFindFileCommand.cxx @@ -23,7 +23,8 @@ cmFindFileCommand::cmFindFileCommand() cmSystemTools::ReplaceString(this->GenericDocumentation, "FIND_PATH", "FIND_FILE"); cmSystemTools::ReplaceString(this->GenericDocumentation, - "directory containing the named file", "full path to named file"); + "directory containing the named file", + "full path to named file"); cmSystemTools::ReplaceString(this->GenericDocumentation, "file in a directory", "full path to a file"); } diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx index 7ddad5e35e..1cac1202af 100644 --- a/Source/cmFindLibraryCommand.cxx +++ b/Source/cmFindLibraryCommand.cxx @@ -26,7 +26,8 @@ cmFindLibraryCommand::cmFindLibraryCommand() cmSystemTools::ReplaceString(this->GenericDocumentation, "XXX_SYSTEM", "LIB"); cmSystemTools::ReplaceString(this->GenericDocumentation, - "CMAKE_SYSTEM_XXX_PATH", "CMAKE_SYSTEM_LIBRARY_PATH"); + "CMAKE_SYSTEM_XXX_PATH", + "CMAKE_SYSTEM_LIBRARY_PATH"); cmSystemTools::ReplaceString(this->GenericDocumentation, "SEARCH_XXX_DESC", "library"); cmSystemTools::ReplaceString(this->GenericDocumentation, @@ -80,11 +81,13 @@ bool cmFindLibraryCommand::InitialPass(std::vector<std::string> const& argsIn) void cmFindLibraryCommand::AddLib64Paths() { - if(!this->Makefile->GetLocalGenerator()->GetGlobalGenerator()->GetLanguageEnabled("C")) + if(!this->Makefile->GetLocalGenerator()->GetGlobalGenerator()-> + GetLanguageEnabled("C")) { return; } - std::string voidsize = this->Makefile->GetRequiredDefinition("CMAKE_SIZEOF_VOID_P"); + std::string voidsize = + this->Makefile->GetRequiredDefinition("CMAKE_SIZEOF_VOID_P"); int size = atoi(voidsize.c_str()); std::vector<std::string> path64; if(size != 8) diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index ef2777f074..0179626543 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -202,9 +202,11 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args) { // Listfiles will be looking for the capitalized version of the // name. Provide it. - this->Makefile->AddDefinition(upperDir.c_str(), + this->Makefile->AddDefinition + (upperDir.c_str(), this->Makefile->GetDefinition(this->Variable.c_str())); - this->Makefile->AddDefinition(upperFound.c_str(), + this->Makefile->AddDefinition + (upperFound.c_str(), this->Makefile->GetDefinition(foundVar.c_str())); } @@ -297,8 +299,8 @@ bool cmFindPackageCommand::FindConfig() for(int i=1; i <= 10; ++i) { cmOStringStream r; - r << "[HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild" - << i << "]"; + r << "[HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\" + "Settings\\StartPath;WhereBuild" << i << "]"; std::string entry = r.str(); cmSystemTools::ExpandRegistryValues(entry); cmSystemTools::ConvertToUnixSlashes(entry); diff --git a/Source/cmFindPathCommand.cxx b/Source/cmFindPathCommand.cxx index 2845e863ae..33c590888d 100644 --- a/Source/cmFindPathCommand.cxx +++ b/Source/cmFindPathCommand.cxx @@ -29,9 +29,11 @@ cmFindPathCommand::cmFindPathCommand() cmSystemTools::ReplaceString(this->GenericDocumentation, "XXX_SYSTEM", "INCLUDE"); cmSystemTools::ReplaceString(this->GenericDocumentation, - "CMAKE_SYSTEM_XXX_PATH", "CMAKE_SYSTEM_INCLUDE_PATH"); + "CMAKE_SYSTEM_XXX_PATH", + "CMAKE_SYSTEM_INCLUDE_PATH"); cmSystemTools::ReplaceString(this->GenericDocumentation, - "SEARCH_XXX_DESC", "directory containing the named file"); + "SEARCH_XXX_DESC", + "directory containing the named file"); cmSystemTools::ReplaceString(this->GenericDocumentation, "SEARCH_XXX", "file in a directory"); this->ExtraDocAdded = false; @@ -44,9 +46,11 @@ const char* cmFindPathCommand::GetFullDocumentation() this->GenericDocumentation += "\n" "When searching for frameworks, if the file is specified as " - "A/b.h, then the framework search will look for A.framework/Headers/b.h. " + "A/b.h, then the framework search will look for " + "A.framework/Headers/b.h. " "If that is found the path will be set to the path to the framework. " - "CMake will convert this to the correct -F option to include the file. "; + "CMake will convert this to the correct -F option to include the " + "file. "; this->ExtraDocAdded = true; } return this->GenericDocumentation.c_str(); @@ -109,8 +113,8 @@ bool cmFindPathCommand::InitialPass(std::vector<std::string> const& argsIn) } if(result.size() != 0) { - this->Makefile->AddCacheDefinition(this->VariableName.c_str(), - result.c_str(), + this->Makefile->AddCacheDefinition + (this->VariableName.c_str(), result.c_str(), this->VariableDocumentation.c_str(), (this->IncludeFileInPath) ? cmCacheManager::FILEPATH :cmCacheManager::PATH); @@ -118,7 +122,8 @@ bool cmFindPathCommand::InitialPass(std::vector<std::string> const& argsIn) } } } - this->Makefile->AddCacheDefinition(this->VariableName.c_str(), + this->Makefile->AddCacheDefinition + (this->VariableName.c_str(), (this->VariableName + "-NOTFOUND").c_str(), this->VariableDocumentation.c_str(), (this->IncludeFileInPath) ? @@ -140,7 +145,8 @@ std::string cmFindPathCommand::FindHeaderInFramework(std::string& file, // remove the name from the slash; fileName = fileName.substr(pos+1); frameWorkName = file; - frameWorkName = frameWorkName.substr(0, frameWorkName.size()-fileName.size()-1); + frameWorkName = + frameWorkName.substr(0, frameWorkName.size()-fileName.size()-1); // if the framework has a path in it then just use the filename if(frameWorkName.find("/") != frameWorkName.npos) { diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx index 2e9480160f..6a4634b7ac 100644 --- a/Source/cmFindProgramCommand.cxx +++ b/Source/cmFindProgramCommand.cxx @@ -31,7 +31,8 @@ cmFindProgramCommand::cmFindProgramCommand() cmSystemTools::ReplaceString(this->GenericDocumentation, "XXX_SYSTEM", ""); cmSystemTools::ReplaceString(this->GenericDocumentation, - "CMAKE_SYSTEM_XXX_PATH", "CMAKE_SYSTEM_PROGRAM_PATH"); + "CMAKE_SYSTEM_XXX_PATH", + "CMAKE_SYSTEM_PROGRAM_PATH"); cmSystemTools::ReplaceString(this->GenericDocumentation, "SEARCH_XXX_DESC", "program"); cmSystemTools::ReplaceString(this->GenericDocumentation, @@ -88,14 +89,17 @@ std::string cmFindProgramCommand::FindProgram(std::vector<std::string> names) return program; } -std::string cmFindProgramCommand::FindAppBundle(std::vector<std::string> names) +std::string cmFindProgramCommand +::FindAppBundle(std::vector<std::string> names) { for(std::vector<std::string>::const_iterator name = names.begin(); name != names.end() ; ++name) { std::string appName = *name + std::string(".app"); - std::string appPath = cmSystemTools::FindDirectory(appName.c_str(), this->SearchPaths, true); + std::string appPath = cmSystemTools::FindDirectory(appName.c_str(), + this->SearchPaths, + true); if ( !appPath.empty() ) { @@ -121,10 +125,12 @@ std::string cmFindProgramCommand::GetBundleExecutable(std::string bundlePath) // Get a CFString of the app bundle path // XXX - Is it safe to assume everything is in UTF8? - CFStringRef bundlePathCFS = CFStringCreateWithCString(kCFAllocatorDefault , + CFStringRef bundlePathCFS = + CFStringCreateWithCString(kCFAllocatorDefault , bundlePath.c_str(), kCFStringEncodingUTF8 ); - // Make a CFURLRef from the CFString representation of the bundle’s path. + // Make a CFURLRef from the CFString representation of the + // bundle’s path. CFURLRef bundleURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, bundlePathCFS, kCFURLPOSIXPathStyle, @@ -142,7 +148,8 @@ std::string cmFindProgramCommand::GetBundleExecutable(std::string bundlePath) char buffer[MAX_OSX_PATH_SIZE]; // Convert the CFString to a C string - CFStringGetCString( CFURLGetString(executableURL), buffer, MAX_OSX_PATH_SIZE, kCFStringEncodingUTF8 ); + CFStringGetCString( CFURLGetString(executableURL), buffer, + MAX_OSX_PATH_SIZE, kCFStringEncodingUTF8 ); // And finally to a c++ string executable = bundlePath + "/Contents/MacOS/" + std::string(buffer); diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx index e2dce93c9c..fe53b1289e 100644 --- a/Source/cmForEachCommand.cxx +++ b/Source/cmForEachCommand.cxx @@ -87,7 +87,9 @@ ShouldRemove(const cmListFileFunction& lff, cmMakefile& mf) void cmForEachFunctionBlocker:: ScopeEnded(cmMakefile &mf) { - cmSystemTools::Error("The end of a CMakeLists file was reached with a FOREACH statement that was not closed properly. Within the directory: ", + cmSystemTools::Error("The end of a CMakeLists file was reached with a " + "FOREACH statement that was not closed properly. " + "Within the directory: ", mf.GetCurrentDirectory()); } diff --git a/Source/cmGeneratedFileStream.cxx b/Source/cmGeneratedFileStream.cxx index 70d1c77b99..e8be5fdffb 100644 --- a/Source/cmGeneratedFileStream.cxx +++ b/Source/cmGeneratedFileStream.cxx @@ -44,7 +44,8 @@ cmGeneratedFileStream::cmGeneratedFileStream(const char* name, bool quiet): // Check if the file opened. if(!*this && !quiet) { - cmSystemTools::Error("Cannot open file for write: ", this->TempName.c_str()); + cmSystemTools::Error("Cannot open file for write: ", + this->TempName.c_str()); cmSystemTools::ReportLastSystemError(""); } } @@ -70,7 +71,8 @@ cmGeneratedFileStream::Open(const char* name, bool quiet, bool binaryFlag) // Open the temporary output file. if ( binaryFlag ) { - this->Stream::open(this->TempName.c_str(), std::ios::out | std::ios::binary); + this->Stream::open(this->TempName.c_str(), + std::ios::out | std::ios::binary); } else { @@ -80,7 +82,8 @@ cmGeneratedFileStream::Open(const char* name, bool quiet, bool binaryFlag) // Check if the file opened. if(!*this && !quiet) { - cmSystemTools::Error("Cannot open file for write: ", this->TempName.c_str()); + cmSystemTools::Error("Cannot open file for write: ", + this->TempName.c_str()); cmSystemTools::ReportLastSystemError(""); } return *this; diff --git a/Source/cmGetDirectoryPropertyCommand.cxx b/Source/cmGetDirectoryPropertyCommand.cxx index 79a18adca8..8d08c6b8e8 100644 --- a/Source/cmGetDirectoryPropertyCommand.cxx +++ b/Source/cmGetDirectoryPropertyCommand.cxx @@ -60,7 +60,9 @@ bool cmGetDirectoryPropertyCommand::InitialPass( if (!lg) { this->SetError - ("DIRECTORY argument provided but requested directory not found. This could be because the directory argument was invalid or, it is valid but has not been processed yet."); + ("DIRECTORY argument provided but requested directory not found. " + "This could be because the directory argument was invalid or, " + "it is valid but has not been processed yet."); return false; } dir = lg->GetMakefile(); @@ -140,8 +142,8 @@ bool cmGetDirectoryPropertyCommand::InitialPass( ++i; if (i == args.end()) { - this->SetError - ("A request for a variable definition was made without providing the name of the variable to get."); + this->SetError("A request for a variable definition was made without " + "providing the name of the variable to get."); return false; } output = dir->GetSafeDefinition(i->c_str()); diff --git a/Source/cmGetFilenameComponentCommand.cxx b/Source/cmGetFilenameComponentCommand.cxx index d8b29d3610..df5cc3cda0 100644 --- a/Source/cmGetFilenameComponentCommand.cxx +++ b/Source/cmGetFilenameComponentCommand.cxx @@ -18,7 +18,8 @@ #include "cmSystemTools.h" // cmGetFilenameComponentCommand -bool cmGetFilenameComponentCommand::InitialPass(std::vector<std::string> const& args) +bool cmGetFilenameComponentCommand +::InitialPass(std::vector<std::string> const& args) { if(args.size() < 3) { @@ -63,7 +64,8 @@ bool cmGetFilenameComponentCommand::InitialPass(std::vector<std::string> const& } } } - cmSystemTools::SplitProgramFromArgs(filename.c_str(), result, programArgs); + cmSystemTools::SplitProgramFromArgs(filename.c_str(), + result, programArgs); } else if (args[2] == "EXT") { @@ -102,15 +104,13 @@ bool cmGetFilenameComponentCommand::InitialPass(std::vector<std::string> const& { if(programArgs.size() && storeArgs.size()) { - this->Makefile->AddCacheDefinition(storeArgs.c_str(), - programArgs.c_str(), - "", - args[2] == "PATH" ? cmCacheManager::FILEPATH + this->Makefile->AddCacheDefinition + (storeArgs.c_str(), programArgs.c_str(), + "", args[2] == "PATH" ? cmCacheManager::FILEPATH : cmCacheManager::STRING); } - this->Makefile->AddCacheDefinition(args[0].c_str(), - result.c_str(), - "", + this->Makefile->AddCacheDefinition + (args[0].c_str(), result.c_str(), "", args[2] == "PATH" ? cmCacheManager::FILEPATH : cmCacheManager::STRING); } diff --git a/Source/cmGetFilenameComponentCommand.h b/Source/cmGetFilenameComponentCommand.h index fe490ddbda..a9c1dbb0f8 100644 --- a/Source/cmGetFilenameComponentCommand.h +++ b/Source/cmGetFilenameComponentCommand.h @@ -73,8 +73,8 @@ public: "extension (EXT), file name without extension (NAME_WE) of FileName, " "or the full absolute (ABSOLUTE) file name without symlinks. " "Note that the path is converted to Unix slashes format and has no " - "trailing slashes. The longest file extension is always considered. If " - "the optional CACHE argument is specified, the result variable is " + "trailing slashes. The longest file extension is always considered. " + "If the optional CACHE argument is specified, the result variable is " "added to the cache.\n" " GET_FILENAME_COMPONENT(VarName FileName\n" " PROGRAM [PROGRAM_ARGS ArgVar]\n" diff --git a/Source/cmGlobalBorlandMakefileGenerator.cxx b/Source/cmGlobalBorlandMakefileGenerator.cxx index b1efb700c8..5018a8c26c 100644 --- a/Source/cmGlobalBorlandMakefileGenerator.cxx +++ b/Source/cmGlobalBorlandMakefileGenerator.cxx @@ -28,8 +28,8 @@ cmGlobalBorlandMakefileGenerator::cmGlobalBorlandMakefileGenerator() } -void cmGlobalBorlandMakefileGenerator::EnableLanguage(std::vector<std::string>const& l, - cmMakefile *mf) +void cmGlobalBorlandMakefileGenerator +::EnableLanguage(std::vector<std::string>const& l, cmMakefile *mf) { std::string outdir = this->CMakeInstance->GetStartOutputDirectory(); mf->AddDefinition("BORLAND", "1"); @@ -55,7 +55,8 @@ cmLocalGenerator *cmGlobalBorlandMakefileGenerator::CreateLocalGenerator() //---------------------------------------------------------------------------- -void cmGlobalBorlandMakefileGenerator::GetDocumentation(cmDocumentationEntry& entry) const +void cmGlobalBorlandMakefileGenerator +::GetDocumentation(cmDocumentationEntry& entry) const { entry.name = this->GetName(); entry.brief = "Generates Borland makefiles."; |