diff options
author | Kitware Robot <kwrobot@kitware.com> | 2012-08-13 17:42:58 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-08-13 18:18:39 (GMT) |
commit | 7bbaa4283de26864b2e55e819db0884771585467 (patch) | |
tree | ecb748dbe41a13d8bdea77acd0049cde999d933e /Source | |
parent | be9db98946b7918f279812fd0616abb650eebed0 (diff) | |
download | CMake-7bbaa4283de26864b2e55e819db0884771585467.zip CMake-7bbaa4283de26864b2e55e819db0884771585467.tar.gz CMake-7bbaa4283de26864b2e55e819db0884771585467.tar.bz2 |
Remove trailing whitespace from most CMake and C/C++ code
Our Git commit hooks disallow modification or addition of lines with
trailing whitespace. Wipe out all remnants of trailing whitespace
everywhere except third-party code.
Run the following shell code:
git ls-files -z -- \
bootstrap doxygen.config '*.readme' \
'*.c' '*.cmake' '*.cpp' '*.cxx' \
'*.el' '*.f' '*.f90' '*.h' '*.in' '*.in.l' '*.java' \
'*.mm' '*.pike' '*.py' '*.txt' '*.vim' |
egrep -z -v '^(Utilities/cm|Source/(kwsys|CursesDialog/form)/)' |
egrep -z -v '^(Modules/CPack\..*\.in)' |
xargs -0 sed -i 's/ \+$//'
Diffstat (limited to 'Source')
323 files changed, 2148 insertions, 2148 deletions
diff --git a/Source/CPack/OSXScriptLauncher.cxx b/Source/CPack/OSXScriptLauncher.cxx index e0fbe9b..a9842c1 100644 --- a/Source/CPack/OSXScriptLauncher.cxx +++ b/Source/CPack/OSXScriptLauncher.cxx @@ -93,7 +93,7 @@ int main(int argc, char* argv[]) cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1); cmsysProcess_SetTimeout(cp, 0); cmsysProcess_Execute(cp); - + std::vector<char> tempOutput; char* data; int length; @@ -111,9 +111,9 @@ int main(int argc, char* argv[]) } cmsys_ios::cout.write(data, length); } - + cmsysProcess_WaitForExit(cp, 0); - + bool result = true; if(cmsysProcess_GetState(cp) == cmsysProcess_State_Exited) { @@ -140,7 +140,7 @@ int main(int argc, char* argv[]) std::cerr << error_str << std::endl; result = false; } - + cmsysProcess_Delete(cp); return 0; diff --git a/Source/CPack/bills-comments.txt b/Source/CPack/bills-comments.txt index f73499d..c3b4ee8 100644 --- a/Source/CPack/bills-comments.txt +++ b/Source/CPack/bills-comments.txt @@ -1,18 +1,18 @@ cpack.cxx - -cmCPackGenerators -- creates cmCPackGenericGenerator's via NewGenerator + +cmCPackGenerators -- creates cmCPackGenericGenerator's via NewGenerator - a cmCPackGenericGenerator factory cmCPackGenericGenerator::Initialize this->InitializeInternal - CPACK_INCLUDE_TOPLEVEL_DIRECTORY = 0 turns off + CPACK_INCLUDE_TOPLEVEL_DIRECTORY = 0 turns off // binary package run cmCPackGenericGenerator::ProcessGenerator // DoPackage cmCPackGenericGenerator::PrepareNames -- sets a bunch of CPACK_vars - cmCPackGenericGenerator::InstallProject + cmCPackGenericGenerator::InstallProject run preinstall (make preinstall/fast) call ReadListFile(cmake_install.cmake) glob recurse in install directory to get list of files @@ -22,9 +22,9 @@ cmCPackGenericGenerator::ProcessGenerator // DoPackage // source package run cmCPackGenericGenerator::ProcessGenerator // DoPackage cmCPackGenericGenerator::PrepareNames -- sets a bunch of CPACK_vars - cmCPackGenericGenerator::InstallProject --> + cmCPackGenericGenerator::InstallProject --> if set CPACK_INSTALLED_DIRECTORIES - glob the files in that directory + glob the files in that directory copy those files to the tmp install directory _CPack something glob recurse in install directory to get list of files this->CompressFiles with the list of files @@ -35,12 +35,12 @@ packages. It is controled based on values set in CPACK_ variables. InstallProject - 1. CPACK_INSTALL_COMMANDS - a list of commands used to install the package + 1. CPACK_INSTALL_COMMANDS - a list of commands used to install the package 2. CPACK_INSTALLED_DIRECTORIES - copy this directory to CPACK_TEMPORARY_DIRECTORY 3. CPACK_INSTALL_CMAKE_PROJECTS - a cmake install script - - run make preinstall + - run make preinstall - run cmake_install.cmake - set CMAKE_INSTALL_PREFIX to the temp directory - CPACK_BUILD_CONFIG check this and set the BUILD_TYPE to it @@ -59,10 +59,10 @@ rename cmCPackGenericGenerator::ProcessGenerator -> cmCPackGenerator::DoPackage break up cmCPackGenerator::InstallProject so it calls the following: // run user provided install commands - cmCPackGenerator::RunInstallCommands(); + cmCPackGenerator::RunInstallCommands(); // copy entire directories that need no processing like source trees - cmCPackGenerator::CopyPreInstalledDirectories(); + cmCPackGenerator::CopyPreInstalledDirectories(); // run the cmake install scripts if provided - cmCPackGenerator::RunCMakeInstallScripts() + cmCPackGenerator::RunCMakeInstallScripts() - diff --git a/Source/CPack/cmCPackArchiveGenerator.h b/Source/CPack/cmCPackArchiveGenerator.h index b1bbb83..6411b1e 100644 --- a/Source/CPack/cmCPackArchiveGenerator.h +++ b/Source/CPack/cmCPackArchiveGenerator.h @@ -33,7 +33,7 @@ public: */ cmCPackArchiveGenerator(cmArchiveWrite::Compress, cmArchiveWrite::Type); virtual ~cmCPackArchiveGenerator(); - // Used to add a header to the archive + // Used to add a header to the archive virtual int GenerateHeader(std::ostream* os); // component support virtual bool SupportsComponentInstallation() const; diff --git a/Source/CPack/cmCPackBundleGenerator.cxx b/Source/CPack/cmCPackBundleGenerator.cxx index af78e78..6c994f1 100644 --- a/Source/CPack/cmCPackBundleGenerator.cxx +++ b/Source/CPack/cmCPackBundleGenerator.cxx @@ -91,8 +91,8 @@ int cmCPackBundleGenerator::PackageFiles() } // Get optional arguments ... - const std::string cpack_bundle_startup_command = - this->GetOption("CPACK_BUNDLE_STARTUP_COMMAND") + const std::string cpack_bundle_startup_command = + this->GetOption("CPACK_BUNDLE_STARTUP_COMMAND") ? this->GetOption("CPACK_BUNDLE_STARTUP_COMMAND") : ""; // The staging directory contains everything that will end-up inside the diff --git a/Source/CPack/cmCPackComponentGroup.cxx b/Source/CPack/cmCPackComponentGroup.cxx index 1d21fb1..f93eca8 100644 --- a/Source/CPack/cmCPackComponentGroup.cxx +++ b/Source/CPack/cmCPackComponentGroup.cxx @@ -36,7 +36,7 @@ unsigned long cmCPackComponent::GetInstalledSize(const char* installDir) const } //---------------------------------------------------------------------- -unsigned long +unsigned long cmCPackComponent::GetInstalledSizeInKbytes(const char* installDir) const { unsigned long result = (GetInstalledSize(installDir) + 512) / 1024; diff --git a/Source/CPack/cmCPackComponentGroup.h b/Source/CPack/cmCPackComponentGroup.h index cebdd6d..48d935c 100644 --- a/Source/CPack/cmCPackComponentGroup.h +++ b/Source/CPack/cmCPackComponentGroup.h @@ -18,7 +18,7 @@ class cmCPackComponentGroup; /** \class cmCPackInstallationType - * \brief A certain type of installation, which encompasses a + * \brief A certain type of installation, which encompasses a * set of components. */ class cmCPackInstallationType @@ -90,7 +90,7 @@ public: std::vector<std::string> Directories; /// Get the total installed size of all of the files in this - /// component, in bytes. installDir is the directory into which the + /// component, in bytes. installDir is the directory into which the /// component was installed. unsigned long GetInstalledSize(const char* installDir) const; diff --git a/Source/CPack/cmCPackCygwinBinaryGenerator.cxx b/Source/CPack/cmCPackCygwinBinaryGenerator.cxx index 6c8fc54..6605f16 100644 --- a/Source/CPack/cmCPackCygwinBinaryGenerator.cxx +++ b/Source/CPack/cmCPackCygwinBinaryGenerator.cxx @@ -50,7 +50,7 @@ int cmCPackCygwinBinaryGenerator::PackageFiles() std::string manifest = "/usr/share/doc/"; manifest += packageName; manifest += "/MANIFEST"; - std::string manifestFile + std::string manifestFile = this->GetOption("CPACK_TEMPORARY_DIRECTORY"); // Create a MANIFEST file that contains all of the files in // the tar file @@ -70,8 +70,8 @@ int cmCPackCygwinBinaryGenerator::PackageFiles() } // add the manifest file to the list of all files files.push_back(manifestFile); - - // create the bzip2 tar file + + // create the bzip2 tar file return this->Superclass::PackageFiles(); } @@ -81,8 +81,8 @@ const char* cmCPackCygwinBinaryGenerator::GetOutputExtension() const char* patchNumber =this->GetOption("CPACK_CYGWIN_PATCH_NUMBER"); if(!patchNumber) { - patchNumber = "1"; - cmCPackLogger(cmCPackLog::LOG_WARNING, + patchNumber = "1"; + cmCPackLogger(cmCPackLog::LOG_WARNING, "CPACK_CYGWIN_PATCH_NUMBER not specified using 1" << std::endl); } diff --git a/Source/CPack/cmCPackCygwinSourceGenerator.cxx b/Source/CPack/cmCPackCygwinSourceGenerator.cxx index 5979729..f1e8539 100644 --- a/Source/CPack/cmCPackCygwinSourceGenerator.cxx +++ b/Source/CPack/cmCPackCygwinSourceGenerator.cxx @@ -68,18 +68,18 @@ int cmCPackCygwinSourceGenerator::PackageFiles() // and the CPACK_CYGWIN_PATCH_FILE and CPACK_TOPLEVEL_DIRECTORY // files std::string compressOutFile = packageDirFileName; - // at this point compressOutFile is the full path to + // at this point compressOutFile is the full path to // _CPack_Package/.../package-2.5.0.tar.bz2 // we want to create a tar _CPack_Package/.../package-2.5.0-1-src.tar.bz2 - // with these - // _CPack_Package/.../package-2.5.0-1.patch + // with these + // _CPack_Package/.../package-2.5.0-1.patch // _CPack_Package/.../package-2.5.0-1.sh // _CPack_Package/.../package-2.5.0.tar.bz2 // the -1 is CPACK_CYGWIN_PATCH_NUMBER - + // first copy the patch file and the .sh file // to the toplevel cpack temp dir - + // copy the patch file into place if(!this->GetOption("CPACK_CYGWIN_PATCH_FILE")) { @@ -98,7 +98,7 @@ int cmCPackCygwinSourceGenerator::PackageFiles() } if(!this->GetOption("CPACK_CYGWIN_BUILD_SCRIPT")) { - cmCPackLogger(cmCPackLog::LOG_ERROR, + cmCPackLogger(cmCPackLog::LOG_ERROR, "No build script specified for cygwin sources."); return 0; } @@ -168,7 +168,7 @@ const char* cmCPackCygwinSourceGenerator::GetPackagingInstallPrefix() const char* cmCPackCygwinSourceGenerator::GetOutputExtension() { this->OutputExtension = "-"; - const char* patch = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER"); + const char* patch = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER"); if(!patch) { cmCPackLogger(cmCPackLog::LOG_WARNING, "CPACK_CYGWIN_PATCH_NUMBER" @@ -179,4 +179,4 @@ const char* cmCPackCygwinSourceGenerator::GetOutputExtension() this->OutputExtension += "-src.tar.bz2"; return this->OutputExtension.c_str(); } - + diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index fa456de..4bd5d5c 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -293,15 +293,15 @@ int cmCPackDebGenerator::createDeb() // debian policy enforce lower case for package name // mandatory entries: - std::string debian_pkg_name = cmsys::SystemTools::LowerCase( + std::string debian_pkg_name = cmsys::SystemTools::LowerCase( this->GetOption("CPACK_DEBIAN_PACKAGE_NAME") ); - const char* debian_pkg_version = + const char* debian_pkg_version = this->GetOption("CPACK_DEBIAN_PACKAGE_VERSION"); - const char* debian_pkg_section = + const char* debian_pkg_section = this->GetOption("CPACK_DEBIAN_PACKAGE_SECTION"); - const char* debian_pkg_priority = + const char* debian_pkg_priority = this->GetOption("CPACK_DEBIAN_PACKAGE_PRIORITY"); - const char* debian_pkg_arch = + const char* debian_pkg_arch = this->GetOption("CPACK_DEBIAN_PACKAGE_ARCHITECTURE"); const char* maintainer = this->GetOption("CPACK_DEBIAN_PACKAGE_MAINTAINER"); const char* desc = this->GetOption("CPACK_DEBIAN_PACKAGE_DESCRIPTION"); @@ -719,8 +719,8 @@ static int copy_ar(CF *cfp, off_t size) FILE* from = cfp->rFile; FILE* to = cfp->wFile; - while (sz && - (nr = fread(buf, 1, sz < static_cast<off_t>(sizeof(buf)) + while (sz && + (nr = fread(buf, 1, sz < static_cast<off_t>(sizeof(buf)) ? static_cast<size_t>(sz) : sizeof(buf), from )) > 0) { sz -= nr; @@ -731,7 +731,7 @@ static int copy_ar(CF *cfp, off_t size) if (sz) return -2; - if (cfp->flags & WPAD && (size + ar_already_written) & 1 + if (cfp->flags & WPAD && (size + ar_already_written) & 1 && fwrite(&pad, 1, 1, to) != 1) return -4; @@ -767,8 +767,8 @@ static int put_arobj(CF *cfp, struct stat *sb) (long long)sb->st_size + lname, ARFMAG); else { lname = 0; - (void)sprintf(ar_hb, HDR2, name, - (long int)sb->st_mtime, uid, gid, sb->st_mode, + (void)sprintf(ar_hb, HDR2, name, + (long int)sb->st_mtime, uid, gid, sb->st_mode, (long long)sb->st_size, ARFMAG); } off_t size = sb->st_size; @@ -790,7 +790,7 @@ static int put_arobj(CF *cfp, struct stat *sb) /* append -- * Append files to the archive - modifies original archive or creates - * a new archive if named archive does not exist. + * a new archive if named archive does not exist. */ static int ar_append(const char* archive,const std::vector<std::string>& files) { diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx index 6aee401..78cb1b6 100644 --- a/Source/CPack/cmCPackDragNDropGenerator.cxx +++ b/Source/CPack/cmCPackDragNDropGenerator.cxx @@ -17,7 +17,7 @@ #include <cmsys/RegularExpression.hxx> -static const char* SLAHeader = +static const char* SLAHeader = "data 'LPic' (5000) {\n" " $\"0002 0011 0003 0001 0000 0000 0002 0000\"\n" " $\"0008 0003 0000 0001 0004 0000 0004 0005\"\n" @@ -29,7 +29,7 @@ static const char* SLAHeader = "};\n" "\n"; -static const char* SLASTREnglish = +static const char* SLASTREnglish = "resource 'STR#' (5002, \"English\") {\n" " {\n" " \"English\",\n" @@ -90,7 +90,7 @@ int cmCPackDragNDropGenerator::InitializeInternal() return 0; } this->SetOptionIfNotSet("CPACK_COMMAND_SETFILE", setfile_path.c_str()); - + const std::string rez_path = cmSystemTools::FindProgram("Rez", paths, false); if(rez_path.empty()) @@ -222,7 +222,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, // Get optional arguments ... const std::string cpack_package_icon = this->GetOption("CPACK_PACKAGE_ICON") ? this->GetOption("CPACK_PACKAGE_ICON") : ""; - + const std::string cpack_dmg_volume_name = this->GetOption("CPACK_DMG_VOLUME_NAME") ? this->GetOption("CPACK_DMG_VOLUME_NAME") @@ -233,8 +233,8 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, ? this->GetOption("CPACK_DMG_FORMAT") : "UDZO"; // Get optional arguments ... - std::string cpack_license_file = - this->GetOption("CPACK_RESOURCE_FILE_LICENSE") ? + std::string cpack_license_file = + this->GetOption("CPACK_RESOURCE_FILE_LICENSE") ? this->GetOption("CPACK_RESOURCE_FILE_LICENSE") : ""; const std::string cpack_dmg_background_image = @@ -405,7 +405,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, cmOStringStream detach_command; detach_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); detach_command << " detach"; - detach_command << " \"" << temp_mount.str() << "\""; + detach_command << " \"" << temp_mount.str() << "\""; if(!this->RunCommand(detach_command)) { @@ -416,7 +416,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, return 0; } } - + if(!cpack_license_file.empty()) { std::string sla_r = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); @@ -460,7 +460,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, udco_image_command << " convert \"" << temp_image << "\""; udco_image_command << " -format UDCO"; udco_image_command << " -o \"" << temp_udco << "\""; - + std::string error; if(!this->RunCommand(udco_image_command, &error)) { @@ -476,17 +476,17 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, unflatten_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); unflatten_command << " unflatten "; unflatten_command << "\"" << temp_udco << "\""; - + if(!this->RunCommand(unflatten_command, &error)) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Error unflattening dmg for adding SLA." << std::endl - << error + << error << std::endl); return 0; } - - // Rez the SLA + + // Rez the SLA cmOStringStream embed_sla_command; embed_sla_command << this->GetOption("CPACK_COMMAND_REZ"); embed_sla_command << " \"" << sla_r << "\""; @@ -496,8 +496,8 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, if(!this->RunCommand(embed_sla_command, &error)) { cmCPackLogger(cmCPackLog::LOG_ERROR, - "Error adding SLA." << std::endl - << error + "Error adding SLA." << std::endl + << error << std::endl); return 0; } @@ -507,7 +507,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, flatten_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); flatten_command << " flatten "; flatten_command << "\"" << temp_udco << "\""; - + if(!this->RunCommand(flatten_command, &error)) { cmCPackLogger(cmCPackLog::LOG_ERROR, @@ -530,7 +530,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, final_image_command << " -imagekey"; final_image_command << " zlib-level=9"; final_image_command << " -o \"" << output_file << "\""; - + if(!this->RunCommand(final_image_command)) { cmCPackLogger(cmCPackLog::LOG_ERROR, diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 0177653..f113400 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -105,7 +105,7 @@ int cmCPackGenerator::PrepareNames() "CPACK_PACKAGE_FILE_NAME not specified" << std::endl); return 0; } - std::string outName = pfname; + std::string outName = pfname; tempDirectory += "/" + outName; if(!this->GetOutputExtension()) { @@ -149,7 +149,7 @@ int cmCPackGenerator::PrepareNames() if ( !cmSystemTools::FileExists(descFileName) ) { cmCPackLogger(cmCPackLog::LOG_ERROR, - "Cannot find description file name: [" + "Cannot find description file name: [" << descFileName << "]" << std::endl); return 0; } @@ -207,7 +207,7 @@ int cmCPackGenerator::InstallProject() if ( !cmsys::SystemTools::MakeDirectory(bareTempInstallDirectory.c_str())) { cmCPackLogger(cmCPackLog::LOG_ERROR, - "Problem creating temporary directory: " + "Problem creating temporary directory: " << (tempInstallDirectory ? tempInstallDirectory : "(NULL}") << std::endl); return 0; @@ -584,7 +584,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( !(this->IsSet("CPACK_MONOLITHIC_INSTALL"))) { // Determine the installation types for this project (if provided). - std::string installTypesVar = "CPACK_" + std::string installTypesVar = "CPACK_" + cmSystemTools::UpperCase(installComponent) + "_INSTALL_TYPES"; const char *installTypes = this->GetOption(installTypesVar.c_str()); if (installTypes && *installTypes) @@ -596,16 +596,16 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( installTypeIt != installTypesVector.end(); ++installTypeIt) { - this->GetInstallationType(installProjectName.c_str(), + this->GetInstallationType(installProjectName.c_str(), installTypeIt->c_str()); } } // Determine the set of components that will be used in this project - std::string componentsVar + std::string componentsVar = "CPACK_COMPONENTS_" + cmSystemTools::UpperCase(installComponent); const char *components = this->GetOption(componentsVar.c_str()); - if (components && *components) + if (components && *components) { cmSystemTools::ExpandListArgument(components, componentsVector); std::vector<std::string>::iterator compIt; @@ -688,10 +688,10 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( if (componentInstall) { cmCPackLogger(cmCPackLog::LOG_OUTPUT, - "- Install component: " << installComponent + "- Install component: " << installComponent << std::endl); } - + cmake cm; cm.AddCMakePaths(); cm.SetProgressCallback(cmCPackGeneratorProgress, this); @@ -758,7 +758,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( "- Using DESTDIR + CPACK_INSTALL_PREFIX... (mf->AddDefinition)" << std::endl); cmCPackLogger(cmCPackLog::LOG_DEBUG, - "- Setting CMAKE_INSTALL_PREFIX to '" << dir << "'" + "- Setting CMAKE_INSTALL_PREFIX to '" << dir << "'" << std::endl); // Make sure that DESTDIR + CPACK_INSTALL_PREFIX directory @@ -792,7 +792,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( if ( !cmsys::SystemTools::MakeDirectory(dir.c_str())) { cmCPackLogger(cmCPackLog::LOG_ERROR, - "Problem creating temporary directory: " + "Problem creating temporary directory: " << dir << std::endl); return 0; } @@ -806,7 +806,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( tempInstallDirectory.c_str())) { cmCPackLogger(cmCPackLog::LOG_ERROR, - "Problem creating temporary directory: " + "Problem creating temporary directory: " << tempInstallDirectory << std::endl); return 0; } @@ -832,7 +832,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( installComponent.c_str()); } - // strip on TRUE, ON, 1, one or several file names, but not on + // strip on TRUE, ON, 1, one or several file names, but not on // FALSE, OFF, 0 and an empty string if (!cmSystemTools::IsOff(this->GetOption("CPACK_STRIP_FILES"))) { @@ -1024,7 +1024,7 @@ int cmCPackGenerator::DoPackage() = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); if ( cmSystemTools::FileExists(toplevelDirectory) ) { - cmCPackLogger(cmCPackLog::LOG_VERBOSE, + cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Remove toplevel directory: " << toplevelDirectory << std::endl); if ( !cmSystemTools::RepeatedRemoveDirectory(toplevelDirectory) ) @@ -1153,10 +1153,10 @@ int cmCPackGenerator::Initialize(const char* name, cmMakefile* mf) // set the running generator name this->SetOption("CPACK_GENERATOR", this->Name.c_str()); // Load the project specific config file - const char* config = + const char* config = this->GetOption("CPACK_PROJECT_CONFIG_FILE"); if(config) - { + { mf->ReadListFile(config); } int result = this->InitializeInternal(); @@ -1193,13 +1193,13 @@ bool cmCPackGenerator::IsOn(const char* name) const //---------------------------------------------------------------------- const char* cmCPackGenerator::GetOption(const char* op) const -{ +{ const char* ret = this->MakefileMap->GetDefinition(op); if(!ret) - { - cmCPackLogger(cmCPackLog::LOG_DEBUG, + { + cmCPackLogger(cmCPackLog::LOG_DEBUG, "Warning, GetOption return NULL for: " - << op + << op << std::endl); } return ret; @@ -1222,7 +1222,7 @@ int cmCPackGenerator::SetCMakeRoot() return 1; } cmCPackLogger(cmCPackLog::LOG_ERROR, - "Could not find CMAKE_ROOT !!!" + "Could not find CMAKE_ROOT !!!" << std::endl << "CMake has most likely not been installed correctly." << std::endl @@ -1516,14 +1516,14 @@ cmCPackGenerator::GetInstallationType(const char *projectName, (void) projectName; bool hasInstallationType = this->InstallationTypes.count(name) != 0; cmCPackInstallationType *installType = &this->InstallationTypes[name]; - if (!hasInstallationType) + if (!hasInstallationType) { // Define the installation type - std::string macroPrefix = "CPACK_INSTALL_TYPE_" + std::string macroPrefix = "CPACK_INSTALL_TYPE_" + cmsys::SystemTools::UpperCase(name); installType->Name = name; - const char* displayName + const char* displayName = this->GetOption((macroPrefix + "_DISPLAY_NAME").c_str()); if (displayName && *displayName) { @@ -1546,13 +1546,13 @@ cmCPackGenerator::GetComponent(const char *projectName, const char *name) { bool hasComponent = this->Components.count(name) != 0; cmCPackComponent *component = &this->Components[name]; - if (!hasComponent) + if (!hasComponent) { // Define the component - std::string macroPrefix = "CPACK_COMPONENT_" + std::string macroPrefix = "CPACK_COMPONENT_" + cmsys::SystemTools::UpperCase(name); component->Name = name; - const char* displayName + const char* displayName = this->GetOption((macroPrefix + "_DISPLAY_NAME").c_str()); if (displayName && *displayName) { @@ -1562,7 +1562,7 @@ cmCPackGenerator::GetComponent(const char *projectName, const char *name) { component->DisplayName = component->Name; } - component->IsHidden + component->IsHidden = this->IsSet((macroPrefix + "_HIDDEN").c_str()); component->IsRequired = this->IsSet((macroPrefix + "_REQUIRED").c_str()); @@ -1572,7 +1572,7 @@ cmCPackGenerator::GetComponent(const char *projectName, const char *name) = this->IsSet((macroPrefix + "_DOWNLOADED").c_str()) || cmSystemTools::IsOn(this->GetOption("CPACK_DOWNLOAD_ALL")); - const char* archiveFile = this->GetOption((macroPrefix + + const char* archiveFile = this->GetOption((macroPrefix + "_ARCHIVE_FILE").c_str()); if (archiveFile && *archiveFile) { @@ -1580,7 +1580,7 @@ cmCPackGenerator::GetComponent(const char *projectName, const char *name) } const char* groupName = this->GetOption((macroPrefix + "_GROUP").c_str()); - if (groupName && *groupName) + if (groupName && *groupName) { component->Group = GetComponentGroup(projectName, groupName); component->Group->Components.push_back(component); @@ -1598,15 +1598,15 @@ cmCPackGenerator::GetComponent(const char *projectName, const char *name) } // Determine the installation types. - const char *installTypes + const char *installTypes = this->GetOption((macroPrefix + "_INSTALL_TYPES").c_str()); - if (installTypes && *installTypes) + if (installTypes && *installTypes) { std::vector<std::string> installTypesVector; cmSystemTools::ExpandListArgument(installTypes, installTypesVector); std::vector<std::string>::iterator installTypesIt; - for (installTypesIt = installTypesVector.begin(); - installTypesIt != installTypesVector.end(); + for (installTypesIt = installTypesVector.begin(); + installTypesIt != installTypesVector.end(); ++installTypesIt) { component->InstallationTypes.push_back( @@ -1616,16 +1616,16 @@ cmCPackGenerator::GetComponent(const char *projectName, const char *name) // Determine the component dependencies. const char *depends = this->GetOption((macroPrefix + "_DEPENDS").c_str()); - if (depends && *depends) + if (depends && *depends) { std::vector<std::string> dependsVector; cmSystemTools::ExpandListArgument(depends, dependsVector); std::vector<std::string>::iterator dependIt; - for (dependIt = dependsVector.begin(); - dependIt != dependsVector.end(); + for (dependIt = dependsVector.begin(); + dependIt != dependsVector.end(); ++dependIt) { - cmCPackComponent *child = GetComponent(projectName, + cmCPackComponent *child = GetComponent(projectName, dependIt->c_str()); component->Dependencies.push_back(child); child->ReverseDependencies.push_back(component); @@ -1640,15 +1640,15 @@ cmCPackComponentGroup* cmCPackGenerator::GetComponentGroup(const char *projectName, const char *name) { (void) projectName; - std::string macroPrefix = "CPACK_COMPONENT_GROUP_" + std::string macroPrefix = "CPACK_COMPONENT_GROUP_" + cmsys::SystemTools::UpperCase(name); bool hasGroup = this->ComponentGroups.count(name) != 0; cmCPackComponentGroup *group = &this->ComponentGroups[name]; - if (!hasGroup) + if (!hasGroup) { // Define the group group->Name = name; - const char* displayName + const char* displayName = this->GetOption((macroPrefix + "_DISPLAY_NAME").c_str()); if (displayName && *displayName) { @@ -1669,7 +1669,7 @@ cmCPackGenerator::GetComponentGroup(const char *projectName, const char *name) = this->IsSet((macroPrefix + "_BOLD_TITLE").c_str()); group->IsExpandedByDefault = this->IsSet((macroPrefix + "_EXPANDED").c_str()); - const char* parentGroupName + const char* parentGroupName = this->GetOption((macroPrefix + "_PARENT_GROUP").c_str()); if (parentGroupName && *parentGroupName) { diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h index 6748512..8fafef9 100644 --- a/Source/CPack/cmCPackGenerator.h +++ b/Source/CPack/cmCPackGenerator.h @@ -113,7 +113,7 @@ public: //! Display verbose information via logger void DisplayVerboseOutput(const char* msg, float progress); - + bool ReadListFile(const char* moduleName); protected: diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index 7b52511..b2e57a2 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -102,7 +102,7 @@ int cmCPackNSISGenerator::PackageFiles() } if (!Components.empty()) { - // If this is a component installation, strip off the component + // If this is a component installation, strip off the component // part of the path. std::string::size_type slash = fileN.find('/'); if (slash != std::string::npos) @@ -124,12 +124,12 @@ int cmCPackNSISGenerator::PackageFiles() } cmCPackLogger(cmCPackLog::LOG_DEBUG, "Uninstall Dirs: " << dstr.str().c_str() << std::endl); - this->SetOptionIfNotSet("CPACK_NSIS_DELETE_DIRECTORIES", + this->SetOptionIfNotSet("CPACK_NSIS_DELETE_DIRECTORIES", dstr.str().c_str()); cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: " << nsisInFileName << " to " << nsisFileName << std::endl); - if(this->IsSet("CPACK_NSIS_MUI_ICON") + if(this->IsSet("CPACK_NSIS_MUI_ICON") || this->IsSet("CPACK_NSIS_MUI_UNIICON")) { std::string installerIconCode; @@ -174,7 +174,7 @@ int cmCPackNSISGenerator::PackageFiles() this->SetOptionIfNotSet("CPACK_NSIS_INSTALLATION_TYPES", ""); this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_COMPONENTS_DESC", ""); this->SetOptionIfNotSet("CPACK_NSIS_PAGE_COMPONENTS", ""); - this->SetOptionIfNotSet("CPACK_NSIS_FULL_INSTALL", + this->SetOptionIfNotSet("CPACK_NSIS_FULL_INSTALL", "File /r \"${INST_DIR}\\*.*\""); this->SetOptionIfNotSet("CPACK_NSIS_COMPONENT_SECTIONS", ""); this->SetOptionIfNotSet("CPACK_NSIS_COMPONENT_SECTION_LIST", ""); @@ -194,7 +194,7 @@ int cmCPackNSISGenerator::PackageFiles() // Create installation types. The order is significant, so we first fill // in a vector based on the indices, and print them in that order. - std::vector<cmCPackInstallationType *> + std::vector<cmCPackInstallationType *> installTypes(this->InstallationTypes.size()); std::map<std::string, cmCPackInstallationType>::iterator installTypeIt; for (installTypeIt = this->InstallationTypes.begin(); @@ -221,15 +221,15 @@ int cmCPackNSISGenerator::PackageFiles() { if (groupIt->second.ParentGroup == 0) { - componentCode += + componentCode += this->CreateComponentGroupDescription(&groupIt->second, macrosOut); } // Add the group description, if any. if (!groupIt->second.Description.empty()) { - groupDescriptions += " !insertmacro MUI_DESCRIPTION_TEXT ${" - + groupIt->first + "} \"" + groupDescriptions += " !insertmacro MUI_DESCRIPTION_TEXT ${" + + groupIt->first + "} \"" + this->TranslateNewlines(groupIt->second.Description) + "\"\n"; } } @@ -251,7 +251,7 @@ int cmCPackNSISGenerator::PackageFiles() if (!compIt->second.Group) { - componentCode + componentCode += this->CreateComponentDescription(&compIt->second, macrosOut); } @@ -265,8 +265,8 @@ int cmCPackNSISGenerator::PackageFiles() // Add the component description, if any. if (!compIt->second.Description.empty()) { - componentDescriptions += " !insertmacro MUI_DESCRIPTION_TEXT ${" - + compIt->first + "} \"" + componentDescriptions += " !insertmacro MUI_DESCRIPTION_TEXT ${" + + compIt->first + "} \"" + this->TranslateNewlines(compIt->second.Description) + "\"\n"; } } @@ -276,17 +276,17 @@ int cmCPackNSISGenerator::PackageFiles() if (componentDescriptions.empty() && groupDescriptions.empty()) { // Turn off the "Description" box - this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_COMPONENTS_DESC", + this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_COMPONENTS_DESC", "!define MUI_COMPONENTSPAGE_NODESC"); } else { - componentDescriptions = + componentDescriptions = "!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\n" + componentDescriptions + groupDescriptions + "!insertmacro MUI_FUNCTION_DESCRIPTION_END\n"; - this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_COMPONENTS_DESC", + this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_COMPONENTS_DESC", componentDescriptions.c_str()); } @@ -308,12 +308,12 @@ int cmCPackNSISGenerator::PackageFiles() componentCode.c_str()); this->SetOptionIfNotSet("CPACK_NSIS_COMPONENT_SECTION_LIST", sectionList.c_str()); - this->SetOptionIfNotSet("CPACK_NSIS_SECTION_SELECTED_VARS", + this->SetOptionIfNotSet("CPACK_NSIS_SECTION_SELECTED_VARS", selectedVarsList.c_str()); this->SetOption("CPACK_NSIS_DEFINES", defines.c_str()); } - this->ConfigureFile(nsisInInstallOptions.c_str(), + this->ConfigureFile(nsisInInstallOptions.c_str(), nsisInstallOptions.c_str()); this->ConfigureFile(nsisInFileName.c_str(), nsisFileName.c_str()); std::string nsisCmd = "\""; @@ -445,11 +445,11 @@ int cmCPackNSISGenerator::InitializeInternal() { cmCPackLogger(cmCPackLog::LOG_DEBUG, "CPACK_CREATE_DESKTOP_LINKS: " << cpackPackageDeskTopLinks << std::endl); - + cmSystemTools:: ExpandListArgument(cpackPackageDeskTopLinks, cpackPackageDesktopLinksVector); - for(std::vector<std::string>::iterator i = + for(std::vector<std::string>::iterator i = cpackPackageDesktopLinksVector.begin(); i != cpackPackageDesktopLinksVector.end(); ++i) { @@ -499,7 +499,7 @@ int cmCPackNSISGenerator::InitializeInternal() if(cpackPackageDesktopLinksVector.size() && std::find(cpackPackageDesktopLinksVector.begin(), cpackPackageDesktopLinksVector.end(), - execName) + execName) != cpackPackageDesktopLinksVector.end()) { str << " StrCmp \"$INSTALL_DESKTOP\" \"1\" 0 +2\n"; @@ -579,7 +579,7 @@ void cmCPackNSISGenerator::CreateMenuLinks( cmOStringStream& str, else { str << " WriteINIStr \"$SMPROGRAMS\\$STARTMENU_FOLDER\\" - << linkName << ".url\" \"InternetShortcut\" \"URL\" \"" + << linkName << ".url\" \"InternetShortcut\" \"URL\" \"" << sourceName << "\"" << std::endl; deleteStr << " Delete \"$SMPROGRAMS\\$MUI_TEMP\\" << linkName @@ -651,9 +651,9 @@ bool cmCPackNSISGenerator::SupportsComponentInstallation() const } //---------------------------------------------------------------------- -std::string +std::string cmCPackNSISGenerator:: -CreateComponentDescription(cmCPackComponent *component, +CreateComponentDescription(cmCPackComponent *component, cmOStringStream& macrosOut) { // Basic description of the component @@ -668,7 +668,7 @@ CreateComponentDescription(cmCPackComponent *component, componentCode += "-"; } componentCode += component->DisplayName + "\" " + component->Name + "\n"; - if (component->IsRequired) + if (component->IsRequired) { componentCode += " SectionIn RO\n"; } @@ -701,7 +701,7 @@ CreateComponentDescription(cmCPackComponent *component, } // Create the directory for the upload area - const char* userUploadDirectory = + const char* userUploadDirectory = this->GetOption("CPACK_UPLOAD_DIRECTORY"); std::string uploadDirectory; if (userUploadDirectory && *userUploadDirectory) @@ -727,7 +727,7 @@ CreateComponentDescription(cmCPackComponent *component, // Remove the old archive, if one exists std::string archiveFile = uploadDirectory + '/' + component->ArchiveFile; cmCPackLogger(cmCPackLog::LOG_OUTPUT, - "- Building downloaded component archive: " + "- Building downloaded component archive: " << archiveFile << std::endl); if (cmSystemTools::FileExists(archiveFile.c_str(), true)) { @@ -760,18 +760,18 @@ CreateComponentDescription(cmCPackComponent *component, dirName += component->Name; dirName += '/'; - // Build the list of files to go into this archive, and determine the + // Build the list of files to go into this archive, and determine the // size of the installed component. std::string zipListFileName = this->GetOption("CPACK_TEMPORARY_DIRECTORY"); zipListFileName += "/winZip.filelist"; - bool needQuotesInFile + bool needQuotesInFile = cmSystemTools::IsOn(this->GetOption("CPACK_ZIP_NEED_QUOTES")); unsigned long totalSize = 0; { // the scope is needed for cmGeneratedFileStream cmGeneratedFileStream out(zipListFileName.c_str()); std::vector<std::string>::iterator fileIt; - for (fileIt = component->Files.begin(); - fileIt != component->Files.end(); + for (fileIt = component->Files.begin(); + fileIt != component->Files.end(); ++fileIt) { if ( needQuotesInFile ) @@ -792,11 +792,11 @@ CreateComponentDescription(cmCPackComponent *component, // Build the archive in the upload area std::string cmd = this->GetOption("CPACK_ZIP_COMMAND"); cmsys::SystemTools::ReplaceString(cmd, "<ARCHIVE>", archiveFile.c_str()); - cmsys::SystemTools::ReplaceString(cmd, "<FILELIST>", + cmsys::SystemTools::ReplaceString(cmd, "<FILELIST>", zipListFileName.c_str()); std::string output; int retVal = -1; - int res = cmSystemTools::RunSingleCommand(cmd.c_str(), &output, &retVal, + int res = cmSystemTools::RunSingleCommand(cmd.c_str(), &output, &retVal, dirName.c_str(), cmSystemTools::OUTPUT_NONE, 0); if ( !res || retVal ) @@ -812,7 +812,7 @@ CreateComponentDescription(cmCPackComponent *component, << "Please check " << tmpFile.c_str() << " for errors" << std::endl); return ""; } - + // Create the NSIS code to download this file on-the-fly. unsigned long totalSizeInKbytes = (totalSize + 512) / 1024; if (totalSizeInKbytes == 0) @@ -823,7 +823,7 @@ CreateComponentDescription(cmCPackComponent *component, out << " AddSize " << totalSizeInKbytes << "\n" << " Push \"" << component->ArchiveFile << "\"\n" << " Call DownloadFile\n" - << " ZipDLL::extractall \"$INSTDIR\\" + << " ZipDLL::extractall \"$INSTDIR\\" << component->ArchiveFile << "\" \"$INSTDIR\"\n" << " Pop $2 ; error message\n" " StrCmp $2 \"success\" +2 0\n" @@ -889,7 +889,7 @@ std::string cmCPackNSISGenerator::CreateSelectionDependenciesDescription std::set<cmCPackComponent *>& visited) { // Don't visit a component twice - if (visited.count(component)) + if (visited.count(component)) { return std::string(); } @@ -921,7 +921,7 @@ std::string cmCPackNSISGenerator::CreateDeselectionDependenciesDescription std::set<cmCPackComponent *>& visited) { // Don't visit a component twice - if (visited.count(component)) + if (visited.count(component)) { return std::string(); } @@ -939,7 +939,7 @@ std::string cmCPackNSISGenerator::CreateDeselectionDependenciesDescription out << " IntOp $0 $0 & $1\n"; out << " SectionSetFlags ${" << (*dependIt)->Name << "} $0\n"; out << " IntOp $" << (*dependIt)->Name << "_selected 0 + 0\n"; - + // Recurse out << CreateDeselectionDependenciesDescription(*dependIt, visited).c_str(); @@ -949,9 +949,9 @@ std::string cmCPackNSISGenerator::CreateDeselectionDependenciesDescription } //---------------------------------------------------------------------- -std::string +std::string cmCPackNSISGenerator:: -CreateComponentGroupDescription(cmCPackComponentGroup *group, +CreateComponentGroupDescription(cmCPackComponentGroup *group, cmOStringStream& macrosOut) { if (group->Components.empty() && group->Subgroups.empty()) @@ -982,8 +982,8 @@ CreateComponentGroupDescription(cmCPackComponentGroup *group, } std::vector<cmCPackComponent*>::iterator comp; - for (comp = group->Components.begin(); - comp != group->Components.end(); + for (comp = group->Components.begin(); + comp != group->Components.end(); ++comp) { if ((*comp)->Files.empty()) diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx index 363ccea..76e15fb 100644 --- a/Source/CPack/cmCPackOSXX11Generator.cxx +++ b/Source/CPack/cmCPackOSXX11Generator.cxx @@ -64,7 +64,7 @@ int cmCPackOSXX11Generator::PackageFiles() { std::string cpackExecutableName = *it; ++ it; - this->SetOptionIfNotSet("CPACK_EXECUTABLE_NAME", + this->SetOptionIfNotSet("CPACK_EXECUTABLE_NAME", cpackExecutableName.c_str()); } } @@ -113,7 +113,7 @@ int cmCPackOSXX11Generator::PackageFiles() cmSystemTools::CreateSymlink("/Applications", applicationsLinkName.c_str()); if ( - !this->CopyResourcePlistFile("VolumeIcon.icns", + !this->CopyResourcePlistFile("VolumeIcon.icns", diskImageDirectory.c_str(), ".VolumeIcon.icns", true ) || !this->CopyResourcePlistFile("DS_Store", diskImageDirectory.c_str(), @@ -125,9 +125,9 @@ int cmCPackOSXX11Generator::PackageFiles() "Info.plist" ) || !this->CopyResourcePlistFile("OSXX11.main.scpt", scrDir, "main.scpt", true ) || - !this->CopyResourcePlistFile("OSXScriptLauncher.rsrc", dir, + !this->CopyResourcePlistFile("OSXScriptLauncher.rsrc", dir, rsrcFile, true) || - !this->CopyResourcePlistFile("OSXScriptLauncher", appdir, + !this->CopyResourcePlistFile("OSXScriptLauncher", appdir, this->GetOption("CPACK_PACKAGE_FILE_NAME"), true) ) { @@ -167,11 +167,11 @@ int cmCPackOSXX11Generator::PackageFiles() tmpFile += "/hdiutilOutput.log"; cmOStringStream dmgCmd; dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM_DISK_IMAGE") - << "\" create -ov -format UDZO -srcfolder \"" - << diskImageDirectory.c_str() + << "\" create -ov -format UDZO -srcfolder \"" + << diskImageDirectory.c_str() << "\" \"" << packageFileNames[0] << "\""; cmCPackLogger(cmCPackLog::LOG_VERBOSE, - "Compress disk image using command: " + "Compress disk image using command: " << dmgCmd.str().c_str() << std::endl); // since we get random dashboard failures with this one // try running it more than once @@ -181,7 +181,7 @@ int cmCPackOSXX11Generator::PackageFiles() while(numTries > 0) { res = cmSystemTools::RunSingleCommand(dmgCmd.str().c_str(), &output, - &retVal, 0, + &retVal, 0, this->GeneratorVerbose, 0); if ( res && !retVal ) { @@ -219,7 +219,7 @@ int cmCPackOSXX11Generator::InitializeInternal() << std::endl); return 0; } - this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM_DISK_IMAGE", + this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM_DISK_IMAGE", pkgPath.c_str()); return this->Superclass::InitializeInternal(); @@ -235,7 +235,7 @@ bool cmCPackOSXX11Generator::CopyCreateResourceFile(const char* name) if ( !inFileName ) { cmCPackLogger(cmCPackLog::LOG_ERROR, "CPack option: " << cpackVar.c_str() - << " not specified. It should point to " + << " not specified. It should point to " << (name ? name : "(NULL)") << ".rtf, " << name << ".html, or " << name << ".txt file" << std::endl); @@ -243,7 +243,7 @@ bool cmCPackOSXX11Generator::CopyCreateResourceFile(const char* name) } if ( !cmSystemTools::FileExists(inFileName) ) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find " + cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find " << (name ? name : "(NULL)") << " resource file: " << inFileName << std::endl); return false; @@ -262,7 +262,7 @@ bool cmCPackOSXX11Generator::CopyCreateResourceFile(const char* name) destFileName += name + ext; - cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: " + cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: " << (inFileName ? inFileName : "(NULL)") << " to " << destFileName.c_str() << std::endl); this->ConfigureFile(inFileName, destFileName.c_str()); diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx index 3a0e89b..edbe838 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.cxx +++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx @@ -52,7 +52,7 @@ int cmCPackPackageMakerGenerator::CopyInstallScript(const char* resdir, cmSystemTools::CopyFileAlways(script, dst.c_str()); cmSystemTools::SetPermissions(dst.c_str(),0777); cmCPackLogger(cmCPackLog::LOG_VERBOSE, - "copy script : " << script << "\ninto " << dst.c_str() << + "copy script : " << script << "\ninto " << dst.c_str() << std::endl); return 1; @@ -79,7 +79,7 @@ int cmCPackPackageMakerGenerator::PackageFiles() if ( !cmsys::SystemTools::MakeDirectory(packageDirFileName.c_str())) { cmCPackLogger(cmCPackLog::LOG_ERROR, - "unable to create package directory " + "unable to create package directory " << packageDirFileName << std::endl); return 0; } @@ -89,7 +89,7 @@ int cmCPackPackageMakerGenerator::PackageFiles() if ( !cmsys::SystemTools::MakeDirectory(resDir.c_str())) { cmCPackLogger(cmCPackLog::LOG_ERROR, - "unable to create package subdirectory " << resDir + "unable to create package subdirectory " << resDir << std::endl); return 0; } @@ -98,7 +98,7 @@ int cmCPackPackageMakerGenerator::PackageFiles() if ( !cmsys::SystemTools::MakeDirectory(resDir.c_str())) { cmCPackLogger(cmCPackLog::LOG_ERROR, - "unable to create package subdirectory " << resDir + "unable to create package subdirectory " << resDir << std::endl); return 0; } @@ -135,7 +135,7 @@ int cmCPackPackageMakerGenerator::PackageFiles() return 0; } } - // if preflight, postflight, or postupgrade are set + // if preflight, postflight, or postupgrade are set // then copy them into the resource directory and make // them executable if(preflight) @@ -206,7 +206,7 @@ int cmCPackPackageMakerGenerator::PackageFiles() if (!cmSystemTools::MakeDirectory(uploadDirectory.c_str())) { cmCPackLogger(cmCPackLog::LOG_ERROR, - "Unable to create package upload directory " + "Unable to create package upload directory " << uploadDirectory << std::endl); return 0; } @@ -254,7 +254,7 @@ int cmCPackPackageMakerGenerator::PackageFiles() std::string packageDir = toplevel; packageDir += '/'; packageDir += compIt->first; - if (!this->GenerateComponentPackage(packageFile.c_str(), + if (!this->GenerateComponentPackage(packageFile.c_str(), packageDir.c_str(), compIt->second)) { @@ -293,7 +293,7 @@ int cmCPackPackageMakerGenerator::PackageFiles() } pkgCmd << "\" -r \"" << this->GetOption("CPACK_TOPLEVEL_DIRECTORY") << "/Resources\" -i \"" - << this->GetOption("CPACK_TOPLEVEL_DIRECTORY") + << this->GetOption("CPACK_TOPLEVEL_DIRECTORY") << "/Info.plist\" -d \"" << this->GetOption("CPACK_TOPLEVEL_DIRECTORY") << "/Description.plist\""; @@ -324,7 +324,7 @@ int cmCPackPackageMakerGenerator::PackageFiles() while(numTries > 0) { res = cmSystemTools::RunSingleCommand(dmgCmd.str().c_str(), &output, - &retVal, 0, this->GeneratorVerbose, + &retVal, 0, this->GeneratorVerbose, 0); if ( res && !retVal ) { @@ -474,7 +474,7 @@ int cmCPackPackageMakerGenerator::InitializeInternal() const char *packageCompat = this->GetOption("CPACK_OSX_PACKAGE_VERSION"); if (packageCompat && *packageCompat) { - this->PackageCompatibilityVersion = atof(packageCompat); + this->PackageCompatibilityVersion = atof(packageCompat); } else if (this->GetOption("CPACK_DOWNLOAD_SITE")) { @@ -500,7 +500,7 @@ int cmCPackPackageMakerGenerator::InitializeInternal() << std::endl); return 0; } - this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM_DISK_IMAGE", + this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM_DISK_IMAGE", pkgPath.c_str()); return this->Superclass::InitializeInternal(); @@ -516,7 +516,7 @@ bool cmCPackPackageMakerGenerator::CopyCreateResourceFile(const char* name, if ( !inFileName ) { cmCPackLogger(cmCPackLog::LOG_ERROR, "CPack option: " << cpackVar.c_str() - << " not specified. It should point to " + << " not specified. It should point to " << (name ? name : "(NULL)") << ".rtf, " << name << ".html, or " << name << ".txt file" << std::endl); @@ -524,7 +524,7 @@ bool cmCPackPackageMakerGenerator::CopyCreateResourceFile(const char* name, } if ( !cmSystemTools::FileExists(inFileName) ) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find " + cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find " << (name ? name : "(NULL)") << " resource file: " << inFileName << std::endl); return false; @@ -547,7 +547,7 @@ bool cmCPackPackageMakerGenerator::CopyCreateResourceFile(const char* name, this->SetOption(("CPACK_RESOURCE_FILE_" + uname + "_NOPATH").c_str(), (name + ext).c_str()); - cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: " + cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: " << (inFileName ? inFileName : "(NULL)") << " to " << destFileName.c_str() << std::endl); this->ConfigureFile(inFileName, destFileName.c_str()); @@ -593,7 +593,7 @@ bool cmCPackPackageMakerGenerator::RunPackageMaker(const char *command, cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Execute: " << command << std::endl); std::string output; int retVal = 1; - bool res = cmSystemTools::RunSingleCommand(command, &output, &retVal, 0, + bool res = cmSystemTools::RunSingleCommand(command, &output, &retVal, 0, this->GeneratorVerbose, 0); cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Done running package maker" << std::endl); @@ -612,7 +612,7 @@ bool cmCPackPackageMakerGenerator::RunPackageMaker(const char *command, // sometimes the command finishes but the directory is not yet // created, so try 10 times to see if it shows up int tries = 10; - while(tries > 0 && + while(tries > 0 && !cmSystemTools::FileExists(packageFile)) { cmSystemTools::Delay(500); @@ -632,7 +632,7 @@ bool cmCPackPackageMakerGenerator::RunPackageMaker(const char *command, } //---------------------------------------------------------------------- -std::string +std::string cmCPackPackageMakerGenerator::GetPackageName(const cmCPackComponent& component) { if (component.ArchiveFile.empty()) @@ -664,7 +664,7 @@ GenerateComponentPackage(const char *packageFile, // The command that will be used to run PackageMaker cmOStringStream pkgCmd; - if (this->PackageCompatibilityVersion < 10.5 || + if (this->PackageCompatibilityVersion < 10.5 || this->PackageMakerVersion < 3.0) { // Create Description.plist and Info.plist files for normal Mac OS @@ -680,10 +680,10 @@ GenerateComponentPackage(const char *packageFile, << " <key>IFPkgDescriptionTitle</key>" << std::endl << " <string>" << component.DisplayName << "</string>" << std::endl << " <key>IFPkgDescriptionVersion</key>" << std::endl - << " <string>" << this->GetOption("CPACK_PACKAGE_VERSION") + << " <string>" << this->GetOption("CPACK_PACKAGE_VERSION") << "</string>" << std::endl << " <key>IFPkgDescriptionDescription</key>" << std::endl - << " <string>" + this->EscapeForXML(component.Description) + << " <string>" + this->EscapeForXML(component.Description) << "</string>" << std::endl << "</dict>" << std::endl << "</plist>" << std::endl; @@ -692,7 +692,7 @@ GenerateComponentPackage(const char *packageFile, // Create the Info.plist file for this component std::string moduleVersionSuffix = "."; moduleVersionSuffix += component.Name; - this->SetOption("CPACK_MODULE_VERSION_SUFFIX", + this->SetOption("CPACK_MODULE_VERSION_SUFFIX", moduleVersionSuffix.c_str()); std::string infoFileName = component.Name; infoFileName += "-Info.plist"; @@ -704,9 +704,9 @@ GenerateComponentPackage(const char *packageFile, pkgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM") << "\" -build -p \"" << packageFile << "\"" << " -f \"" << packageDir << "\"" - << " -i \"" << this->GetOption("CPACK_TOPLEVEL_DIRECTORY") + << " -i \"" << this->GetOption("CPACK_TOPLEVEL_DIRECTORY") << "/" << infoFileName << "\"" - << " -d \"" << descriptionFile << "\""; + << " -d \"" << descriptionFile << "\""; } else { @@ -729,16 +729,16 @@ GenerateComponentPackage(const char *packageFile, << " --out \"" << packageFile << "\""; } - // Run PackageMaker + // Run PackageMaker return RunPackageMaker(pkgCmd.str().c_str(), packageFile); } //---------------------------------------------------------------------- -void +void cmCPackPackageMakerGenerator:: WriteDistributionFile(const char* metapackageFile) { - std::string distributionTemplate + std::string distributionTemplate = this->FindTemplate("CPack.distribution.dist.in"); if ( distributionTemplate.empty() ) { @@ -757,8 +757,8 @@ WriteDistributionFile(const char* metapackageFile) // Emit the outline for the groups std::map<std::string, cmCPackComponentGroup>::iterator groupIt; - for (groupIt = this->ComponentGroups.begin(); - groupIt != this->ComponentGroups.end(); + for (groupIt = this->ComponentGroups.begin(); + groupIt != this->ComponentGroups.end(); ++groupIt) { if (groupIt->second.ParentGroup == 0) @@ -781,8 +781,8 @@ WriteDistributionFile(const char* metapackageFile) choiceOut << "</choices-outline>" << std::endl; // Create the actual choices - for (groupIt = this->ComponentGroups.begin(); - groupIt != this->ComponentGroups.end(); + for (groupIt = this->ComponentGroups.begin(); + groupIt != this->ComponentGroups.end(); ++groupIt) { CreateChoice(groupIt->second, choiceOut); @@ -796,7 +796,7 @@ WriteDistributionFile(const char* metapackageFile) // Create the distribution.dist file in the metapackage to turn it // into a distribution package. - this->ConfigureFile(distributionTemplate.c_str(), + this->ConfigureFile(distributionTemplate.c_str(), distributionFile.c_str()); } @@ -824,13 +824,13 @@ CreateChoiceOutline(const cmCPackComponentGroup& group, cmOStringStream& out) } //---------------------------------------------------------------------- -void +void cmCPackPackageMakerGenerator::CreateChoice(const cmCPackComponentGroup& group, cmOStringStream& out) { - out << "<choice id=\"" << group.Name << "Choice\" " + out << "<choice id=\"" << group.Name << "Choice\" " << "title=\"" << group.DisplayName << "\" " - << "start_selected=\"true\" " + << "start_selected=\"true\" " << "start_enabled=\"true\" " << "start_visible=\"true\" "; if (!group.Description.empty()) @@ -842,21 +842,21 @@ cmCPackPackageMakerGenerator::CreateChoice(const cmCPackComponentGroup& group, } //---------------------------------------------------------------------- -void +void cmCPackPackageMakerGenerator::CreateChoice(const cmCPackComponent& component, cmOStringStream& out) { std::string packageId = "com."; packageId += this->GetOption("CPACK_PACKAGE_VENDOR"); - packageId += '.'; + packageId += '.'; packageId += this->GetOption("CPACK_PACKAGE_NAME"); packageId += '.'; packageId += component.Name; - out << "<choice id=\"" << component.Name << "Choice\" " + out << "<choice id=\"" << component.Name << "Choice\" " << "title=\"" << component.DisplayName << "\" " - << "start_selected=\"" - << (component.IsDisabledByDefault && + << "start_selected=\"" + << (component.IsDisabledByDefault && !component.IsRequired? "false" : "true") << "\" " << "start_enabled=\"" @@ -905,7 +905,7 @@ cmCPackPackageMakerGenerator::CreateChoice(const cmCPackComponent& component, std::string dirName = this->GetOption("CPACK_TEMPORARY_DIRECTORY"); dirName += '/'; dirName += component.Name; - unsigned long installedSize + unsigned long installedSize = component.GetInstalledSizeInKbytes(dirName.c_str()); out << "<pkg-ref id=\"" << packageId << "\" " @@ -914,7 +914,7 @@ cmCPackPackageMakerGenerator::CreateChoice(const cmCPackComponent& component, << "auth=\"Admin\" onConclusion=\"None\">"; if (component.IsDownloaded) { - out << this->GetOption("CPACK_DOWNLOAD_SITE") + out << this->GetOption("CPACK_DOWNLOAD_SITE") << this->GetPackageName(component); } else @@ -925,9 +925,9 @@ cmCPackPackageMakerGenerator::CreateChoice(const cmCPackComponent& component, } //---------------------------------------------------------------------- -void +void cmCPackPackageMakerGenerator:: -AddDependencyAttributes(const cmCPackComponent& component, +AddDependencyAttributes(const cmCPackComponent& component, std::set<const cmCPackComponent *>& visited, cmOStringStream& out) { @@ -942,16 +942,16 @@ AddDependencyAttributes(const cmCPackComponent& component, dependIt != component.Dependencies.end(); ++dependIt) { - out << " && choices['" << + out << " && choices['" << (*dependIt)->Name << "Choice'].selected"; AddDependencyAttributes(**dependIt, visited, out); } } //---------------------------------------------------------------------- -void +void cmCPackPackageMakerGenerator:: -AddReverseDependencyAttributes(const cmCPackComponent& component, +AddReverseDependencyAttributes(const cmCPackComponent& component, std::set<const cmCPackComponent *>& visited, cmOStringStream& out) { diff --git a/Source/CPack/cmCPackPackageMakerGenerator.h b/Source/CPack/cmCPackPackageMakerGenerator.h index 2bab947..101813f 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.h +++ b/Source/CPack/cmCPackPackageMakerGenerator.h @@ -67,8 +67,8 @@ protected: // Generate a package in the file packageFile for the given // component. All of the files within this component are stored in // the directory packageDir. Returns true if successful, false - // otherwise. - bool GenerateComponentPackage(const char *packageFile, + // otherwise. + bool GenerateComponentPackage(const char *packageFile, const char *packageDir, const cmCPackComponent& component); @@ -87,14 +87,14 @@ protected: // Subroutine of WriteDistributionFile that writes out the // reverse dependency attributes for inter-component dependencies. - void + void AddReverseDependencyAttributes(const cmCPackComponent& component, std::set<const cmCPackComponent *>& visited, cmOStringStream& out); // Generates XML that encodes the hierarchy of component groups and // their components in a form that can be used by distribution - // metapackages. + // metapackages. void CreateChoiceOutline(const cmCPackComponentGroup& group, cmOStringStream& out); @@ -111,7 +111,7 @@ protected: // Escape the given string to make it usable as an XML attribute // value. std::string EscapeForXML(std::string str); - + double PackageMakerVersion; double PackageCompatibilityVersion; }; diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx index 413572e..13aa6d8 100644 --- a/Source/CPack/cmCPackRPMGenerator.cxx +++ b/Source/CPack/cmCPackRPMGenerator.cxx @@ -230,7 +230,7 @@ int cmCPackRPMGenerator::PackageFiles() } } - if (!this->IsSet("RPMBUILD_EXECUTABLE")) + if (!this->IsSet("RPMBUILD_EXECUTABLE")) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find rpmbuild" << std::endl); retval = 0; diff --git a/Source/CPack/cmCPackSTGZGenerator.cxx b/Source/CPack/cmCPackSTGZGenerator.cxx index 966a231..9b6cf14 100644 --- a/Source/CPack/cmCPackSTGZGenerator.cxx +++ b/Source/CPack/cmCPackSTGZGenerator.cxx @@ -97,7 +97,7 @@ int cmCPackSTGZGenerator::GenerateHeader(std::ostream* os) { licenseText += line + "\n"; } - this->SetOptionIfNotSet("CPACK_RESOURCE_FILE_LICENSE_CONTENT", + this->SetOptionIfNotSet("CPACK_RESOURCE_FILE_LICENSE_CONTENT", licenseText.c_str()); const char headerLengthTag[] = "###CPACK_HEADER_LENGTH###"; @@ -126,7 +126,7 @@ int cmCPackSTGZGenerator::GenerateHeader(std::ostream* os) ++ptr; } counter ++; - cmCPackLogger(cmCPackLog::LOG_DEBUG, + cmCPackLogger(cmCPackLog::LOG_DEBUG, "Number of lines: " << counter << std::endl); char buffer[1024]; sprintf(buffer, "%d", counter); diff --git a/Source/CPack/cmCPackTarBZip2Generator.cxx b/Source/CPack/cmCPackTarBZip2Generator.cxx index 971d166..ae73c37 100644 --- a/Source/CPack/cmCPackTarBZip2Generator.cxx +++ b/Source/CPack/cmCPackTarBZip2Generator.cxx @@ -12,7 +12,7 @@ #include "cmCPackTarBZip2Generator.h" //---------------------------------------------------------------------- -cmCPackTarBZip2Generator::cmCPackTarBZip2Generator() +cmCPackTarBZip2Generator::cmCPackTarBZip2Generator() :cmCPackArchiveGenerator(cmArchiveWrite::CompressBZip2, cmArchiveWrite::TypeTAR) { diff --git a/Source/CPack/cmCPackTarCompressGenerator.cxx b/Source/CPack/cmCPackTarCompressGenerator.cxx index 7a8f697..df29408 100644 --- a/Source/CPack/cmCPackTarCompressGenerator.cxx +++ b/Source/CPack/cmCPackTarCompressGenerator.cxx @@ -13,7 +13,7 @@ #include "cmCPackTarCompressGenerator.h" //---------------------------------------------------------------------- -cmCPackTarCompressGenerator::cmCPackTarCompressGenerator() +cmCPackTarCompressGenerator::cmCPackTarCompressGenerator() :cmCPackArchiveGenerator(cmArchiveWrite::CompressCompress, cmArchiveWrite::TypeTAR) { diff --git a/Source/CPack/cygwin.readme b/Source/CPack/cygwin.readme index 88922d3..c0cd4b9 100644 --- a/Source/CPack/cygwin.readme +++ b/Source/CPack/cygwin.readme @@ -16,11 +16,11 @@ Source- - write diff into toplevel - create tar file call super class -cmake-2.2.3-1 +cmake-2.2.3-1 + - 1. a source release -cmake-2.2.3-2-src.tar.bz2 +cmake-2.2.3-2-src.tar.bz2 cmake-2.2.3-2.patch has cmake-2.2.3/CYGWIN-PATCHES/cmake.README cmake-2.2.3/CYGWIN-PATCHES/setup.hint cmake-2.2.3-2.sh -> script to create cygwin release diff --git a/Source/CTest/cmCTestBatchTestHandler.cxx b/Source/CTest/cmCTestBatchTestHandler.cxx index 00bb6fa..a22c7be 100644 --- a/Source/CTest/cmCTestBatchTestHandler.cxx +++ b/Source/CTest/cmCTestBatchTestHandler.cxx @@ -56,7 +56,7 @@ void cmCTestBatchTestHandler::WriteSrunArgs(int test, std::fstream& fout) fout << "srun "; //fout << "--jobid=" << test << " "; fout << "-J=" << properties->Name << " "; - + //Write dependency information /*if(this->Tests[test].size() > 0) { diff --git a/Source/CTest/cmCTestBatchTestHandler.h b/Source/CTest/cmCTestBatchTestHandler.h index fdfd1be..ab0d081 100644 --- a/Source/CTest/cmCTestBatchTestHandler.h +++ b/Source/CTest/cmCTestBatchTestHandler.h @@ -21,7 +21,7 @@ /** \class cmCTestBatchTestHandler * \brief run parallel ctest * - * cmCTestBatchTestHandler + * cmCTestBatchTestHandler */ class cmCTestBatchTestHandler : public cmCTestMultiProcessHandler { diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index 8a2d65a..554efb5 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -67,7 +67,7 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring, generator += this->BuildGenerator; args.push_back(generator); } - + const char* config = 0; if ( this->CTest->GetConfigType().size() > 0 ) { @@ -79,7 +79,7 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring, config = CMAKE_INTDIR; } #endif - + if ( config ) { std::string btype @@ -198,8 +198,8 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) std::string resultingConfig; std::vector<std::string> extraPaths; std::vector<std::string> failed; - fullPath = - cmCTestTestHandler::FindExecutable(this->CTest, + fullPath = + cmCTestTestHandler::FindExecutable(this->CTest, this->ConfigSample.c_str(), resultingConfig, extraPaths, @@ -211,7 +211,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) out << "Using config sample with results: " << fullPath << " and " << resultingConfig << std::endl; } - + // we need to honor the timeout specified, the timeout include cmake, build // and test time double clock_start = cmSystemTools::GetTime(); @@ -228,7 +228,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) // should we cmake? cmake cm; - cm.SetProgressCallback(CMakeProgressCallback, &cmakeOutString); + cm.SetProgressCallback(CMakeProgressCallback, &cmakeOutString); cm.SetGlobalGenerator(cm.CreateGlobalGenerator( this->BuildGenerator.c_str())); @@ -247,7 +247,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) { this->BuildTargets.push_back(""); } - for ( tarIt = this->BuildTargets.begin(); + for ( tarIt = this->BuildTargets.begin(); tarIt != this->BuildTargets.end(); ++ tarIt ) { double remainingTime = 0; @@ -284,7 +284,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) this->BuildProject.c_str(), tarIt->c_str(), &output, this->BuildMakeProgram.c_str(), config, - !this->BuildNoClean, + !this->BuildNoClean, false, remainingTime); out << output; // if the build failed then return @@ -322,13 +322,13 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) extraPaths.push_back(tempPath); } std::vector<std::string> failed; - fullPath = - cmCTestTestHandler::FindExecutable(this->CTest, + fullPath = + cmCTestTestHandler::FindExecutable(this->CTest, this->TestCommand.c_str(), resultingConfig, extraPaths, failed); - + if(!cmSystemTools::FileExists(fullPath.c_str())) { out << "Could not find path to executable, perhaps it was not built: " @@ -388,8 +388,8 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) return 1; } } - - int runTestRes = this->CTest->RunTest(testCommand, &outs, &retval, 0, + + int runTestRes = this->CTest->RunTest(testCommand, &outs, &retval, 0, remainingTime, 0); if(runTestRes != cmsysProcess_State_Exited || retval != 0) diff --git a/Source/CTest/cmCTestBuildAndTestHandler.h b/Source/CTest/cmCTestBuildAndTestHandler.h index 6e5f7a6..9029600 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.h +++ b/Source/CTest/cmCTestBuildAndTestHandler.h @@ -42,7 +42,7 @@ public: * Get the output variable */ const char* GetOutput(); - + cmCTestBuildAndTestHandler(); virtual void Initialize(); @@ -50,10 +50,10 @@ public: protected: ///! Run CMake and build a test and then run it as a single test. int RunCMakeAndTest(std::string* output); - int RunCMake(std::string* outstring, cmOStringStream &out, + int RunCMake(std::string* outstring, cmOStringStream &out, std::string &cmakeOutString, std::string &cwd, cmake *cm); - + cmStdString Output; std::string BuildGenerator; diff --git a/Source/CTest/cmCTestBuildCommand.cxx b/Source/CTest/cmCTestBuildCommand.cxx index b984e85..f4d38ce 100644 --- a/Source/CTest/cmCTestBuildCommand.cxx +++ b/Source/CTest/cmCTestBuildCommand.cxx @@ -175,7 +175,7 @@ bool cmCTestBuildCommand::InitialPass(std::vector<std::string> const& args, { bool ret = cmCTestHandlerCommand::InitialPass(args, status); if ( this->Values[ctb_NUMBER_ERRORS] && *this->Values[ctb_NUMBER_ERRORS]) - { + { cmOStringStream str; str << this->Handler->GetTotalErrors(); this->Makefile->AddDefinition( diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index 27bb06c..39eeb70 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -168,7 +168,7 @@ static cmCTestBuildCompileErrorWarningRex cmCTestWarningErrorFileLine[] = { { "^Warning W[0-9]+ ([a-zA-Z.\\:/0-9_+ ~-]+) ([0-9]+):", 1, 2 }, { "^([a-zA-Z./0-9_+ ~-]+):([0-9]+):", 1, 2 }, - { "^([a-zA-Z.\\:/0-9_+ ~-]+)\\(([0-9]+)\\)", 1, 2 }, + { "^([a-zA-Z.\\:/0-9_+ ~-]+)\\(([0-9]+)\\)", 1, 2 }, { "^[0-9]+>([a-zA-Z.\\:/0-9_+ ~-]+)\\(([0-9]+)\\)", 1, 2 }, { "^([a-zA-Z./0-9_+ ~-]+)\\(([0-9]+)\\)", 1, 2 }, { "\"([a-zA-Z./0-9_+ ~-]+)\", line ([0-9]+)", 1, 2 }, @@ -289,7 +289,7 @@ std::string cmCTestBuildHandler::GetMakeCommand() std::string makeCommand = this->CTest->GetCTestConfiguration("MakeCommand"); cmCTestLog(this->CTest, - HANDLER_VERBOSE_OUTPUT, "MakeCommand:" << makeCommand << + HANDLER_VERBOSE_OUTPUT, "MakeCommand:" << makeCommand << "\n"); std::string configType = this->CTest->GetConfigType(); @@ -392,7 +392,7 @@ int cmCTestBuildHandler::ProcessHandler() { this->CustomWarningMatches.push_back(cmCTestWarningMatches[cc]); } - + for ( cc = 0; cmCTestWarningExceptions[cc]; cc ++ ) { this->CustomWarningExceptions.push_back(cmCTestWarningExceptions[cc]); @@ -557,7 +557,7 @@ void cmCTestBuildHandler::GenerateXMLHeader(std::ostream& os) this->CTest->StartXML(os, this->AppendXML); os << "<Build>\n" << "\t<StartDateTime>" << this->StartBuild << "</StartDateTime>\n" - << "\t<StartBuildTime>" << + << "\t<StartBuildTime>" << static_cast<unsigned int>(this->StartBuildTime) << "</StartBuildTime>\n" << "<BuildCommand>" @@ -998,7 +998,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, // dashboard. cmCTestBuildErrorWarning errorwarning; errorwarning.LogLine = 1; - errorwarning.Text + errorwarning.Text = "*** WARNING non-zero return value in ctest from: "; errorwarning.Text += argv[0]; errorwarning.PreContext = ""; @@ -1150,7 +1150,7 @@ void cmCTestBuildHandler::ProcessBuffer(const char* data, int length, { // This is not an error or warning. // So, figure out if this is a post-context line - if ( this->ErrorsAndWarnings.size() && + if ( this->ErrorsAndWarnings.size() && this->LastErrorOrWarning != this->ErrorsAndWarnings.end() && this->PostContextCount < this->MaxPostContext ) { diff --git a/Source/CTest/cmCTestConfigureHandler.cxx b/Source/CTest/cmCTestConfigureHandler.cxx index 3329756..7c41298 100644 --- a/Source/CTest/cmCTestConfigureHandler.cxx +++ b/Source/CTest/cmCTestConfigureHandler.cxx @@ -106,7 +106,7 @@ int cmCTestConfigureHandler::ProcessHandler() std::string end_time = this->CTest->CurrentTime(); os << "\t<ConfigureStatus>" << retVal << "</ConfigureStatus>\n" << "\t<EndDateTime>" << end_time << "</EndDateTime>\n" - << "\t<EndConfigureTime>" << + << "\t<EndConfigureTime>" << static_cast<unsigned int>(cmSystemTools::GetTime()) << "</EndConfigureTime>\n" << "<ElapsedMinutes>" diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index 81d3669..4d1e249 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -80,15 +80,15 @@ public: { args.push_back(i->c_str()); } - args.push_back(0); // null terminate + args.push_back(0); // null terminate cmsysProcess_SetCommand(this->Process, &*args.begin()); if(this->WorkingDirectory.size()) { cmsysProcess_SetWorkingDirectory(this->Process, this->WorkingDirectory.c_str()); } - - cmsysProcess_SetOption(this->Process, + + cmsysProcess_SetOption(this->Process, cmsysProcess_Option_HideWindow, 1); if(this->TimeOut != -1) { @@ -112,7 +112,7 @@ public: { cmsysProcess_SetPipeFile(this->Process, cmsysProcess_Pipe_STDERR, fname); } - int WaitForExit(double* timeout =0) + int WaitForExit(double* timeout =0) { this->PipeState = cmsysProcess_WaitForExit(this->Process, timeout); @@ -183,7 +183,7 @@ bool cmCTestCoverageHandler::StartCoverageLogFile( this->CTest->StartXML(covLogFile, this->AppendXML); covLogFile << "<CoverageLog>" << std::endl << "\t<StartDateTime>" << local_start_time << "</StartDateTime>" - << "\t<StartTime>" + << "\t<StartTime>" << static_cast<unsigned int>(cmSystemTools::GetTime()) << "</StartTime>" << std::endl; @@ -196,7 +196,7 @@ void cmCTestCoverageHandler::EndCoverageLogFile(cmGeneratedFileStream& ostr, { std::string local_end_time = this->CTest->CurrentTime(); ostr << "\t<EndDateTime>" << local_end_time << "</EndDateTime>" << std::endl - << "\t<EndTime>" << + << "\t<EndTime>" << static_cast<unsigned int>(cmSystemTools::GetTime()) << "</EndTime>" << std::endl << "</CoverageLog>" << std::endl; @@ -325,7 +325,7 @@ int cmCTestCoverageHandler::ProcessHandler() { return error; } - + std::string coverage_start_time = this->CTest->CurrentTime(); unsigned int coverage_start_time_time = static_cast<unsigned int>( cmSystemTools::GetTime()); @@ -659,7 +659,7 @@ int cmCTestCoverageHandler::ProcessHandler() covSumFile.precision(2); covSumFile << (percent_coverage)<< "</PercentCoverage>\n" << "\t<EndDateTime>" << end_time << "</EndDateTime>\n" - << "\t<EndTime>" << + << "\t<EndTime>" << static_cast<unsigned int>(cmSystemTools::GetTime()) << "</EndTime>\n"; covSumFile << "<ElapsedMinutes>" << @@ -871,7 +871,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage( cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Cannot find any GCov coverage files." << std::endl); - // No coverage files is a valid thing, so the exit code is 0 + // No coverage files is a valid thing, so the exit code is 0 return 0; } @@ -1294,7 +1294,7 @@ int cmCTestCoverageHandler::HandleTracePyCoverage( cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Cannot find any Python Trace.py coverage files." << std::endl); - // No coverage files is a valid thing, so the exit code is 0 + // No coverage files is a valid thing, so the exit code is 0 return 0; } @@ -1436,7 +1436,7 @@ std::string cmCTestCoverageHandler::FindFile( // This is a header put on each marked up source file namespace { - const char* bullseyeHelp[] = + const char* bullseyeHelp[] = {" Coverage produced by bullseye covbr tool: ", " www.bullseye.com/help/ref_covbr.html", " * An arrow --> indicates incomplete coverage.", @@ -1451,7 +1451,7 @@ namespace " * The slash / means this probe is excluded from summary results. ", 0}; } - + //---------------------------------------------------------------------- int cmCTestCoverageHandler::RunBullseyeCoverageBranch( cmCTestCoverageHandlerContainer* cont, @@ -1461,7 +1461,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch( { if(files.size() != filesFullPath.size()) { - cmCTestLog(this->CTest, ERROR_MESSAGE, + cmCTestLog(this->CTest, ERROR_MESSAGE, "Files and full path files not the same size?:\n"); return 0; } @@ -1498,13 +1498,13 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch( } std::map<cmStdString, cmStdString> fileMap; std::vector<std::string>::iterator fp = filesFullPath.begin(); - for(std::vector<std::string>::iterator f = files.begin(); + for(std::vector<std::string>::iterator f = files.begin(); f != files.end(); ++f, ++fp) { fileMap[*f] = *fp; } - int count =0; // keep count of the number of files + int count =0; // keep count of the number of files // Now parse each line from the bullseye cov log file std::string lineIn; bool valid = false; // are we in a valid output file @@ -1542,9 +1542,9 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch( { return -1; } - count++; // move on one + count++; // move on one } - std::map<cmStdString, cmStdString>::iterator + std::map<cmStdString, cmStdString>::iterator i = fileMap.find(file); // if the file should be covered write out the header for that file if(i != fileMap.end()) @@ -1659,10 +1659,10 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary( cmCTestLog(this->CTest, ERROR_MESSAGE, "error running covsrc:\n"); return 0; } - + std::ostream& tmpLog = *cont->OFS; // copen the Coverage.xml file in the Testing directory - cmGeneratedFileStream covSumFile; + cmGeneratedFileStream covSumFile; if(!this->StartResultingXML(cmCTest::PartCoverage, "Coverage", covSumFile)) { cmCTestLog(this->CTest, ERROR_MESSAGE, @@ -1673,10 +1673,10 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary( double elapsed_time_start = cmSystemTools::GetTime(); std::string coverage_start_time = this->CTest->CurrentTime(); covSumFile << "<Coverage>" << std::endl - << "\t<StartDateTime>" + << "\t<StartDateTime>" << coverage_start_time << "</StartDateTime>" << std::endl - << "\t<StartTime>" + << "\t<StartTime>" << static_cast<unsigned int>(cmSystemTools::GetTime()) << "</StartTime>" << std::endl; @@ -1717,7 +1717,7 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary( { // parse the comma separated output this->ParseBullsEyeCovsrcLine(stdline, - sourceFile, + sourceFile, functionsCalled, totalFunctions, percentFunction, @@ -1741,7 +1741,7 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary( file = cmSystemTools::CollapseFullPath(file.c_str()); bool shouldIDoCoverage = this->ShouldIDoCoverage(file.c_str(), - cont->SourceDir.c_str(), + cont->SourceDir.c_str(), cont->BinaryDir.c_str()); if ( !shouldIDoCoverage ) { @@ -1797,20 +1797,20 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary( << "\t\t<BranchesTested>" << branchCovered << "</BranchesTested>\n" - << "\t\t<BranchesUnTested>" + << "\t\t<BranchesUnTested>" << totalBranches - branchCovered << "</BranchesUnTested>\n" << "\t\t<FunctionsTested>" << functionsCalled << "</FunctionsTested>\n" - << "\t\t<FunctionsUnTested>" + << "\t\t<FunctionsUnTested>" << totalFunctions - functionsCalled << "</FunctionsUnTested>\n" // Hack for conversion of function to loc assume a function // has 100 lines of code << "\t\t<LOCTested>" << functionsCalled *100 << "</LOCTested>\n" - << "\t\t<LOCUnTested>" + << "\t\t<LOCUnTested>" << (totalFunctions - functionsCalled)*100 << "</LOCUnTested>\n" << "\t\t<PercentCoverage>"; @@ -1832,12 +1832,12 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary( << "\t<PercentCoverage>"; covSumFile.setf(std::ios::fixed, std::ios::floatfield); covSumFile.precision(2); - covSumFile + covSumFile << SAFEDIV(percent_coverage,number_files)<< "</PercentCoverage>\n" << "\t<EndDateTime>" << end_time << "</EndDateTime>\n" << "\t<EndTime>" << static_cast<unsigned int>(cmSystemTools::GetTime()) << "</EndTime>\n"; - covSumFile + covSumFile << "<ElapsedMinutes>" << static_cast<int>((cmSystemTools::GetTime() - elapsed_time_start)/6)/10.0 << "</ElapsedMinutes>" @@ -1858,22 +1858,22 @@ int cmCTestCoverageHandler::HandleBullseyeCoverage( const char* covfile = cmSystemTools::GetEnv("COVFILE"); if(!covfile || strlen(covfile) == 0) { - cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, - " COVFILE environment variable not found, not running " + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + " COVFILE environment variable not found, not running " " bullseye\n"); return 0; } - cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, - " run covsrc with COVFILE=[" + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + " run covsrc with COVFILE=[" << covfile << "]" << std::endl); if(!this->RunBullseyeSourceSummary(cont)) - { - cmCTestLog(this->CTest, ERROR_MESSAGE, + { + cmCTestLog(this->CTest, ERROR_MESSAGE, "Error running bullseye summary.\n"); return 0; } - cmCTestLog(this->CTest, DEBUG, "HandleBullseyeCoverage return 1 " + cmCTestLog(this->CTest, DEBUG, "HandleBullseyeCoverage return 1 " << std::endl); return 1; } @@ -1881,7 +1881,7 @@ int cmCTestCoverageHandler::HandleBullseyeCoverage( bool cmCTestCoverageHandler::GetNextInt(std::string const& inputLine, std::string::size_type& pos, int& value) -{ +{ std::string::size_type start = pos; pos = inputLine.find(',', start); value = atoi(inputLine.substr(start, pos).c_str()); @@ -1892,7 +1892,7 @@ bool cmCTestCoverageHandler::GetNextInt(std::string const& inputLine, pos++; return true; } - + bool cmCTestCoverageHandler::ParseBullsEyeCovsrcLine( std::string const& inputLine, std::string& sourceFile, @@ -1906,7 +1906,7 @@ bool cmCTestCoverageHandler::ParseBullsEyeCovsrcLine( // find the first comma std::string::size_type pos = inputLine.find(','); if(pos == inputLine.npos) - { + { cmCTestLog(this->CTest, ERROR_MESSAGE, "Error parsing string : " << inputLine.c_str() << "\n"); return false; @@ -1942,7 +1942,7 @@ bool cmCTestCoverageHandler::ParseBullsEyeCovsrcLine( if(pos != inputLine.npos) { cmCTestLog(this->CTest, ERROR_MESSAGE, "Error parsing input : " - << inputLine.c_str() << " last pos not npos = " << pos << + << inputLine.c_str() << " last pos not npos = " << pos << "\n"); } return true; diff --git a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx index 56312c0..abc33de 100644 --- a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx +++ b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx @@ -28,8 +28,8 @@ bool cmCTestEmptyBinaryDirectoryCommand ostr << "problem removing the binary directory: " << args[0].c_str(); this->SetError(ostr.str().c_str()); return false; - } - + } + return true; } diff --git a/Source/CTest/cmCTestGenericHandler.cxx b/Source/CTest/cmCTestGenericHandler.cxx index fd75e45..5338f30 100644 --- a/Source/CTest/cmCTestGenericHandler.cxx +++ b/Source/CTest/cmCTestGenericHandler.cxx @@ -51,7 +51,7 @@ void cmCTestGenericHandler::SetOption(const char* op, const char* value) } //---------------------------------------------------------------------- -void cmCTestGenericHandler::SetPersistentOption(const char* op, +void cmCTestGenericHandler::SetPersistentOption(const char* op, const char* value) { this->SetOption(op, value); @@ -79,7 +79,7 @@ void cmCTestGenericHandler::Initialize() this->AppendXML = false; this->Options.clear(); t_StringToString::iterator it; - for ( it = this->PersistentOptions.begin(); + for ( it = this->PersistentOptions.begin(); it != this->PersistentOptions.end(); ++ it ) { @@ -117,7 +117,7 @@ bool cmCTestGenericHandler::StartResultingXML(cmCTest::Part part, { ostr << "_" << this->SubmitIndex; } - ostr << ".xml"; + ostr << ".xml"; if(this->CTest->GetCurrentTag().empty()) { cmCTestLog(this->CTest, ERROR_MESSAGE, diff --git a/Source/CTest/cmCTestGenericHandler.h b/Source/CTest/cmCTestGenericHandler.h index 18189ec..ba8febb 100644 --- a/Source/CTest/cmCTestGenericHandler.h +++ b/Source/CTest/cmCTestGenericHandler.h @@ -73,7 +73,7 @@ public: typedef std::map<cmStdString,cmStdString> t_StringToString; - + void SetPersistentOption(const char* op, const char* value); void SetOption(const char* op, const char* value); const char* GetOption(const char* op); diff --git a/Source/CTest/cmCTestHandlerCommand.cxx b/Source/CTest/cmCTestHandlerCommand.cxx index 1957e04..0da8aae 100644 --- a/Source/CTest/cmCTestHandlerCommand.cxx +++ b/Source/CTest/cmCTestHandlerCommand.cxx @@ -91,7 +91,7 @@ bool cmCTestHandlerCommand } else { - const char* bdir = + const char* bdir = this->Makefile->GetSafeDefinition("CTEST_BINARY_DIRECTORY"); if(bdir) { diff --git a/Source/CTest/cmCTestMemCheckCommand.h b/Source/CTest/cmCTestMemCheckCommand.h index 399fe8b..6db47ae 100644 --- a/Source/CTest/cmCTestMemCheckCommand.h +++ b/Source/CTest/cmCTestMemCheckCommand.h @@ -60,7 +60,7 @@ public: " ctest_memcheck([BUILD build_dir] [RETURN_VALUE res] [APPEND]\n" " [START start number] [END end number]\n" " [STRIDE stride number] [EXCLUDE exclude regex ]\n" - " [INCLUDE include regex] \n" + " [INCLUDE include regex] \n" " [EXCLUDE_LABEL exclude regex] \n" " [INCLUDE_LABEL label regex] \n" " [PARALLEL_LEVEL level] )\n" diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index 3e4ecdd..a2a16d3 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -84,7 +84,7 @@ public: } const char* GetAttribute(const char* name, const char** atts) - { + { int i = 0; for(; atts[i] != 0; ++i) { @@ -117,9 +117,9 @@ public: } if(ptr->ErrorCategory) { - this->Errors.push_back(cmCTestMemCheckHandler::ABW); // do not know + this->Errors.push_back(cmCTestMemCheckHandler::ABW); // do not know cmCTestLog(this->CTest, ERROR_MESSAGE, - "Found unknown Bounds Checker error " + "Found unknown Bounds Checker error " << ptr->ErrorCategory << std::endl); } } @@ -528,7 +528,7 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking() this->MemoryTesterOptions.push_back(outputFile); } else if ( this->MemoryTester.find("BC") != std::string::npos ) - { + { this->BoundsCheckerXMLFile = this->MemoryTesterOutputFile; std::string dpbdFile = this->CTest->GetBinaryDir() + "/Testing/Temporary/MemoryChecker.DPbd"; @@ -594,9 +594,9 @@ bool cmCTestMemCheckHandler::ProcessMemCheckOutput(const std::string& str, bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput( const std::string& str, std::string& log, int* results) -{ +{ std::vector<cmStdString> lines; - cmSystemTools::Split(str.c_str(), lines); + cmSystemTools::Split(str.c_str(), lines); cmOStringStream ostr; log = ""; @@ -604,7 +604,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput( int defects = 0; - for( std::vector<cmStdString>::iterator i = lines.begin(); + for( std::vector<cmStdString>::iterator i = lines.begin(); i != lines.end(); ++i) { int failure = cmCTestMemCheckHandler::NO_MEMORY_FAULT; @@ -657,7 +657,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput( { unlimitedOutput = true; } - + std::string::size_type cc; cmOStringStream ostr; @@ -782,7 +782,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput( } totalOutputSize += lines[cc].size(); ostr << cmXMLSafe(lines[cc]) << std::endl; - } + } else { nonValGrindOutput.push_back(cc); @@ -791,7 +791,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput( // Now put all all the non valgrind output into the test output if(!outputFull) { - for(std::vector<std::string::size_type>::iterator i = + for(std::vector<std::string::size_type>::iterator i = nonValGrindOutput.begin(); i != nonValGrindOutput.end(); ++i) { totalOutputSize += lines[*i].size(); @@ -801,7 +801,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput( << cmXMLSafe(lines[*i]) << std::endl); ostr << cmXMLSafe(lines[*i]) << std::endl; - if(!unlimitedOutput && totalOutputSize > + if(!unlimitedOutput && totalOutputSize > static_cast<size_t>(this->CustomMaximumFailedTestOutputSize)) { outputFull = true; @@ -833,7 +833,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckBoundsCheckerOutput( log = ""; double sttime = cmSystemTools::GetTime(); std::vector<cmStdString> lines; - cmSystemTools::Split(str.c_str(), lines); + cmSystemTools::Split(str.c_str(), lines); cmCTestLog(this->CTest, DEBUG, "Start test: " << lines.size() << std::endl); std::vector<cmStdString>::size_type cc; for ( cc = 0; cc < lines.size(); cc ++ ) @@ -886,8 +886,8 @@ bool cmCTestMemCheckHandler::ProcessMemCheckBoundsCheckerOutput( // for the test void cmCTestMemCheckHandler::PostProcessBoundsCheckerTest(cmCTestTestResult& res) -{ - cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, +{ + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "PostProcessBoundsCheckerTest for : " << res.Name.c_str() << std::endl); if ( !cmSystemTools::FileExists(this->MemoryTesterOutputFile.c_str()) ) @@ -902,22 +902,22 @@ cmCTestMemCheckHandler::PostProcessBoundsCheckerTest(cmCTestTestResult& res) std::ifstream ifs(this->MemoryTesterOutputFile.c_str()); if ( !ifs ) { - std::string log = "Cannot read memory tester output file: " + std::string log = "Cannot read memory tester output file: " + this->MemoryTesterOutputFile; cmCTestLog(this->CTest, ERROR_MESSAGE, log.c_str() << std::endl); return; - } + } res.Output += BOUNDS_CHECKER_MARKER; res.Output += "\n"; std::string line; while ( cmSystemTools::GetLineFromStream(ifs, line) ) { - res.Output += line; + res.Output += line; res.Output += "\n"; } } cmSystemTools::Delay(1000); - cmSystemTools::RemoveFile(this->BoundsCheckerDPBDFile.c_str()); + cmSystemTools::RemoveFile(this->BoundsCheckerDPBDFile.c_str()); cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Remove: " << this->BoundsCheckerDPBDFile.c_str() << std::endl); cmSystemTools::RemoveFile(this->BoundsCheckerXMLFile.c_str()); @@ -928,7 +928,7 @@ cmCTestMemCheckHandler::PostProcessBoundsCheckerTest(cmCTestTestResult& res) void cmCTestMemCheckHandler::PostProcessPurifyTest(cmCTestTestResult& res) { - cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "PostProcessPurifyTest for : " << res.Name.c_str() << std::endl); if ( !cmSystemTools::FileExists(this->MemoryTesterOutputFile.c_str()) ) @@ -945,7 +945,7 @@ cmCTestMemCheckHandler::PostProcessPurifyTest(cmCTestTestResult& res) + this->MemoryTesterOutputFile; cmCTestLog(this->CTest, ERROR_MESSAGE, log.c_str() << std::endl); return; - } + } std::string line; while ( cmSystemTools::GetLineFromStream(ifs, line) ) { diff --git a/Source/CTest/cmCTestMemCheckHandler.h b/Source/CTest/cmCTestMemCheckHandler.h index 427d471..1e81c89 100644 --- a/Source/CTest/cmCTestMemCheckHandler.h +++ b/Source/CTest/cmCTestMemCheckHandler.h @@ -30,7 +30,7 @@ public: cmTypeMacro(cmCTestMemCheckHandler, cmCTestTestHandler); void PopulateCustomVectors(cmMakefile *mf); - + cmCTestMemCheckHandler(); void Initialize(); @@ -108,13 +108,13 @@ private: //! Parse Valgrind/Purify/Bounds Checker result out of the output //string. After running, log holds the output and results hold the //different memmory errors. - bool ProcessMemCheckOutput(const std::string& str, + bool ProcessMemCheckOutput(const std::string& str, std::string& log, int* results); - bool ProcessMemCheckValgrindOutput(const std::string& str, + bool ProcessMemCheckValgrindOutput(const std::string& str, std::string& log, int* results); - bool ProcessMemCheckPurifyOutput(const std::string& str, + bool ProcessMemCheckPurifyOutput(const std::string& str, std::string& log, int* results); - bool ProcessMemCheckBoundsCheckerOutput(const std::string& str, + bool ProcessMemCheckBoundsCheckerOutput(const std::string& str, std::string& log, int* results); void PostProcessPurifyTest(cmCTestTestResult& res); diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 2cae802..ebef1ed 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -48,7 +48,7 @@ cmCTestMultiProcessHandler::~cmCTestMultiProcessHandler() } // Set the tests -void +void cmCTestMultiProcessHandler::SetTests(TestMap& tests, PropertiesMap& properties) { @@ -178,7 +178,7 @@ void cmCTestMultiProcessHandler::EraseTest(int test) //--------------------------------------------------------- inline size_t cmCTestMultiProcessHandler::GetProcessorsUsed(int test) { - size_t processors = + size_t processors = static_cast<int>(this->Properties[test]->Processors); //If this is set to run serially, it must run alone. //Also, if processors setting is set higher than the -j @@ -205,7 +205,7 @@ bool cmCTestMultiProcessHandler::StartTest(int test) } } - // copy the depend tests locally because when + // copy the depend tests locally because when // a test is finished it will be removed from the depend list // and we don't want to be iterating a list while removing from it TestSet depends = this->Tests[test]; @@ -240,7 +240,7 @@ bool cmCTestMultiProcessHandler::StartTest(int test) this->StartTestProcess(test); return true; } - // This test was not able to start because it is waiting + // This test was not able to start because it is waiting // on depends to run return false; } @@ -351,7 +351,7 @@ void cmCTestMultiProcessHandler::UpdateCostData() while(std::getline(fin, line)) { if(line == "---") break; - std::vector<cmsys::String> parts = + std::vector<cmsys::String> parts = cmSystemTools::SplitString(line.c_str(), ' '); //Format: <name> <previous_runs> <avg_cost> if(parts.size() < 3) break; @@ -552,7 +552,7 @@ void cmCTestMultiProcessHandler::PrintTestList() } cmOStringStream indexStr; indexStr << " #" << p.Index << ":"; - cmCTestLog(this->CTest, HANDLER_OUTPUT, + cmCTestLog(this->CTest, HANDLER_OUTPUT, std::setw(3 + getNumWidth(this->TestHandler->GetMaxIndex())) << indexStr.str().c_str()); cmCTestLog(this->CTest, HANDLER_OUTPUT, " "); @@ -603,7 +603,7 @@ void cmCTestMultiProcessHandler::CheckResume() << std::endl << "----------------------------------------------------------" << std::endl; - + std::ifstream fin; fin.open(fname.c_str()); std::string line; diff --git a/Source/CTest/cmCTestMultiProcessHandler.h b/Source/CTest/cmCTestMultiProcessHandler.h index 1483440..cd21d91 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.h +++ b/Source/CTest/cmCTestMultiProcessHandler.h @@ -19,16 +19,16 @@ /** \class cmCTestMultiProcessHandler * \brief run parallel ctest * - * cmCTestMultiProcessHandler + * cmCTestMultiProcessHandler */ -class cmCTestMultiProcessHandler +class cmCTestMultiProcessHandler { friend class TestComparator; public: struct TestSet : public std::set<int> {}; struct TestMap : public std::map<int, TestSet> {}; struct TestList : public std::vector<int> {}; - struct PropertiesMap : public + struct PropertiesMap : public std::map<int, cmCTestTestHandler::cmCTestTestProperties*> {}; cmCTestMultiProcessHandler(); diff --git a/Source/CTest/cmCTestReadCustomFilesCommand.h b/Source/CTest/cmCTestReadCustomFilesCommand.h index f382b0f..b984c84 100644 --- a/Source/CTest/cmCTestReadCustomFilesCommand.h +++ b/Source/CTest/cmCTestReadCustomFilesCommand.h @@ -25,11 +25,11 @@ class cmCTestReadCustomFilesCommand : public cmCTestCommand public: cmCTestReadCustomFilesCommand() {} - + /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { cmCTestReadCustomFilesCommand* ni = new cmCTestReadCustomFilesCommand; ni->CTest = this->CTest; @@ -55,7 +55,7 @@ public: { return "read CTestCustom files."; } - + /** * More documentation. */ diff --git a/Source/CTest/cmCTestRunScriptCommand.h b/Source/CTest/cmCTestRunScriptCommand.h index 6df69af..05e7899 100644 --- a/Source/CTest/cmCTestRunScriptCommand.h +++ b/Source/CTest/cmCTestRunScriptCommand.h @@ -25,11 +25,11 @@ class cmCTestRunScriptCommand : public cmCTestCommand public: cmCTestRunScriptCommand() {} - + /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { cmCTestRunScriptCommand* ni = new cmCTestRunScriptCommand; ni->CTest = this->CTest; @@ -56,7 +56,7 @@ public: { return "runs a ctest -S script"; } - + /** * More documentation. */ diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index c3de5dc..5eabf3f 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -59,7 +59,7 @@ bool cmCTestRunTest::CheckOutput() { // Store this line of output. cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, - this->GetIndex() << ": " << line << std::endl); + this->GetIndex() << ": " << line << std::endl); this->ProcessOutput += line; this->ProcessOutput += "\n"; } @@ -79,7 +79,7 @@ void cmCTestRunTest::CompressOutput() int ret; z_stream strm; - unsigned char* in = + unsigned char* in = reinterpret_cast<unsigned char*>( const_cast<char*>(this->ProcessOutput.c_str())); //zlib makes the guarantee that this is the maximum output size @@ -112,7 +112,7 @@ void cmCTestRunTest::CompressOutput() } (void)deflateEnd(&strm); - + unsigned char *encoded_buffer = new unsigned char[static_cast<int>(outSize * 1.5)]; @@ -169,11 +169,11 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started) } } if ( !found ) - { + { reason = "Required regular expression not found."; forceFail = true; } - reason += "Regex=["; + reason += "Regex=["; for ( passIt = this->TestProperties->RequiredRegularExpressions.begin(); passIt != this->TestProperties->RequiredRegularExpressions.end(); ++ passIt ) @@ -201,10 +201,10 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started) } if (res == cmsysProcess_State_Exited) { - bool success = - !forceFail && (retVal == 0 || + bool success = + !forceFail && (retVal == 0 || this->TestProperties->RequiredRegularExpressions.size()); - if((success && !this->TestProperties->WillFail) + if((success && !this->TestProperties->WillFail) || (!success && this->TestProperties->WillFail)) { this->TestResult.Status = cmCTestTestHandler::COMPLETED; @@ -312,10 +312,10 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started) << std::endl; if(this->TestResult.Reason.size()) { - *this->TestHandler->LogFile << reasonType << ":\n" + *this->TestHandler->LogFile << reasonType << ":\n" << this->TestResult.Reason << "\n"; } - else + else { if(pass) { @@ -333,14 +333,14 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started) << "----------------------------------------------------------" << std::endl << std::endl; } - // if the test actually started and ran - // record the results in TestResult + // if the test actually started and ran + // record the results in TestResult if(started) { bool compress = !this->TestHandler->MemCheck && this->CompressionRatio < 1 && this->CTest->ShouldCompressTestOutput(); - this->TestResult.Output = compress ? this->CompressedOutput + this->TestResult.Output = compress ? this->CompressedOutput : this->ProcessOutput; this->TestResult.CompressOutput = compress; this->TestResult.ReturnValue = this->TestProcess->GetExitValue(); @@ -378,7 +378,7 @@ void cmCTestRunTest::MemCheckPostProcess() { return; } - cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, this->Index + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, this->Index << ": process test output now: " << this->TestProperties->Name.c_str() << " " << this->TestResult.Name.c_str() << std::endl); @@ -390,7 +390,7 @@ void cmCTestRunTest::MemCheckPostProcess() } else if(handler->MemoryTesterStyle == cmCTestMemCheckHandler::PURIFY) { - handler->PostProcessPurifyTest(this->TestResult); + handler->PostProcessPurifyTest(this->TestResult); } } @@ -411,7 +411,7 @@ bool cmCTestRunTest::StartTest(size_t total) this->TestResult.ReturnValue = -1; this->TestResult.CompletionStatus = "Failed to start"; this->TestResult.Status = cmCTestTestHandler::BAD_COMMAND; - this->TestResult.TestCount = this->TestProperties->Index; + this->TestResult.TestCount = this->TestProperties->Index; this->TestResult.Name = this->TestProperties->Name; this->TestResult.Path = this->TestProperties->Directory.c_str(); @@ -438,7 +438,7 @@ bool cmCTestRunTest::StartTest(size_t total) this->TestResult.Status = cmCTestTestHandler::NOT_RUN; return false; } - + // Check if all required files exist for(std::vector<std::string>::iterator i = this->TestProperties->RequiredFiles.begin(); @@ -465,9 +465,9 @@ bool cmCTestRunTest::StartTest(size_t total) if (this->ActualCommand == "") { // if the command was not found create a TestResult object - // that has that information + // that has that information this->TestProcess = new cmProcess; - *this->TestHandler->LogFile << "Unable to find executable: " + *this->TestHandler->LogFile << "Unable to find executable: " << args[1].c_str() << std::endl; cmCTestLog(this->CTest, ERROR_MESSAGE, "Unable to find executable: " << args[1].c_str() << std::endl); @@ -536,7 +536,7 @@ void cmCTestRunTest::ComputeArguments() cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl << this->Index << ": " - << (this->TestHandler->MemCheck?"MemCheck":"Test") + << (this->TestHandler->MemCheck?"MemCheck":"Test") << " command: " << testCommand << std::endl); } @@ -544,7 +544,7 @@ void cmCTestRunTest::ComputeArguments() //---------------------------------------------------------------------- void cmCTestRunTest::DartProcessing() { - if (!this->ProcessOutput.empty() && + if (!this->ProcessOutput.empty() && this->ProcessOutput.find("<DartMeasurement") != this->ProcessOutput.npos) { if (this->TestHandler->DartStuff.find(this->ProcessOutput.c_str())) @@ -695,7 +695,7 @@ void cmCTestRunTest::WriteLogOutputTop(size_t completed, size_t total) cmOStringStream indexStr; indexStr << " #" << this->Index << ":"; - cmCTestLog(this->CTest, HANDLER_OUTPUT, + cmCTestLog(this->CTest, HANDLER_OUTPUT, std::setw(3 + getNumWidth(this->TestHandler->GetMaxIndex())) << indexStr.str().c_str()); cmCTestLog(this->CTest, HANDLER_OUTPUT, " "); @@ -704,17 +704,17 @@ void cmCTestRunTest::WriteLogOutputTop(size_t completed, size_t total) outname.resize(maxTestNameWidth + 4, '.'); *this->TestHandler->LogFile << this->TestProperties->Index << "/" - << this->TestHandler->TotalNumberOfTests << " Testing: " + << this->TestHandler->TotalNumberOfTests << " Testing: " << this->TestProperties->Name << std::endl; *this->TestHandler->LogFile << this->TestProperties->Index << "/" << this->TestHandler->TotalNumberOfTests << " Test: " << this->TestProperties->Name.c_str() << std::endl; *this->TestHandler->LogFile << "Command: \"" << this->ActualCommand << "\""; - + for (std::vector<std::string>::iterator i = this->Arguments.begin(); i != this->Arguments.end(); ++i) { - *this->TestHandler->LogFile + *this->TestHandler->LogFile << " \"" << i->c_str() << "\""; } *this->TestHandler->LogFile << std::endl @@ -730,6 +730,6 @@ void cmCTestRunTest::WriteLogOutputTop(size_t completed, size_t total) << this->ProcessOutput.c_str() << "<end of output>" << std::endl; cmCTestLog(this->CTest, HANDLER_OUTPUT, outname.c_str()); - cmCTestLog(this->CTest, DEBUG, "Testing " + cmCTestLog(this->CTest, DEBUG, "Testing " << this->TestProperties->Name.c_str() << " ... "); } diff --git a/Source/CTest/cmCTestRunTest.h b/Source/CTest/cmCTestRunTest.h index 89456d5..476f3e1 100644 --- a/Source/CTest/cmCTestRunTest.h +++ b/Source/CTest/cmCTestRunTest.h @@ -74,7 +74,7 @@ private: cmCTestTestHandler * TestHandler; cmCTest * CTest; cmProcess * TestProcess; - //If the executable to run is ctest, don't create a new process; + //If the executable to run is ctest, don't create a new process; //just instantiate a new cmTest. (Can be disabled for a single test //if this option is set to false.) //bool OptimizeForCTest; diff --git a/Source/CTest/cmCTestScriptHandler.h b/Source/CTest/cmCTestScriptHandler.h index a7cf6ba..9d852ca 100644 --- a/Source/CTest/cmCTestScriptHandler.h +++ b/Source/CTest/cmCTestScriptHandler.h @@ -97,7 +97,7 @@ public: static void SleepInSeconds(unsigned int secondsToWait); void UpdateElapsedTime(); - /** + /** * Return the time remaianing that the script is allowed to run in * seconds if the user has set the variable CTEST_TIME_LIMIT. If that has * not been set it returns 1e7 seconds diff --git a/Source/CTest/cmCTestSleepCommand.cxx b/Source/CTest/cmCTestSleepCommand.cxx index 5b06972..7e87550 100644 --- a/Source/CTest/cmCTestSleepCommand.cxx +++ b/Source/CTest/cmCTestSleepCommand.cxx @@ -47,7 +47,7 @@ bool cmCTestSleepCommand } return true; } - + this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/CTest/cmCTestSleepCommand.h b/Source/CTest/cmCTestSleepCommand.h index 80fd6af..0f51ddf 100644 --- a/Source/CTest/cmCTestSleepCommand.h +++ b/Source/CTest/cmCTestSleepCommand.h @@ -25,11 +25,11 @@ class cmCTestSleepCommand : public cmCTestCommand public: cmCTestSleepCommand() {} - + /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { cmCTestSleepCommand* ni = new cmCTestSleepCommand; ni->CTest = this->CTest; @@ -56,7 +56,7 @@ public: { return "sleeps for some amount of time"; } - + /** * More documentation. */ diff --git a/Source/CTest/cmCTestTestCommand.cxx b/Source/CTest/cmCTestTestCommand.cxx index 5aee035..231f035 100644 --- a/Source/CTest/cmCTestTestCommand.cxx +++ b/Source/CTest/cmCTestTestCommand.cxx @@ -32,7 +32,7 @@ cmCTestTestCommand::cmCTestTestCommand() cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler() { - const char* ctestTimeout = + const char* ctestTimeout = this->Makefile->GetDefinition("CTEST_TEST_TIMEOUT"); double timeout = this->CTest->GetTimeOut(); @@ -86,7 +86,7 @@ cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler() } if(this->Values[ctt_INCLUDE_LABEL]) { - handler->SetOption("LabelRegularExpression", + handler->SetOption("LabelRegularExpression", this->Values[ctt_INCLUDE_LABEL]); } if(this->Values[ctt_PARALLEL_LEVEL]) diff --git a/Source/CTest/cmCTestTestCommand.h b/Source/CTest/cmCTestTestCommand.h index d184ff2..130cb69 100644 --- a/Source/CTest/cmCTestTestCommand.h +++ b/Source/CTest/cmCTestTestCommand.h @@ -58,7 +58,7 @@ public: " ctest_test([BUILD build_dir] [APPEND]\n" " [START start number] [END end number]\n" " [STRIDE stride number] [EXCLUDE exclude regex ]\n" - " [INCLUDE include regex] [RETURN_VALUE res] \n" + " [INCLUDE include regex] [RETURN_VALUE res] \n" " [EXCLUDE_LABEL exclude regex] \n" " [INCLUDE_LABEL label regex] \n" " [PARALLEL_LEVEL level] \n" diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx index 0ee631f..000bc85 100644 --- a/Source/CTest/cmProcess.cxx +++ b/Source/CTest/cmProcess.cxx @@ -196,12 +196,12 @@ int cmProcess::ReportStatus() { case cmsysProcess_State_Starting: { - std::cerr << "cmProcess: Never started " + std::cerr << "cmProcess: Never started " << this->Command << " process.\n"; } break; case cmsysProcess_State_Error: { - std::cerr << "cmProcess: Error executing " << this->Command + std::cerr << "cmProcess: Error executing " << this->Command << " process: " << cmsysProcess_GetErrorString(this->Process) << "\n"; @@ -241,19 +241,19 @@ int cmProcess::ReportStatus() } break; case cmsysProcess_State_Executing: { - std::cerr << "cmProcess: Never terminated " << + std::cerr << "cmProcess: Never terminated " << this->Command << " process.\n"; } break; case cmsysProcess_State_Exited: { result = cmsysProcess_GetExitValue(this->Process); - std::cerr << "cmProcess: " << this->Command + std::cerr << "cmProcess: " << this->Command << " process exited with code " << result << "\n"; } break; case cmsysProcess_State_Expired: { - std::cerr << "cmProcess: killed " << this->Command + std::cerr << "cmProcess: killed " << this->Command << " process due to timeout.\n"; } break; case cmsysProcess_State_Killed: diff --git a/Source/CTest/cmProcess.h b/Source/CTest/cmProcess.h index ff99ca2..1479df0 100644 --- a/Source/CTest/cmProcess.h +++ b/Source/CTest/cmProcess.h @@ -22,7 +22,7 @@ * * cmProcess wraps the kwsys process stuff in a c++ class. */ -class cmProcess +class cmProcess { public: cmProcess(); @@ -37,7 +37,7 @@ public: // return the process status int GetProcessStatus(); - // Report the status of the program + // Report the status of the program int ReportStatus(); int GetId() { return this->Id; } void SetId(int id) { this->Id = id;} diff --git a/Source/CursesDialog/cmCursesBoolWidget.cxx b/Source/CursesDialog/cmCursesBoolWidget.cxx index 9c4c5a5..fd15b99 100644 --- a/Source/CursesDialog/cmCursesBoolWidget.cxx +++ b/Source/CursesDialog/cmCursesBoolWidget.cxx @@ -12,7 +12,7 @@ #include "cmCursesBoolWidget.h" #include "cmCursesMainForm.h" -cmCursesBoolWidget::cmCursesBoolWidget(int width, int height, +cmCursesBoolWidget::cmCursesBoolWidget(int width, int height, int left, int top) : cmCursesWidget(width, height, left, top) { @@ -38,15 +38,15 @@ bool cmCursesBoolWidget::HandleInput(int& key, cmCursesMainForm*, WINDOW* w) this->SetValueAsBool(true); } - touchwin(w); - wrefresh(w); + touchwin(w); + wrefresh(w); return true; } else { return false; } - + } void cmCursesBoolWidget::SetValueAsBool(bool value) @@ -56,7 +56,7 @@ void cmCursesBoolWidget::SetValueAsBool(bool value) this->SetValue("ON"); } else - { + { this->SetValue("OFF"); } } @@ -68,7 +68,7 @@ bool cmCursesBoolWidget::GetValueAsBool() return true; } else - { + { return false; } } diff --git a/Source/CursesDialog/cmCursesBoolWidget.h b/Source/CursesDialog/cmCursesBoolWidget.h index 0d1d6a6..d2a25ca 100644 --- a/Source/CursesDialog/cmCursesBoolWidget.h +++ b/Source/CursesDialog/cmCursesBoolWidget.h @@ -19,7 +19,7 @@ class cmCursesBoolWidget : public cmCursesWidget { public: cmCursesBoolWidget(int width, int height, int left, int top); - + // Description: // Handle user input. Called by the container of this widget // when this widget has focus. Returns true if the input was diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx index 828384d..c58d037 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx @@ -19,19 +19,19 @@ #include "../cmSystemTools.h" cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(const char* key, - int labelwidth, + int labelwidth, int entrywidth) : Key(key), LabelWidth(labelwidth), EntryWidth(entrywidth) { this->Label = new cmCursesLabelWidget(this->LabelWidth, 1, 1, 1, key); this->IsNewLabel = new cmCursesLabelWidget(1, 1, 1, 1, " "); - this->Entry = 0; + this->Entry = 0; this->Entry = new cmCursesStringWidget(this->EntryWidth, 1, 1, 1); } cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( - const char* key, const cmCacheManager::CacheIterator& it, bool isNew, - int labelwidth, int entrywidth) + const char* key, const cmCacheManager::CacheIterator& it, bool isNew, + int labelwidth, int entrywidth) : Key(key), LabelWidth(labelwidth), EntryWidth(entrywidth) { this->Label = new cmCursesLabelWidget(this->LabelWidth, 1, 1, 1, key); @@ -74,7 +74,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( it.GetValue()); break; case cmCacheManager::UNINITIALIZED: - cmSystemTools::Error("Found an undefined variable: ", it.GetName()); + cmSystemTools::Error("Found an undefined variable: ", it.GetName()); break; default: // TODO : put warning message here diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.h b/Source/CursesDialog/cmCursesCacheEntryComposite.h index a40ea28..1357a02 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.h +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.h @@ -20,7 +20,7 @@ class cmCursesCacheEntryComposite public: cmCursesCacheEntryComposite(const char* key, int labelwidth, int entrywidth); cmCursesCacheEntryComposite(const char* key, - const cmCacheManager::CacheIterator& it, + const cmCacheManager::CacheIterator& it, bool isNew, int labelwidth, int entrywidth); ~cmCursesCacheEntryComposite(); const char* GetValue(); diff --git a/Source/CursesDialog/cmCursesDummyWidget.cxx b/Source/CursesDialog/cmCursesDummyWidget.cxx index 1d8a45d..60086a5 100644 --- a/Source/CursesDialog/cmCursesDummyWidget.cxx +++ b/Source/CursesDialog/cmCursesDummyWidget.cxx @@ -11,7 +11,7 @@ ============================================================================*/ #include "cmCursesDummyWidget.h" -cmCursesDummyWidget::cmCursesDummyWidget(int width, int height, +cmCursesDummyWidget::cmCursesDummyWidget(int width, int height, int left, int top) : cmCursesWidget(width, height, left, top) { diff --git a/Source/CursesDialog/cmCursesDummyWidget.h b/Source/CursesDialog/cmCursesDummyWidget.h index cc4cc74..9ac1365 100644 --- a/Source/CursesDialog/cmCursesDummyWidget.h +++ b/Source/CursesDialog/cmCursesDummyWidget.h @@ -20,7 +20,7 @@ class cmCursesDummyWidget : public cmCursesWidget { public: cmCursesDummyWidget(int width, int height, int left, int top); - + // Description: // Handle user input. Called by the container of this widget // when this widget has focus. Returns true if the input was diff --git a/Source/CursesDialog/cmCursesFilePathWidget.cxx b/Source/CursesDialog/cmCursesFilePathWidget.cxx index 13bbcc9..01db014 100644 --- a/Source/CursesDialog/cmCursesFilePathWidget.cxx +++ b/Source/CursesDialog/cmCursesFilePathWidget.cxx @@ -11,7 +11,7 @@ ============================================================================*/ #include "cmCursesFilePathWidget.h" -cmCursesFilePathWidget::cmCursesFilePathWidget(int width, int height, +cmCursesFilePathWidget::cmCursesFilePathWidget(int width, int height, int left, int top) : cmCursesPathWidget(width, height, left, top) { diff --git a/Source/CursesDialog/cmCursesForm.h b/Source/CursesDialog/cmCursesForm.h index 7556d74..3cba856 100644 --- a/Source/CursesDialog/cmCursesForm.h +++ b/Source/CursesDialog/cmCursesForm.h @@ -20,7 +20,7 @@ class cmCursesForm public: cmCursesForm(); virtual ~cmCursesForm(); - + // Description: // Handle user input. virtual void HandleInput() = 0; @@ -59,7 +59,7 @@ public: } static cmCursesForm* CurrentForm; - + protected: diff --git a/Source/CursesDialog/cmCursesLabelWidget.cxx b/Source/CursesDialog/cmCursesLabelWidget.cxx index 2ad4813..b5ed312 100644 --- a/Source/CursesDialog/cmCursesLabelWidget.cxx +++ b/Source/CursesDialog/cmCursesLabelWidget.cxx @@ -11,7 +11,7 @@ ============================================================================*/ #include "cmCursesLabelWidget.h" -cmCursesLabelWidget::cmCursesLabelWidget(int width, int height, +cmCursesLabelWidget::cmCursesLabelWidget(int width, int height, int left, int top, const std::string& name) : cmCursesWidget(width, height, left, top) diff --git a/Source/CursesDialog/cmCursesLabelWidget.h b/Source/CursesDialog/cmCursesLabelWidget.h index bbcc586..cc32d11 100644 --- a/Source/CursesDialog/cmCursesLabelWidget.h +++ b/Source/CursesDialog/cmCursesLabelWidget.h @@ -23,7 +23,7 @@ public: cmCursesLabelWidget(int width, int height, int left, int top, const std::string& name); virtual ~cmCursesLabelWidget(); - + // Description: // Handle user input. Called by the container of this widget // when this widget has focus. Returns true if the input was diff --git a/Source/CursesDialog/cmCursesLongMessageForm.cxx b/Source/CursesDialog/cmCursesLongMessageForm.cxx index 0e2cd22..057f8f3 100644 --- a/Source/CursesDialog/cmCursesLongMessageForm.cxx +++ b/Source/CursesDialog/cmCursesLongMessageForm.cxx @@ -19,10 +19,10 @@ inline int ctrl(int z) { return (z&037); -} +} -cmCursesLongMessageForm::cmCursesLongMessageForm(std::vector<std::string> - const& messages, const char* +cmCursesLongMessageForm::cmCursesLongMessageForm(std::vector<std::string> + const& messages, const char* title) { // Append all messages into on big string @@ -84,7 +84,7 @@ void cmCursesLongMessageForm::UpdateStatusBar() curses_move(y-4,0); attron(A_STANDOUT); printw(bar); - attroff(A_STANDOUT); + attroff(A_STANDOUT); curses_move(y-3,0); printw(version); pos_form_cursor(this->Form); @@ -94,7 +94,7 @@ void cmCursesLongMessageForm::PrintKeys() { int x,y; getmaxyx(stdscr, y, x); - if ( x < cmCursesMainForm::MIN_WIDTH || + if ( x < cmCursesMainForm::MIN_WIDTH || y < cmCursesMainForm::MIN_HEIGHT ) { return; @@ -105,7 +105,7 @@ void cmCursesLongMessageForm::PrintKeys() curses_move(y-2,0); printw(firstLine); pos_form_cursor(this->Form); - + } void cmCursesLongMessageForm::Render(int, int, int, int) @@ -155,7 +155,7 @@ void cmCursesLongMessageForm::Render(int, int, int, int) this->UpdateStatusBar(); this->PrintKeys(); - touchwin(stdscr); + touchwin(stdscr); refresh(); } @@ -200,8 +200,8 @@ void cmCursesLongMessageForm::HandleInput() this->UpdateStatusBar(); this->PrintKeys(); - touchwin(stdscr); - wrefresh(stdscr); + touchwin(stdscr); + wrefresh(stdscr); } } diff --git a/Source/CursesDialog/cmCursesLongMessageForm.h b/Source/CursesDialog/cmCursesLongMessageForm.h index 341f9c6..1e86974 100644 --- a/Source/CursesDialog/cmCursesLongMessageForm.h +++ b/Source/CursesDialog/cmCursesLongMessageForm.h @@ -21,10 +21,10 @@ class cmCursesCacheEntryComposite; class cmCursesLongMessageForm : public cmCursesForm { public: - cmCursesLongMessageForm(std::vector<std::string> const& messages, + cmCursesLongMessageForm(std::vector<std::string> const& messages, const char* title); virtual ~cmCursesLongMessageForm(); - + // Description: // Handle user input. virtual void HandleInput(); diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h index 3e191b4..883a2b3 100644 --- a/Source/CursesDialog/cmCursesMainForm.h +++ b/Source/CursesDialog/cmCursesMainForm.h @@ -30,12 +30,12 @@ class cmCursesMainForm : public cmCursesForm public: cmCursesMainForm(std::vector<std::string> const& args, int initwidth); virtual ~cmCursesMainForm(); - + /** * Set the widgets which represent the cache entries. */ void InitializeUI(); - + /** * Handle user input. */ @@ -65,7 +65,7 @@ public: * exception is during a resize. The optional argument specifies the * string to be displayed in the status bar. */ - virtual void UpdateStatusBar() { this->UpdateStatusBar(0); } + virtual void UpdateStatusBar() { this->UpdateStatusBar(0); } virtual void UpdateStatusBar(const char* message); /** @@ -90,7 +90,7 @@ public: int Configure(int noconfigure=0); /** - * Used to generate + * Used to generate */ int Generate(); @@ -98,7 +98,7 @@ public: * Used by main program */ int LoadCache(const char *dir); - + /** * Progress callback */ diff --git a/Source/CursesDialog/cmCursesPathWidget.cxx b/Source/CursesDialog/cmCursesPathWidget.cxx index b113c2e..14c325b 100644 --- a/Source/CursesDialog/cmCursesPathWidget.cxx +++ b/Source/CursesDialog/cmCursesPathWidget.cxx @@ -14,7 +14,7 @@ #include "cmCursesMainForm.h" #include "cmSystemTools.h" -cmCursesPathWidget::cmCursesPathWidget(int width, int height, +cmCursesPathWidget::cmCursesPathWidget(int width, int height, int left, int top) : cmCursesStringWidget(width, height, left, top) { @@ -75,8 +75,8 @@ void cmCursesPathWidget::OnTab(cmCursesMainForm* fm, WINDOW* w) } this->SetString(cstr.c_str()); - touchwin(w); - wrefresh(w); + touchwin(w); + wrefresh(w); form_driver(form, REQ_END_FIELD); this->LastGlob = glob; this->LastString = cstr; diff --git a/Source/CursesDialog/cmCursesStringWidget.cxx b/Source/CursesDialog/cmCursesStringWidget.cxx index d363f00..5c7414f 100644 --- a/Source/CursesDialog/cmCursesStringWidget.cxx +++ b/Source/CursesDialog/cmCursesStringWidget.cxx @@ -15,9 +15,9 @@ inline int ctrl(int z) { return (z&037); -} +} -cmCursesStringWidget::cmCursesStringWidget(int width, int height, +cmCursesStringWidget::cmCursesStringWidget(int width, int height, int left, int top) : cmCursesWidget(width, height, left, top) { @@ -63,7 +63,7 @@ void cmCursesStringWidget::OnType(int& key, cmCursesMainForm* fm, WINDOW*) form_driver(fm->GetForm(), key); } -bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm, +bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm, WINDOW* w) { int x,y; @@ -90,7 +90,7 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm, getmaxyx(stdscr, y, x); // If window too small, handle 'q' only - if ( x < cmCursesMainForm::MIN_WIDTH || + if ( x < cmCursesMainForm::MIN_WIDTH || y < cmCursesMainForm::MIN_HEIGHT ) { // quit @@ -100,7 +100,7 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm, } else { - key=getch(); + key=getch(); continue; } } @@ -111,7 +111,7 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm, return false; } // 10 == enter - if (key == 10 || key == KEY_ENTER) + if (key == 10 || key == KEY_ENTER) { this->OnReturn(fm, w); } @@ -121,7 +121,7 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm, key == KEY_PPAGE || key == ctrl('u')) { this->InEdit = false; - delete[] this->OriginalString; + delete[] this->OriginalString; // trick to force forms to update the field buffer form_driver(form, REQ_NEXT_FIELD); form_driver(form, REQ_PREV_FIELD); @@ -136,8 +136,8 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm, fm->PrintKeys(); this->SetString(this->OriginalString); delete[] this->OriginalString; - touchwin(w); - wrefresh(w); + touchwin(w); + wrefresh(w); return true; } } @@ -165,7 +165,7 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm, { form_driver(form, REQ_END_FIELD); } - else if ( key == 127 || + else if ( key == 127 || key == KEY_BACKSPACE ) { if ( form->curcol > 0 ) @@ -186,10 +186,10 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm, } if ( !this->Done ) { - touchwin(w); - wrefresh(w); - - key=getch(); + touchwin(w); + wrefresh(w); + + key=getch(); } } return true; @@ -214,7 +214,7 @@ bool cmCursesStringWidget::PrintKeys() { int x,y; getmaxyx(stdscr, y, x); - if ( x < cmCursesMainForm::MIN_WIDTH || + if ( x < cmCursesMainForm::MIN_WIDTH || y < cmCursesMainForm::MIN_HEIGHT ) { return false; diff --git a/Source/CursesDialog/cmCursesStringWidget.h b/Source/CursesDialog/cmCursesStringWidget.h index cd54f24..e939049 100644 --- a/Source/CursesDialog/cmCursesStringWidget.h +++ b/Source/CursesDialog/cmCursesStringWidget.h @@ -26,7 +26,7 @@ class cmCursesStringWidget : public cmCursesWidget { public: cmCursesStringWidget(int width, int height, int left, int top); - + /** * Handle user input. Called by the container of this widget * when this widget has focus. Returns true if the input was diff --git a/Source/CursesDialog/cmCursesWidget.h b/Source/CursesDialog/cmCursesWidget.h index ee36af6..952c67a 100644 --- a/Source/CursesDialog/cmCursesWidget.h +++ b/Source/CursesDialog/cmCursesWidget.h @@ -22,7 +22,7 @@ class cmCursesWidget public: cmCursesWidget(int width, int height, int left, int top); virtual ~cmCursesWidget(); - + /** * Handle user input. Called by the container of this widget * when this widget has focus. Returns true if the input was diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx index c942bc4..01893f5 100644 --- a/Source/QtDialog/CMakeSetup.cxx +++ b/Source/QtDialog/CMakeSetup.cxx @@ -99,15 +99,15 @@ int main(int argc, char** argv) } QApplication app(argc, argv); - + // clean out standard Qt paths for plugins, which we don't use anyway // when creating Mac bundles, it potentially causes problems foreach(QString p, QApplication::libraryPaths()) { QApplication::removeLibraryPath(p); } - - // if arg for install + + // if arg for install for(int i =0; i < argc; i++) { if(strcmp(argv[i], "--mac-install") == 0) @@ -117,7 +117,7 @@ int main(int argc, char** argv) return 0; } } - // tell the cmake library where cmake is + // tell the cmake library where cmake is QDir cmExecDir(QApplication::applicationDirPath()); #if defined(Q_OS_MAC) cmExecDir.cd("../../../"); @@ -131,7 +131,7 @@ int main(int argc, char** argv) QString transfile = QString("cmake_%1").arg(QLocale::system().name()); translator.load(transfile, translationsDir.path()); app.installTranslator(&translator); - + // app setup app.setApplicationName("CMakeSetup"); app.setOrganizationName("Kitware"); @@ -139,16 +139,16 @@ int main(int argc, char** argv) appIcon.addFile(":/Icons/CMakeSetup32.png"); appIcon.addFile(":/Icons/CMakeSetup128.png"); app.setWindowIcon(appIcon); - + CMakeSetupDialog dialog; dialog.show(); - + cmsys::CommandLineArguments arg; arg.Initialize(argc, argv); std::string binaryDirectory; std::string sourceDirectory; typedef cmsys::CommandLineArguments argT; - arg.AddArgument("-B", argT::CONCAT_ARGUMENT, + arg.AddArgument("-B", argT::CONCAT_ARGUMENT, &binaryDirectory, "Binary Directory"); arg.AddArgument("-H", argT::CONCAT_ARGUMENT, &sourceDirectory, "Source Directory"); @@ -199,7 +199,7 @@ int main(int argc, char** argv) } } } - + return app.exec(); } diff --git a/Source/QtDialog/Compilers.h b/Source/QtDialog/Compilers.h index e9c90a5..3f7b834 100644 --- a/Source/QtDialog/Compilers.h +++ b/Source/QtDialog/Compilers.h @@ -10,7 +10,7 @@ class Compilers : public QWidget, public Ui::Compilers { Q_OBJECT public: - Compilers(QWidget* p=NULL) : + Compilers(QWidget* p=NULL) : QWidget(p) { this->setupUi(this); diff --git a/Source/QtDialog/FirstConfigure.cxx b/Source/QtDialog/FirstConfigure.cxx index 2a79877..6de9f00 100644 --- a/Source/QtDialog/FirstConfigure.cxx +++ b/Source/QtDialog/FirstConfigure.cxx @@ -25,7 +25,7 @@ StartCompilerSetup::StartCompilerSetup(QWidget* p) l->addWidget(this->CompilerSetupOptions[1]); l->addWidget(this->CompilerSetupOptions[2]); l->addWidget(this->CompilerSetupOptions[3]); - + this->CompilerSetupOptions[0]->setChecked(true); QObject::connect(this->CompilerSetupOptions[0], SIGNAL(toggled(bool)), @@ -47,7 +47,7 @@ void StartCompilerSetup::setGenerators(const QStringList& gens) this->GeneratorOptions->clear(); this->GeneratorOptions->addItems(gens); }; - + void StartCompilerSetup::setCurrentGenerator(const QString& gen) { int idx = this->GeneratorOptions->findText(gen); @@ -237,7 +237,7 @@ void CrossCompilerSetup::setProcessor(const QString& t) { this->systemProcessor->setText(t); } - + QString CrossCompilerSetup::getFindRoot() const { return this->crossFindRoot->text(); @@ -313,10 +313,10 @@ FirstConfigure::FirstConfigure() this->mNativeCompilerSetupPage = new NativeCompilerSetup(this); this->setPage(NativeSetup, this->mNativeCompilerSetupPage); - + this->mCrossCompilerSetupPage = new CrossCompilerSetup(this); this->setPage(CrossSetup, this->mCrossCompilerSetupPage); - + this->mToolchainCompilerSetupPage = new ToolchainCompilerSetup(this); this->setPage(ToolchainSetup, this->mToolchainCompilerSetupPage); } @@ -370,14 +370,14 @@ void FirstConfigure::loadFromSettings() void FirstConfigure::saveToSettings() { QSettings settings; - + // save generator settings.beginGroup("Settings/StartPath"); QString lastGen = this->mStartCompilerSetupPage->getGenerator(); settings.setValue("LastGenerator", lastGen); settings.endGroup(); - // save compiler setup + // save compiler setup settings.beginGroup("Settings/Compiler"); settings.setValue("CCompiler", this->mNativeCompilerSetupPage->getCCompiler()); settings.setValue("CXXCompiler", this->mNativeCompilerSetupPage->getCXXCompiler()); @@ -419,7 +419,7 @@ bool FirstConfigure::crossCompilerToolChainFile() const { return this->mStartCompilerSetupPage->crossCompilerToolChainFile(); } - + QString FirstConfigure::getCrossCompilerToolChainFile() const { return this->mToolchainCompilerSetupPage->toolchainFile(); diff --git a/Source/QtDialog/FirstConfigure.h b/Source/QtDialog/FirstConfigure.h index f4e368b..be390b0 100644 --- a/Source/QtDialog/FirstConfigure.h +++ b/Source/QtDialog/FirstConfigure.h @@ -30,14 +30,14 @@ class StartCompilerSetup : public QWizardPage void setGenerators(const QStringList& gens); void setCurrentGenerator(const QString& gen); QString getGenerator() const; - + bool defaultSetup() const; bool compilerSetup() const; bool crossCompilerSetup() const; bool crossCompilerToolChainFile() const; int nextId() const; - + signals: void selectionChanged(); @@ -56,7 +56,7 @@ class NativeCompilerSetup : public QWizardPage, protected Ui::Compilers public: NativeCompilerSetup(QWidget* p); ~NativeCompilerSetup(); - + QString getCCompiler() const; void setCCompiler(const QString&); @@ -65,7 +65,7 @@ class NativeCompilerSetup : public QWizardPage, protected Ui::Compilers QString getFortranCompiler() const; void setFortranCompiler(const QString&); - + int nextId() const { return -1; } }; @@ -76,13 +76,13 @@ class CrossCompilerSetup : public QWizardPage, protected Ui::CrossCompiler public: CrossCompilerSetup(QWidget* p); ~CrossCompilerSetup(); - + QString getSystem() const; void setSystem(const QString&); - + QString getVersion() const; void setVersion(const QString&); - + QString getProcessor() const; void setProcessor(const QString&); @@ -94,7 +94,7 @@ class CrossCompilerSetup : public QWizardPage, protected Ui::CrossCompiler QString getFortranCompiler() const; void setFortranCompiler(const QString&); - + QString getFindRoot() const; void setFindRoot(const QString&); @@ -104,14 +104,14 @@ class CrossCompilerSetup : public QWizardPage, protected Ui::CrossCompiler ONLY, NEVER }; - + int getProgramMode() const; void setProgramMode(int); int getLibraryMode() const; void setLibraryMode(int); int getIncludeMode() const; void setIncludeMode(int); - + int nextId() const { return -1; } }; @@ -127,7 +127,7 @@ class ToolchainCompilerSetup : public QWizardPage void setToolchainFile(const QString&); int nextId() const { return -1; } - + protected: QCMakeFilePathEditor* ToolchainFile; }; @@ -151,7 +151,7 @@ public: QString getCCompiler() const; QString getCXXCompiler() const; QString getFortranCompiler() const; - + QString getSystemName() const; QString getSystemVersion() const; QString getSystemProcessor() const; @@ -159,7 +159,7 @@ public: QString getCrossProgramMode() const; QString getCrossLibraryMode() const; QString getCrossIncludeMode() const; - + QString getCrossCompilerToolChainFile() const; void loadFromSettings(); diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 8554ff8..a2b1567 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -32,9 +32,9 @@ QCMake::QCMake(QObject* p) this->WarnUnusedMode = false; qRegisterMetaType<QCMakeProperty>(); qRegisterMetaType<QCMakePropertyList>(); - + QDir execDir(QCoreApplication::applicationDirPath()); - + #if defined(Q_OS_MAC) if(execDir.exists("../bin/cmake")) { @@ -45,7 +45,7 @@ QCMake::QCMake(QObject* p) execDir.cd("../../../"); // path to cmake in build directory (need to fix for deployment) } #endif - + QString cmakeCommand = QString("cmake")+QString::fromLocal8Bit(cmSystemTools::GetExecutableExtension()); cmakeCommand = execDir.filePath(cmakeCommand); @@ -58,7 +58,7 @@ QCMake::QCMake(QObject* p) this->CMakeInstance->SetCMakeCommand(cmakeCommand.toLocal8Bit().data()); #if defined(Q_OS_MAC) this->CMakeInstance->SetCMakeEditCommand("cmake-gui.app/Contents/MacOS/cmake-gui"); -#else +#else this->CMakeInstance->SetCMakeEditCommand("cmake-gui"); #endif this->CMakeInstance->SetProgressCallback(QCMake::progressCallback, this); @@ -96,7 +96,7 @@ void QCMake::loadCache(const QString& dir) void QCMake::setSourceDirectory(const QString& _dir) { - QString dir = + QString dir = QString::fromLocal8Bit(cmSystemTools::GetActualCaseForPath(_dir.toLocal8Bit().data()).c_str()); if(this->SourceDirectory != dir) { @@ -107,7 +107,7 @@ void QCMake::setSourceDirectory(const QString& _dir) void QCMake::setBinaryDirectory(const QString& _dir) { - QString dir = + QString dir = QString::fromLocal8Bit(cmSystemTools::GetActualCaseForPath(_dir.toLocal8Bit().data()).c_str()); if(this->BinaryDirectory != dir) { @@ -126,7 +126,7 @@ void QCMake::setBinaryDirectory(const QString& _dir) "Please check the permissions of the directory you are trying to run CMake on."); } } - + QCMakePropertyList props = this->properties(); emit this->propertiesChanged(props); cmCacheManager::CacheIterator itm = cachem->NewIterator(); @@ -202,7 +202,7 @@ void QCMake::generate() emit this->generateDone(err); } - + void QCMake::setProperties(const QCMakePropertyList& newProps) { QCMakePropertyList props = newProps; @@ -251,7 +251,7 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) cachem->RemoveCacheEntry(s.toLocal8Bit().data()); } - + // add some new properites foreach(QCMakeProperty s, props) { @@ -286,7 +286,7 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) cmCacheManager::FILEPATH); } } - + cachem->SaveCache(this->BinaryDirectory.toLocal8Bit().data()); } @@ -339,7 +339,7 @@ QCMakePropertyList QCMake::properties() const return ret; } - + void QCMake::interrupt() { this->InterruptFlag.ref(); @@ -416,7 +416,7 @@ void QCMake::reloadCache() props = this->properties(); emit this->propertiesChanged(props); } - + void QCMake::setDebugOutput(bool flag) { if(flag != this->CMakeInstance->GetDebugOutput()) diff --git a/Source/QtDialog/QCMake.h b/Source/QtDialog/QCMake.h index 0d68586..93ac8ab 100644 --- a/Source/QtDialog/QCMake.h +++ b/Source/QtDialog/QCMake.h @@ -38,12 +38,12 @@ struct QCMakeProperty QString Help; PropertyType Type; bool Advanced; - bool operator==(const QCMakeProperty& other) const - { + bool operator==(const QCMakeProperty& other) const + { return this->Key == other.Key; } - bool operator<(const QCMakeProperty& other) const - { + bool operator<(const QCMakeProperty& other) const + { return this->Key < other.Key; } }; @@ -56,7 +56,7 @@ Q_DECLARE_METATYPE(QCMakeProperty) Q_DECLARE_METATYPE(QCMakePropertyList) /// Qt API for CMake library. -/// Wrapper like class allows for easier integration with +/// Wrapper like class allows for easier integration with /// Qt features such as, signal/slot connections, multi-threading, etc.. class QCMake : public QObject { @@ -136,7 +136,7 @@ protected: static bool interruptCallback(void*); static void progressCallback(const char* msg, float percent, void* cd); - static void errorCallback(const char* msg, const char* title, + static void errorCallback(const char* msg, const char* title, bool&, void* cd); bool SuppressDevWarnings; bool WarnUninitializedMode; diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx index 72e9b24..1d21d42 100644 --- a/Source/QtDialog/QCMakeCacheView.cxx +++ b/Source/QtDialog/QCMakeCacheView.cxx @@ -64,7 +64,7 @@ protected: return true; } } - + return false; } }; @@ -73,11 +73,11 @@ protected: class QCMakeAdvancedFilter : public QSortFilterProxyModel { public: - QCMakeAdvancedFilter(QObject* o) + QCMakeAdvancedFilter(QObject* o) : QSortFilterProxyModel(o), ShowAdvanced(false) {} - void setShowAdvanced(bool f) - { + void setShowAdvanced(bool f) + { this->ShowAdvanced = f; this->invalidate(); } @@ -102,7 +102,7 @@ protected: } return false; } - + // check children int num = m->rowCount(idx); for(int i=0; i<num; i++) @@ -134,9 +134,9 @@ QCMakeCacheView::QCMakeCacheView(QWidget* p) // our delegate for creating our editors QCMakeCacheModelDelegate* delegate = new QCMakeCacheModelDelegate(this); this->setItemDelegate(delegate); - + this->setUniformRowHeights(true); - + this->setEditTriggers(QAbstractItemView::AllEditTriggers); // tab, backtab doesn't step through items @@ -153,13 +153,13 @@ bool QCMakeCacheView::event(QEvent* e) } return QTreeView::event(e); } - + QCMakeCacheModel* QCMakeCacheView::cacheModel() const { return this->CacheModel; } - -QModelIndex QCMakeCacheView::moveCursor(CursorAction act, + +QModelIndex QCMakeCacheView::moveCursor(CursorAction act, Qt::KeyboardModifiers mod) { // want home/end to go to begin/end of rows, not columns @@ -173,7 +173,7 @@ QModelIndex QCMakeCacheView::moveCursor(CursorAction act, } return QTreeView::moveCursor(act, mod); } - + void QCMakeCacheView::setShowAdvanced(bool s) { #if QT_VERSION >= 040300 @@ -224,7 +224,7 @@ void QCMakeCacheModel::clear() { this->QStandardItemModel::clear(); this->NewPropertyCount = 0; - + QStringList labels; labels << tr("Name") << tr("Value"); this->setHorizontalHeaderLabels(labels); @@ -281,7 +281,7 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props) this->breakProperties(newProps2, newPropsTree2); QStandardItem* root = this->invisibleRootItem(); - + foreach(QString key, newPropsTree.keys()) { QCMakePropertyList props2 = newPropsTree[key]; @@ -308,12 +308,12 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props) this->setPropertyData(this->indexFromItem(items[0]), prop, true); } } - + foreach(QString key, newPropsTree2.keys()) { QCMakePropertyList props2 = newPropsTree2[key]; - QStandardItem* parentItem = + QStandardItem* parentItem = new QStandardItem(key.isEmpty() ? tr("Ungrouped Entries") : key); root->appendRow(parentItem); parentItem->setData(1, GroupRole); @@ -330,7 +330,7 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props) } } } - + this->blockSignals(b); this->reset(); } @@ -361,7 +361,7 @@ void QCMakeCacheModel::setViewType(QCMakeCacheModel::ViewType t) this->reset(); } -void QCMakeCacheModel::setPropertyData(const QModelIndex& idx1, +void QCMakeCacheModel::setPropertyData(const QModelIndex& idx1, const QCMakeProperty& prop, bool isNew) { QModelIndex idx2 = idx1.sibling(idx1.row(), 1); @@ -370,7 +370,7 @@ void QCMakeCacheModel::setPropertyData(const QModelIndex& idx1, this->setData(idx1, prop.Help, QCMakeCacheModel::HelpRole); this->setData(idx1, prop.Type, QCMakeCacheModel::TypeRole); this->setData(idx1, prop.Advanced, QCMakeCacheModel::AdvancedRole); - + if(prop.Type == QCMakeProperty::BOOL) { int check = prop.Value.toBool() ? Qt::Checked : Qt::Unchecked; @@ -394,7 +394,7 @@ void QCMakeCacheModel::setPropertyData(const QModelIndex& idx1, } } -void QCMakeCacheModel::getPropertyData(const QModelIndex& idx1, +void QCMakeCacheModel::getPropertyData(const QModelIndex& idx1, QCMakeProperty& prop) const { QModelIndex idx2 = idx1.sibling(idx1.row(), 1); @@ -457,7 +457,7 @@ void QCMakeCacheModel::breakProperties(const QSet<QCMakeProperty>& props, } result = tmp; } - + QCMakePropertyList QCMakeCacheModel::properties() const { QCMakePropertyList props; @@ -488,7 +488,7 @@ QCMakePropertyList QCMakeCacheModel::properties() const this->getPropertyData(idx, prop); props.append(prop); } - + // go to the next in the tree while(!idxs.isEmpty() && !idxs.last().sibling(idxs.last().row()+1, 0).isValid()) { @@ -503,7 +503,7 @@ QCMakePropertyList QCMakeCacheModel::properties() const return props; } - + bool QCMakeCacheModel::insertProperty(QCMakeProperty::PropertyType t, const QString& name, const QString& description, const QVariant& value, bool advanced) @@ -554,7 +554,7 @@ Qt::ItemFlags QCMakeCacheModel::flags (const QModelIndex& idx) const QModelIndex QCMakeCacheModel::buddy(const QModelIndex& idx) const { - if(!this->hasChildren(idx) && + if(!this->hasChildren(idx) && this->data(idx, TypeRole).toInt() != QCMakeProperty::BOOL) { return this->index(idx.row(), 1, idx.parent()); @@ -572,7 +572,7 @@ void QCMakeCacheModelDelegate::setFileDialogFlag(bool f) this->FileDialogFlag = f; } -QWidget* QCMakeCacheModelDelegate::createEditor(QWidget* p, +QWidget* QCMakeCacheModelDelegate::createEditor(QWidget* p, const QStyleOptionViewItem&, const QModelIndex& idx) const { QModelIndex var = idx.sibling(idx.row(), 0); @@ -584,7 +584,7 @@ QWidget* QCMakeCacheModelDelegate::createEditor(QWidget* p, else if(type == QCMakeProperty::PATH) { QCMakePathEditor* editor = - new QCMakePathEditor(p, + new QCMakePathEditor(p, var.data(Qt::DisplayRole).toString()); QObject::connect(editor, SIGNAL(fileDialogExists(bool)), this, SLOT(setFileDialogFlag(bool))); @@ -593,7 +593,7 @@ QWidget* QCMakeCacheModelDelegate::createEditor(QWidget* p, else if(type == QCMakeProperty::FILEPATH) { QCMakeFilePathEditor* editor = - new QCMakeFilePathEditor(p, + new QCMakeFilePathEditor(p, var.data(Qt::DisplayRole).toString()); QObject::connect(editor, SIGNAL(fileDialogExists(bool)), this, SLOT(setFileDialogFlag(bool))); @@ -602,7 +602,7 @@ QWidget* QCMakeCacheModelDelegate::createEditor(QWidget* p, else if(type == QCMakeProperty::STRING && var.data(QCMakeCacheModel::StringsRole).isValid()) { - QCMakeComboBox* editor = + QCMakeComboBox* editor = new QCMakeComboBox(p, var.data(QCMakeCacheModel::StringsRole).toStringList()); editor->setFrame(false); return editor; @@ -613,7 +613,7 @@ QWidget* QCMakeCacheModelDelegate::createEditor(QWidget* p, return editor; } -bool QCMakeCacheModelDelegate::editorEvent(QEvent* e, QAbstractItemModel* model, +bool QCMakeCacheModelDelegate::editorEvent(QEvent* e, QAbstractItemModel* model, const QStyleOptionViewItem& option, const QModelIndex& index) { Qt::ItemFlags flags = model->flags(index); @@ -637,7 +637,7 @@ bool QCMakeCacheModelDelegate::editorEvent(QEvent* e, QAbstractItemModel* model, { return true; } - } + } else if (e->type() == QEvent::KeyPress) { if(static_cast<QKeyEvent*>(e)->key() != Qt::Key_Space && @@ -645,8 +645,8 @@ bool QCMakeCacheModelDelegate::editorEvent(QEvent* e, QAbstractItemModel* model, { return false; } - } - else + } + else { return false; } @@ -660,7 +660,7 @@ bool QCMakeCacheModelDelegate::editorEvent(QEvent* e, QAbstractItemModel* model, } return success; } - + // Issue 205903 fixed in Qt 4.5.0. // Can remove this function and FileDialogFlag when minimum Qt version is 4.5 bool QCMakeCacheModelDelegate::eventFilter(QObject* object, QEvent* evt) @@ -682,7 +682,7 @@ void QCMakeCacheModelDelegate::setModelData(QWidget* editor, QItemDelegate::setModelData(editor, model, index); const_cast<QCMakeCacheModelDelegate*>(this)->recordChange(model, index); } - + QSize QCMakeCacheModelDelegate::sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const { QSize sz = QItemDelegate::sizeHint(option, index); @@ -695,7 +695,7 @@ QSize QCMakeCacheModelDelegate::sizeHint(const QStyleOptionViewItem& option, con return sz; } - + QSet<QCMakeProperty> QCMakeCacheModelDelegate::changes() const { return mChanges; @@ -721,7 +721,7 @@ void QCMakeCacheModelDelegate::recordChange(QAbstractItemModel* model, const QMo QCMakeProperty prop; idx = idx.sibling(idx.row(), 0); cache_model->getPropertyData(idx, prop); - + // clean out an old one QSet<QCMakeProperty>::iterator iter = mChanges.find(prop); if(iter != mChanges.end()) diff --git a/Source/QtDialog/QCMakeCacheView.h b/Source/QtDialog/QCMakeCacheView.h index 0a628b9..41f0bd8 100644 --- a/Source/QtDialog/QCMakeCacheView.h +++ b/Source/QtDialog/QCMakeCacheView.h @@ -33,7 +33,7 @@ public: // retrieve the QCMakeCacheModel storing all the pointers // this isn't necessarily the model one would get from model() QCMakeCacheModel* cacheModel() const; - + // get whether to show advanced entries bool showAdvanced() const; @@ -65,7 +65,7 @@ public: // roles used to retrieve extra data such has help strings, types of // properties, and the advanced flag enum { HelpRole = Qt::ToolTipRole, - TypeRole = Qt::UserRole, + TypeRole = Qt::UserRole, AdvancedRole, StringsRole, GroupRole @@ -102,7 +102,7 @@ public slots: public: // get the properties QCMakePropertyList properties() const; - + // editing enabled bool editEnabled() const; @@ -112,7 +112,7 @@ public: // return flags (overloaded to modify flag based on EditEnabled flag) Qt::ItemFlags flags (const QModelIndex& index) const; QModelIndex buddy(const QModelIndex& idx) const; - + // get the data in the model for this property void getPropertyData(const QModelIndex& idx1, QCMakeProperty& prop) const; @@ -124,20 +124,20 @@ protected: ViewType View; // set the data in the model for this property - void setPropertyData(const QModelIndex& idx1, + void setPropertyData(const QModelIndex& idx1, const QCMakeProperty& p, bool isNew); // breaks up he property list into groups // where each group has the same prefix up to the first underscore static void breakProperties(const QSet<QCMakeProperty>& props, QMap<QString, QCMakePropertyList>& result); - + // gets the prefix of a string up to the first _ static QString prefix(const QString& s); }; -/// Qt delegate class for interaction (or other customization) +/// Qt delegate class for interaction (or other customization) /// with cache properties class QCMakeCacheModelDelegate : public QItemDelegate { @@ -145,9 +145,9 @@ class QCMakeCacheModelDelegate : public QItemDelegate public: QCMakeCacheModelDelegate(QObject* p); /// create our own editors for cache properties - QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, + QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index ) const; - bool editorEvent (QEvent* event, QAbstractItemModel* model, + bool editorEvent (QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option, const QModelIndex& index); bool eventFilter(QObject* object, QEvent* event); void setModelData(QWidget * editor, QAbstractItemModel * model, const QModelIndex & index ) const; diff --git a/Source/QtDialog/QCMakeWidgets.cxx b/Source/QtDialog/QCMakeWidgets.cxx index 144e1f3..a0c5e17 100644 --- a/Source/QtDialog/QCMakeWidgets.cxx +++ b/Source/QtDialog/QCMakeWidgets.cxx @@ -69,7 +69,7 @@ void QCMakeFilePathEditor::chooseFile() this->fileDialogExists(true); path = QFileDialog::getOpenFileName(this, title, info.absolutePath()); this->fileDialogExists(false); - + if(!path.isEmpty()) { this->setText(QDir::fromNativeSeparators(path)); diff --git a/Source/QtDialog/QMacInstallDialog.cxx b/Source/QtDialog/QMacInstallDialog.cxx index 6eb053b..8b8c531 100644 --- a/Source/QtDialog/QMacInstallDialog.cxx +++ b/Source/QtDialog/QMacInstallDialog.cxx @@ -15,11 +15,11 @@ QMacInstallDialog::QMacInstallDialog(QWidget*w) { this->Internals = new QMacInstallDialogInternals; this->Internals->setupUi(this); - QObject::connect(this->Internals->choosePathButton, SIGNAL(pressed()), + QObject::connect(this->Internals->choosePathButton, SIGNAL(pressed()), this, SLOT(ShowBrowser())); - QObject::connect(this->Internals->skipInstallButton, SIGNAL(pressed()), + QObject::connect(this->Internals->skipInstallButton, SIGNAL(pressed()), this, SLOT(SkipInstall())); - QObject::connect(this->Internals->doInstallButton, SIGNAL(pressed()), + QObject::connect(this->Internals->doInstallButton, SIGNAL(pressed()), this, SLOT(DoInstall())); this->Internals->InstallPrefix->setText("/usr/bin/"); @@ -31,7 +31,7 @@ QMacInstallDialog::~QMacInstallDialog() } void QMacInstallDialog::DoInstall() -{ +{ QDir installDir(this->Internals->InstallPrefix->text()); QString installTo = installDir.path(); if(!cmSystemTools::FileExists(installTo.toLocal8Bit().data())) @@ -42,7 +42,7 @@ void QMacInstallDialog::DoInstall() message += installDir.path(); QString title = tr("Create Directory"); QMessageBox::StandardButton btn; - btn = QMessageBox::information(this, title, message, + btn = QMessageBox::information(this, title, message, QMessageBox::Yes | QMessageBox::No); if(btn == QMessageBox::Yes) { @@ -52,7 +52,7 @@ void QMacInstallDialog::DoInstall() QDir cmExecDir(QApplication::applicationDirPath()); cmExecDir.cd("../bin"); QFileInfoList list = cmExecDir.entryInfoList(); - for (int i = 0; i < list.size(); ++i) + for (int i = 0; i < list.size(); ++i) { QFileInfo fileInfo = list.at(i); QString filename = fileInfo.fileName(); @@ -75,7 +75,7 @@ void QMacInstallDialog::DoInstall() message += newName; QString title = tr("Error Removing file"); QMessageBox::StandardButton btn = - QMessageBox::critical(this, title, message, + QMessageBox::critical(this, title, message, QMessageBox::Ok|QMessageBox::Abort); if(btn == QMessageBox::Abort) { @@ -93,7 +93,7 @@ void QMacInstallDialog::DoInstall() message += newName; QString title = tr("Error Creating Symlink"); QMessageBox::StandardButton btn = - QMessageBox::critical(this, title, message, + QMessageBox::critical(this, title, message, QMessageBox::Ok|QMessageBox::Abort); if(btn == QMessageBox::Abort) { @@ -112,7 +112,7 @@ void QMacInstallDialog::SkipInstall() void QMacInstallDialog::ShowBrowser() { - QString dir = QFileDialog::getExistingDirectory(this, + QString dir = QFileDialog::getExistingDirectory(this, tr("Enter Install Prefix"), this->Internals->InstallPrefix->text()); if(!dir.isEmpty()) { diff --git a/Source/QtDialog/QtDialogCPack.cmake.in b/Source/QtDialog/QtDialogCPack.cmake.in index 701991b..e73e23f 100644 --- a/Source/QtDialog/QtDialogCPack.cmake.in +++ b/Source/QtDialog/QtDialogCPack.cmake.in @@ -2,7 +2,7 @@ SET(IS_APPLE @APPLE@) SET(CMAKE_PACKAGE_QTGUI @CMAKE_PACKAGE_QTGUI@) IF(CMAKE_PACKAGE_QTGUI) - SET(CPACK_PACKAGE_EXECUTABLES "cmake-gui" "CMake (cmake-gui)" ${CPACK_PACKAGE_EXECUTABLES}) + SET(CPACK_PACKAGE_EXECUTABLES "cmake-gui" "CMake (cmake-gui)" ${CPACK_PACKAGE_EXECUTABLES}) SET(CPACK_CREATE_DESKTOP_LINKS "cmake-gui" ${CPACK_CREATE_DESKTOP_LINKS}) IF(IS_APPLE) # for apple install we set the install prefix to diff --git a/Source/cmAddCustomCommandCommand.h b/Source/cmAddCustomCommandCommand.h index 1f770ed..c5252b7 100644 --- a/Source/cmAddCustomCommandCommand.h +++ b/Source/cmAddCustomCommandCommand.h @@ -16,7 +16,7 @@ #include "cmDocumentGeneratorExpressions.h" /** \class cmAddCustomCommandCommand - * \brief + * \brief * * cmAddCustomCommandCommand defines a new command (rule) that can * be executed within the build process @@ -29,7 +29,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmAddCustomCommandCommand; } @@ -45,7 +45,7 @@ public: * The name of the command as specified in CMakeList.txt. */ virtual const char* GetName() const {return "add_custom_command";} - + /** * Succinct documentation. */ @@ -53,7 +53,7 @@ public: { return "Add a custom build rule to the generated build system."; } - + /** * More documentation. */ @@ -177,7 +177,7 @@ public: "is recompiled.\n" ; } - + cmTypeMacro(cmAddCustomCommandCommand, cmCommand); protected: bool CheckOutputs(const std::vector<std::string>& outputs); diff --git a/Source/cmAddCustomTargetCommand.h b/Source/cmAddCustomTargetCommand.h index 50bffef..d4ed450 100644 --- a/Source/cmAddCustomTargetCommand.h +++ b/Source/cmAddCustomTargetCommand.h @@ -27,7 +27,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmAddCustomTargetCommand; } @@ -38,13 +38,13 @@ public: */ virtual bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus &status); - + /** * The name of the command as specified in CMakeList.txt. */ virtual const char* GetName() const {return "add_custom_target";} - + /** * Succinct documentation. */ @@ -52,7 +52,7 @@ public: { return "Add a target with no output so it will always be built."; } - + /** * More documentation. */ @@ -101,7 +101,7 @@ public: "convenience in editing even if they have not build rules." ; } - + cmTypeMacro(cmAddCustomTargetCommand, cmCommand); }; diff --git a/Source/cmAddDependenciesCommand.h b/Source/cmAddDependenciesCommand.h index 14a7741..ed80067 100644 --- a/Source/cmAddDependenciesCommand.h +++ b/Source/cmAddDependenciesCommand.h @@ -25,7 +25,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmAddDependenciesCommand; } @@ -49,7 +49,7 @@ public: { return "Add a dependency between top-level targets."; } - + /** * More documentation. */ @@ -70,7 +70,7 @@ public: "SET_SOURCE_FILES_PROPERTIES to add file-level dependencies to object " "files."; } - + cmTypeMacro(cmAddDependenciesCommand, cmCommand); }; diff --git a/Source/cmAddLibraryCommand.h b/Source/cmAddLibraryCommand.h index b1ae202..b330e68 100644 --- a/Source/cmAddLibraryCommand.h +++ b/Source/cmAddLibraryCommand.h @@ -26,7 +26,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmAddLibraryCommand; } @@ -50,7 +50,7 @@ public: { return "Add a library to the project using the specified source files."; } - + /** * More documentation. */ @@ -134,7 +134,7 @@ public: "Object libraries cannot be imported, exported, installed, or linked." ; } - + cmTypeMacro(cmAddLibraryCommand, cmCommand); }; diff --git a/Source/cmAddSubDirectoryCommand.cxx b/Source/cmAddSubDirectoryCommand.cxx index 5fca527..9efeda4 100644 --- a/Source/cmAddSubDirectoryCommand.cxx +++ b/Source/cmAddSubDirectoryCommand.cxx @@ -20,11 +20,11 @@ bool cmAddSubDirectoryCommand::InitialPass this->SetError("called with incorrect number of arguments"); return false; } - + // store the binpath std::string srcArg = args[0]; std::string binArg; - + bool excludeFromAll = false; // process the rest of the arguments looking for optional args diff --git a/Source/cmAddSubDirectoryCommand.h b/Source/cmAddSubDirectoryCommand.h index 3d6f51e..fa322b0 100644 --- a/Source/cmAddSubDirectoryCommand.h +++ b/Source/cmAddSubDirectoryCommand.h @@ -27,7 +27,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmAddSubDirectoryCommand; } @@ -51,7 +51,7 @@ public: { return "Add a subdirectory to the build."; } - + /** * More documentation. */ @@ -90,7 +90,7 @@ public: "project build system to satisfy the dependency." ; } - + cmTypeMacro(cmAddSubDirectoryCommand, cmCommand); }; diff --git a/Source/cmAddTestCommand.h b/Source/cmAddTestCommand.h index 59f10f6..b11bff9 100644 --- a/Source/cmAddTestCommand.h +++ b/Source/cmAddTestCommand.h @@ -26,7 +26,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmAddTestCommand; } @@ -50,7 +50,7 @@ public: { return "Add a test to the project with the specified arguments."; } - + /** * More documentation. */ @@ -91,7 +91,7 @@ public: "executable file produced by target \"myexe\"." ; } - + cmTypeMacro(cmAddTestCommand, cmCommand); private: bool HandleNameMode(std::vector<std::string> const& args); diff --git a/Source/cmAuxSourceDirectoryCommand.cxx b/Source/cmAuxSourceDirectoryCommand.cxx index f88be3d..01f64b7 100644 --- a/Source/cmAuxSourceDirectoryCommand.cxx +++ b/Source/cmAuxSourceDirectoryCommand.cxx @@ -23,7 +23,7 @@ bool cmAuxSourceDirectoryCommand::InitialPass this->SetError("called with incorrect number of arguments"); return false; } - + std::string sourceListValue; std::string templateDirectory = args[0]; this->Makefile->AddExtraDirectory(templateDirectory.c_str()); @@ -40,12 +40,12 @@ bool cmAuxSourceDirectoryCommand::InitialPass } // was the list already populated - const char *def = this->Makefile->GetDefinition(args[1].c_str()); + const char *def = this->Makefile->GetDefinition(args[1].c_str()); if (def) { sourceListValue = def; } - + // Load all the files in the directory cmsys::Directory dir; if(dir.Load(tdir.c_str())) @@ -69,7 +69,7 @@ bool cmAuxSourceDirectoryCommand::InitialPass std::string fullname = templateDirectory; fullname += "/"; fullname += file; - // add the file as a class file so + // add the file as a class file so // depends can be done cmSourceFile* sf = this->Makefile->GetOrCreateSource(fullname.c_str()); @@ -83,7 +83,7 @@ bool cmAuxSourceDirectoryCommand::InitialPass } } } - this->Makefile->AddDefinition(args[1].c_str(), sourceListValue.c_str()); + this->Makefile->AddDefinition(args[1].c_str(), sourceListValue.c_str()); return true; } diff --git a/Source/cmAuxSourceDirectoryCommand.h b/Source/cmAuxSourceDirectoryCommand.h index f059e44..8a70f19 100644 --- a/Source/cmAuxSourceDirectoryCommand.h +++ b/Source/cmAuxSourceDirectoryCommand.h @@ -29,7 +29,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmAuxSourceDirectoryCommand; } @@ -45,7 +45,7 @@ public: * The name of the command as specified in CMakeList.txt. */ virtual const char* GetName() const { return "aux_source_directory";} - + /** * Succinct documentation. */ @@ -53,7 +53,7 @@ public: { return "Find all source files in a directory."; } - + /** * More documentation. */ @@ -77,7 +77,7 @@ public: "one would have to manually rerun CMake to generate a build system " "incorporating the new file."; } - + cmTypeMacro(cmAuxSourceDirectoryCommand, cmCommand); }; diff --git a/Source/cmBreakCommand.h b/Source/cmBreakCommand.h index 67ef37e..17f57cf 100644 --- a/Source/cmBreakCommand.h +++ b/Source/cmBreakCommand.h @@ -25,7 +25,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmBreakCommand; } @@ -46,7 +46,7 @@ public: * The name of the command as specified in CMakeList.txt. */ virtual const char* GetName() const {return "break";} - + /** * Succinct documentation. */ @@ -54,7 +54,7 @@ public: { return "Break from an enclosing foreach or while loop."; } - + /** * More documentation. */ @@ -64,7 +64,7 @@ public: " break()\n" "Breaks from an enclosing foreach loop or while loop"; } - + cmTypeMacro(cmBreakCommand, cmCommand); }; diff --git a/Source/cmBuildCommand.h b/Source/cmBuildCommand.h index a333c5d..1bab453 100644 --- a/Source/cmBuildCommand.h +++ b/Source/cmBuildCommand.h @@ -25,7 +25,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmBuildCommand; } diff --git a/Source/cmBuildNameCommand.cxx b/Source/cmBuildNameCommand.cxx index fa69830..f95a79e 100644 --- a/Source/cmBuildNameCommand.cxx +++ b/Source/cmBuildNameCommand.cxx @@ -25,7 +25,7 @@ bool cmBuildNameCommand const char* cacheValue = this->Makefile->GetDefinition(args[0].c_str()); if(cacheValue) { - // do we need to correct the value? + // do we need to correct the value? cmsys::RegularExpression reg("[()/]"); if (reg.find(cacheValue)) { @@ -41,7 +41,7 @@ bool cmBuildNameCommand return true; } - + std::string buildname = "WinNT"; if(this->Makefile->GetDefinition("UNIX")) { @@ -67,7 +67,7 @@ bool cmBuildNameCommand "(", "_"); cmSystemTools::ReplaceString(buildname, ")", "_"); - + this->Makefile->AddCacheDefinition(args[0].c_str(), buildname.c_str(), "Name of build.", diff --git a/Source/cmCMakeMinimumRequired.cxx b/Source/cmCMakeMinimumRequired.cxx index 126934c..49c585f 100644 --- a/Source/cmCMakeMinimumRequired.cxx +++ b/Source/cmCMakeMinimumRequired.cxx @@ -120,7 +120,7 @@ bool cmCMakeMinimumRequired { this->Makefile->SetPolicyVersion(version_string.c_str()); } - + return true; } diff --git a/Source/cmCMakeMinimumRequired.h b/Source/cmCMakeMinimumRequired.h index d23ce79..acf2829 100644 --- a/Source/cmCMakeMinimumRequired.h +++ b/Source/cmCMakeMinimumRequired.h @@ -25,7 +25,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmCMakeMinimumRequired; } @@ -46,7 +46,7 @@ public: * The name of the command as specified in CMakeList.txt. */ virtual const char* GetName() const {return "cmake_minimum_required";} - + /** * Succinct documentation. */ @@ -54,7 +54,7 @@ public: { return "Set the minimum required version of cmake for a project."; } - + /** * More documentation. */ @@ -77,7 +77,7 @@ public: "It should be specified so CMake versions 2.4 and lower fail with an " "error instead of just a warning."; } - + cmTypeMacro(cmCMakeMinimumRequired, cmCommand); private: diff --git a/Source/cmCMakePolicyCommand.h b/Source/cmCMakePolicyCommand.h index 4f1ed36..4f9faa1 100644 --- a/Source/cmCMakePolicyCommand.h +++ b/Source/cmCMakePolicyCommand.h @@ -17,8 +17,8 @@ /** \class cmCMakePolicyCommand * \brief Set how CMake should handle policies * - * cmCMakePolicyCommand sets how CMake should deal with backwards - * compatibility policies. + * cmCMakePolicyCommand sets how CMake should deal with backwards + * compatibility policies. */ class cmCMakePolicyCommand : public cmCommand { @@ -26,7 +26,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmCMakePolicyCommand; } @@ -47,7 +47,7 @@ public: * The name of the command as specified in CMakeList.txt. */ virtual const char* GetName() const {return "cmake_policy";} - + /** * Succinct documentation. */ @@ -55,7 +55,7 @@ public: { return "Manage CMake Policy settings."; } - + /** * More documentation. */ @@ -129,7 +129,7 @@ public: "closest nested policy stack entry." ; } - + cmTypeMacro(cmCMakePolicyCommand, cmCommand); private: bool HandleSetMode(std::vector<std::string> const& args); diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index e237913..48ae50e 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -389,7 +389,7 @@ void CCONV cmAddLibrary(void *arg, const char *libname, int shared, { srcs2.push_back(srcs[i]); } - mf->AddLibrary(libname, + mf->AddLibrary(libname, (shared? cmTarget::SHARED_LIBRARY : cmTarget::STATIC_LIBRARY), srcs2); } @@ -859,13 +859,13 @@ void CCONV cmFree(void *data) } void CCONV DefineSourceFileProperty (void *arg, const char *name, - const char *briefDocs, + const char *briefDocs, const char *longDocs, int chained) { cmMakefile *mf = static_cast<cmMakefile *>(arg); mf->GetCMakeInstance()->DefineProperty(name,cmProperty::SOURCE_FILE, - briefDocs, longDocs, + briefDocs, longDocs, chained != 0); } diff --git a/Source/cmCPluginAPI.h b/Source/cmCPluginAPI.h index fd5a4f8..5c832c3 100644 --- a/Source/cmCPluginAPI.h +++ b/Source/cmCPluginAPI.h @@ -168,10 +168,10 @@ typedef struct /* new functions added after 2.4 */ void *(CCONV *CreateNewSourceFile) (void *mf); void (CCONV *DefineSourceFileProperty) (void *mf, const char *name, - const char *briefDocs, + const char *briefDocs, const char *longDocs, int chained); - + /* this is the end of the C function stub API structure */ } cmCAPI; diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index b5687e3..a6d04b7 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -75,8 +75,8 @@ struct tm* cmCTest::GetNightlyTime(std::string str, char buf[1024]; // add todays year day and month to the time in str because // curl_getdate no longer assumes the day is today - sprintf(buf, "%d%02d%02d %s", - lctime->tm_year+1900, + sprintf(buf, "%d%02d%02d %s", + lctime->tm_year+1900, lctime->tm_mon +1, lctime->tm_mday, str.c_str()); @@ -223,7 +223,7 @@ int cmCTest::HTTPRequest(std::string url, HTTPMethod method, default: break; } - + ::curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); ::curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeout); ::curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); @@ -237,7 +237,7 @@ int cmCTest::HTTPRequest(std::string url, HTTPMethod method, ::curl_easy_cleanup(curl); ::curl_global_cleanup(); - + return static_cast<int>(res); } #endif @@ -300,7 +300,7 @@ cmCTest::cmCTest() this->ForceNewCTestProcess = false; this->TomorrowTag = false; this->Verbose = false; - + this->Debug = false; this->ShowLineNumbers = false; this->Quiet = false; @@ -760,7 +760,7 @@ bool cmCTest::UpdateCTestConfiguration() } else { - cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "Parse Config file:" + cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "Parse Config file:" << fileName.c_str() << "\n"); // parse the dart test file std::ifstream fin(fileName.c_str()); @@ -944,7 +944,7 @@ bool cmCTest::AddIfExists(Part part, const char* file) //---------------------------------------------------------------------- bool cmCTest::CTestFileExists(const std::string& filename) { - std::string testingDir = this->BinaryDir + "/Testing/" + + std::string testingDir = this->BinaryDir + "/Testing/" + this->CurrentTag + "/" + filename; return cmSystemTools::FileExists(testingDir.c_str()); } @@ -952,7 +952,7 @@ bool cmCTest::CTestFileExists(const std::string& filename) //---------------------------------------------------------------------- cmCTestGenericHandler* cmCTest::GetInitializedHandler(const char* handler) { - cmCTest::t_TestingHandlers::iterator it = + cmCTest::t_TestingHandlers::iterator it = this->TestingHandlers.find(handler); if ( it == this->TestingHandlers.end() ) { @@ -965,7 +965,7 @@ cmCTestGenericHandler* cmCTest::GetInitializedHandler(const char* handler) //---------------------------------------------------------------------- cmCTestGenericHandler* cmCTest::GetHandler(const char* handler) { - cmCTest::t_TestingHandlers::iterator it = + cmCTest::t_TestingHandlers::iterator it = this->TestingHandlers.find(handler); if ( it == this->TestingHandlers.end() ) { @@ -1314,8 +1314,8 @@ int cmCTest::RunTest(std::vector<const char*> argv, { if(argv[i]) { - // make sure we pass the timeout in for any build and test - // invocations. Since --build-generator is required this is a + // make sure we pass the timeout in for any build and test + // invocations. Since --build-generator is required this is a // good place to check for it, and to add the arguments in if (strcmp(argv[i],"--build-generator") == 0 && timeout > 0) { @@ -1524,18 +1524,18 @@ void cmCTest::StartXML(std::ostream& ostr, bool append) << "\tNumberOfPhysicalCPU=\""<< info.GetNumberOfPhysicalCPU() << "\"\n" << "\tTotalVirtualMemory=\"" << info.GetTotalVirtualMemory() << "\"\n" << "\tTotalPhysicalMemory=\""<< info.GetTotalPhysicalMemory() << "\"\n" - << "\tLogicalProcessorsPerPhysical=\"" + << "\tLogicalProcessorsPerPhysical=\"" << info.GetLogicalProcessorsPerPhysical() << "\"\n" - << "\tProcessorClockFrequency=\"" - << info.GetProcessorClockFrequency() << "\"\n" + << "\tProcessorClockFrequency=\"" + << info.GetProcessorClockFrequency() << "\"\n" << ">" << std::endl; - this->AddSiteProperties(ostr); + this->AddSiteProperties(ostr); } //---------------------------------------------------------------------- void cmCTest::AddSiteProperties(std::ostream& ostr) { - cmCTestScriptHandler* ch = + cmCTestScriptHandler* ch = static_cast<cmCTestScriptHandler*>(this->GetHandler("script")); cmake* cm = ch->GetCMake(); // if no CMake then this is the old style script and props like @@ -1547,9 +1547,9 @@ void cmCTest::AddSiteProperties(std::ostream& ostr) // This code should go when cdash is changed to use labels only const char* subproject = cm->GetProperty("SubProject", cmProperty::GLOBAL); if(subproject) - { + { ostr << "<Subproject name=\"" << subproject << "\">\n"; - const char* labels = + const char* labels = ch->GetCMake()->GetProperty("SubProjectLabels", cmProperty::GLOBAL); if(labels) { @@ -1566,11 +1566,11 @@ void cmCTest::AddSiteProperties(std::ostream& ostr) } ostr << "</Subproject>\n"; } - + // This code should stay when cdash only does label based sub-projects const char* label = cm->GetProperty("Label", cmProperty::GLOBAL); if(label) - { + { ostr << "<Labels>\n"; ostr << " <Label>" << label << "</Label>\n"; ostr << "</Labels>\n"; @@ -1762,7 +1762,7 @@ bool cmCTest::SubmitExtraFiles(const char* cfiles) //------------------------------------------------------- -// for a -D argument convert the next argument into +// for a -D argument convert the next argument into // the proper list of dashboard steps via SetTest bool cmCTest::AddTestsForDashboardType(std::string &targ) { @@ -1980,9 +1980,9 @@ bool cmCTest::CheckArgument(const std::string& arg, const char* varg1, //---------------------------------------------------------------------- -// Processes one command line argument (and its arguments if any) +// Processes one command line argument (and its arguments if any) // for many simple options and then returns -void cmCTest::HandleCommandLineArguments(size_t &i, +void cmCTest::HandleCommandLineArguments(size_t &i, std::vector<std::string> &args) { std::string arg = args[i]; @@ -2031,14 +2031,14 @@ void cmCTest::HandleCommandLineArguments(size_t &i, i++; this->SetStopTime(args[i]); } - + if(this->CheckArgument(arg, "-C", "--build-config") && i < args.size() - 1) { i++; this->SetConfigType(args[i].c_str()); } - + if(this->CheckArgument(arg, "--debug")) { this->Debug = true; @@ -2078,7 +2078,7 @@ void cmCTest::HandleCommandLineArguments(size_t &i, { this->OutputTestOutputOnTestFailure = true; } - + if(this->CheckArgument(arg, "-N", "--show-only")) { this->ShowOnly = true; @@ -2118,7 +2118,7 @@ void cmCTest::HandleCommandLineArguments(size_t &i, this->SubmitIndex = 0; } } - + if(this->CheckArgument(arg, "--overwrite") && i < args.size() - 1) { i++; @@ -2171,7 +2171,7 @@ void cmCTest::HandleCommandLineArguments(size_t &i, this->GetHandler("memcheck")-> SetPersistentOption("ExcludeLabelRegularExpression", args[i].c_str()); } - + if(this->CheckArgument(arg, "-E", "--exclude-regex") && i < args.size() - 1) { @@ -2180,17 +2180,17 @@ void cmCTest::HandleCommandLineArguments(size_t &i, SetPersistentOption("ExcludeRegularExpression", args[i].c_str()); this->GetHandler("memcheck")-> SetPersistentOption("ExcludeRegularExpression", args[i].c_str()); - } + } } //---------------------------------------------------------------------- // handle the -S -SR and -SP arguments -void cmCTest::HandleScriptArguments(size_t &i, +void cmCTest::HandleScriptArguments(size_t &i, std::vector<std::string> &args, bool &SRArgumentSpecified) { std::string arg = args[i]; - if(this->CheckArgument(arg, "-SP", "--script-new-process") && + if(this->CheckArgument(arg, "-SP", "--script-new-process") && i < args.size() - 1 ) { this->RunConfigurationScript = true; @@ -2203,8 +2203,8 @@ void cmCTest::HandleScriptArguments(size_t &i, ch->AddConfigurationScript(args[i].c_str(),false); } } - - if(this->CheckArgument(arg, "-SR", "--script-run") && + + if(this->CheckArgument(arg, "-SR", "--script-run") && i < args.size() - 1 ) { SRArgumentSpecified = true; @@ -2214,7 +2214,7 @@ void cmCTest::HandleScriptArguments(size_t &i, = static_cast<cmCTestScriptHandler*>(this->GetHandler("script")); ch->AddConfigurationScript(args[i].c_str(),true); } - + if(this->CheckArgument(arg, "-S", "--script") && i < args.size() - 1 ) { this->RunConfigurationScript = true; @@ -2396,7 +2396,7 @@ int cmCTest::Run(std::vector<std::string> &args, std::string* output) } // the close of the for argument loop - // now what sould cmake do? if --build-and-test was specified then + // now what sould cmake do? if --build-and-test was specified then // we run the build and test handler and return if(cmakeAndTest) { @@ -2410,7 +2410,7 @@ int cmCTest::Run(std::vector<std::string> &args, std::string* output) #endif if(retv != 0) { - cmCTestLog(this, DEBUG, "build and test failing returing: " << retv + cmCTestLog(this, DEBUG, "build and test failing returing: " << retv << std::endl); } return retv; @@ -2438,14 +2438,14 @@ int cmCTest::Run(std::vector<std::string> &args, std::string* output) res = this->GetHandler("script")->ProcessHandler(); if(res != 0) { - cmCTestLog(this, DEBUG, "running script failing returning: " << res + cmCTestLog(this, DEBUG, "running script failing returning: " << res << std::endl); } } else { - // What is this? -V seems to be the same as -VV, + // What is this? -V seems to be the same as -VV, // and Verbose is always on in this case this->ExtraVerbose = this->Verbose; this->Verbose = true; @@ -2472,7 +2472,7 @@ int cmCTest::Run(std::vector<std::string> &args, std::string* output) } if(res != 0) { - cmCTestLog(this, DEBUG, "Running a test(s) failed returning : " << res + cmCTestLog(this, DEBUG, "Running a test(s) failed returning : " << res << std::endl); } return res; diff --git a/Source/cmCTest.h b/Source/cmCTest.h index beffe9e..f2638fe 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -93,7 +93,7 @@ public: */ static int HTTPRequest(std::string url, HTTPMethod method, std::string& response, - std::string fields = "", + std::string fields = "", std::string putFile = "", int timeout = 0); #endif @@ -198,13 +198,13 @@ public: //! base64 encode a file std::string Base64EncodeFile(std::string file); - /** + /** * Return the time remaining that the script is allowed to run in * seconds if the user has set the variable CTEST_TIME_LIMIT. If that has * not been set it returns 1e7 seconds */ double GetRemainingTimeAllowed(); - + ///! Open file in the output directory and set the stream bool OpenOutputFile(const std::string& path, const std::string& name, @@ -529,11 +529,11 @@ private: bool AddVariableDefinition(const std::string &arg); //! parse and process most common command line arguments - void HandleCommandLineArguments(size_t &i, + void HandleCommandLineArguments(size_t &i, std::vector<std::string> &args); //! hande the -S -SP and -SR arguments - void HandleScriptArguments(size_t &i, + void HandleScriptArguments(size_t &i, std::vector<std::string> &args, bool &SRArgumentSpecified); diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index 47a0e85..4231243 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -267,7 +267,7 @@ bool cmCacheManager::LoadCache(const char* path, // If the entry is not internal to the cache being loaded // or if it is in the list of internal entries to be // imported, load it. - if ( internal || (e.Type != INTERNAL) || + if ( internal || (e.Type != INTERNAL) || (includes.find(entryKey) != includes.end()) ) { // If we are loading the cache from another project, @@ -478,7 +478,7 @@ bool cmCacheManager::SaveCache(const char* path) = this->GetCacheEntry("CMAKE_COMMAND"); if ( cmakeCacheEntry ) { - fout << "# It was generated by CMake: " << + fout << "# It was generated by CMake: " << cmakeCacheEntry->Value << std::endl; } @@ -500,10 +500,10 @@ bool cmCacheManager::SaveCache(const char* path) fout << "########################\n"; fout << "\n"; - for( std::map<cmStdString, CacheEntry>::const_iterator i = + for( std::map<cmStdString, CacheEntry>::const_iterator i = this->Cache.begin(); i != this->Cache.end(); ++i) { - const CacheEntry& ce = (*i).second; + const CacheEntry& ce = (*i).second; CacheEntryType t = ce.Type; if(!ce.Initialized) { @@ -641,7 +641,7 @@ void cmCacheManager::OutputHelpString(std::ostream& fout, std::string::size_type pos = 0; for (std::string::size_type i=0; i<=end; i++) { - if ((i==end) + if ((i==end) || (helpString[i]=='\n') || ((i-pos >= 60) && (helpString[i]==' '))) { @@ -700,12 +700,12 @@ void cmCacheManager::PrintCache(std::ostream& out) const { out << "=================================================" << std::endl; out << "CMakeCache Contents:" << std::endl; - for(std::map<cmStdString, CacheEntry>::const_iterator i = + for(std::map<cmStdString, CacheEntry>::const_iterator i = this->Cache.begin(); i != this->Cache.end(); ++i) { if((*i).second.Type != INTERNAL) { - out << (*i).first.c_str() << " = " << (*i).second.Value.c_str() + out << (*i).first.c_str() << " = " << (*i).second.Value.c_str() << std::endl; } } @@ -768,7 +768,7 @@ bool cmCacheManager::CacheIterator::IsAtEnd() const void cmCacheManager::CacheIterator::Begin() { - this->Position = this->Container.Cache.begin(); + this->Position = this->Container.Cache.begin(); } bool cmCacheManager::CacheIterator::Find(const char* key) @@ -781,7 +781,7 @@ void cmCacheManager::CacheIterator::Next() { if (!this->IsAtEnd()) { - ++this->Position; + ++this->Position; } } diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index 9c94d21..4a5ee45 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -22,7 +22,7 @@ class cmake; * \brief Control class for cmake's cache * * Load and Save CMake cache files. - * + * */ class cmCacheManager { @@ -30,7 +30,7 @@ public: cmCacheManager(cmake* cm); class CacheIterator; friend class cmCacheManager::CacheIterator; - enum CacheEntryType{ BOOL=0, PATH, FILEPATH, STRING, INTERNAL,STATIC, + enum CacheEntryType{ BOOL=0, PATH, FILEPATH, STRING, INTERNAL,STATIC, UNINITIALIZED }; private: @@ -57,7 +57,7 @@ public: bool IsAtEnd() const; void Next(); const char *GetName() const { - return this->Position->first.c_str(); } + return this->Position->first.c_str(); } const char* GetProperty(const char*) const ; bool GetPropertyAsBool(const char*) const ; bool PropertyExists(const char*) const; @@ -76,7 +76,7 @@ public: CacheIterator(cmCacheManager &cm) : Container(cm) { this->Begin(); } - CacheIterator(cmCacheManager &cm, const char* key) : Container(cm) + CacheIterator(cmCacheManager &cm, const char* key) : Container(cm) { if ( key ) { @@ -87,30 +87,30 @@ public: CacheEntry const& GetEntry() const { return this->Position->second; } CacheEntry& GetEntry() { return this->Position->second; } }; - + ///! return an iterator to iterate through the cache map - cmCacheManager::CacheIterator NewIterator() + cmCacheManager::CacheIterator NewIterator() { return CacheIterator(*this); - } - + } + /** * Types for the cache entries. These are useful as * hints for a cache editor program. Path should bring - * up a file chooser, BOOL a check box, and STRING a + * up a file chooser, BOOL a check box, and STRING a * text entry box, FILEPATH is a full path to a file which * can be different than just a path input */ static CacheEntryType StringToType(const char*); static const char* TypeToString(CacheEntryType); static bool IsType(const char*); - + ///! Load a cache for given makefile. Loads from ouput home. - bool LoadCache(cmMakefile*); + bool LoadCache(cmMakefile*); ///! Load a cache for given makefile. Loads from path/CMakeCache.txt. bool LoadCache(const char* path); bool LoadCache(const char* path, bool internal); - bool LoadCache(const char* path, bool internal, + bool LoadCache(const char* path, bool internal, std::set<cmStdString>& excludes, std::set<cmStdString>& includes); @@ -124,19 +124,19 @@ public: ///! Print the cache to a stream void PrintCache(std::ostream&) const; - + ///! Get the iterator for an entry with a given key. cmCacheManager::CacheIterator GetCacheIterator(const char *key=0); - + ///! Remove an entry from the cache void RemoveCacheEntry(const char* key); - + ///! Get the number of entries in the cache int GetSize() { return static_cast<int>(this->Cache.size()); } - + ///! Break up a line like VAR:type="value" into var, type and value - static bool ParseEntry(const char* entry, + static bool ParseEntry(const char* entry, std::string& var, std::string& value, CacheEntryType& type); @@ -154,7 +154,7 @@ public: protected: ///! Add an entry into the cache - void AddCacheEntry(const char* key, const char* value, + void AddCacheEntry(const char* key, const char* value, const char* helpString, CacheEntryType type); ///! Get a cache entry object for a key diff --git a/Source/cmCommand.h b/Source/cmCommand.h index 4faaee3..49f451b 100644 --- a/Source/cmCommand.h +++ b/Source/cmCommand.h @@ -23,8 +23,8 @@ * cmCommand is the base class for all commands in CMake. A command * manifests as an entry in CMakeLists.txt and produces one or * more makefile rules. Commands are associated with a particular - * makefile. This base class cmCommand defines the API for commands - * to support such features as enable/disable, inheritance, + * makefile. This base class cmCommand defines the API for commands + * to support such features as enable/disable, inheritance, * documentation, and construction. */ class cmCommand : public cmObject @@ -35,18 +35,18 @@ public: /** * Construct the command. By default it is enabled with no makefile. */ - cmCommand() + cmCommand() {this->Makefile = 0; this->Enabled = true;} /** * Need virtual destructor to destroy real command type. */ virtual ~cmCommand() {} - + /** * Specify the makefile. */ - void SetMakefile(cmMakefile*m) + void SetMakefile(cmMakefile*m) {this->Makefile = m; } cmMakefile* GetMakefile() { return this->Makefile; } @@ -87,12 +87,12 @@ public: * Does this command have a final pass? Query after InitialPass. */ virtual bool HasFinalPass() const { return false; } - + /** * This is a virtual constructor for the command. */ virtual cmCommand* Clone() = 0; - + /** * This determines if the command is invoked when in script mode. */ @@ -139,13 +139,13 @@ public: /** * Enable the command. */ - void EnabledOn() + void EnabledOn() {this->Enabled = true;} /** * Disable the command. */ - void EnabledOff() + void EnabledOff() {this->Enabled = false;} /** @@ -157,13 +157,13 @@ public: /** * Disable or enable the command. */ - void SetEnabled(bool enabled) + void SetEnabled(bool enabled) {this->Enabled = enabled;} /** * Return the last error string. */ - const char* GetError() + const char* GetError() { if(this->Error.length() == 0) { diff --git a/Source/cmCommandArgumentLexer.h b/Source/cmCommandArgumentLexer.h index 828122b..2ea3fa2 100644 --- a/Source/cmCommandArgumentLexer.h +++ b/Source/cmCommandArgumentLexer.h @@ -45,7 +45,7 @@ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -62,7 +62,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; @@ -192,7 +192,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ diff --git a/Source/cmCommandArgumentLexer.in.l b/Source/cmCommandArgumentLexer.in.l index d10e50d..fdca61b 100644 --- a/Source/cmCommandArgumentLexer.in.l +++ b/Source/cmCommandArgumentLexer.in.l @@ -66,43 +66,43 @@ Modify cmCommandArgumentLexer.h: return cal_ENVCURLY; } -\$[A-Za-z0-9/_.+-]+\{ { +\$[A-Za-z0-9/_.+-]+\{ { //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl; - yyextra->AllocateParserType(yylvalp, yytext+1, strlen(yytext)-2); - return cal_NCURLY; -} + yyextra->AllocateParserType(yylvalp, yytext+1, strlen(yytext)-2); + return cal_NCURLY; +} -@[A-Za-z0-9/_.+-]+@ { +@[A-Za-z0-9/_.+-]+@ { //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl; - yyextra->AllocateParserType(yylvalp, yytext+1, strlen(yytext)-2); - return cal_ATNAME; -} + yyextra->AllocateParserType(yylvalp, yytext+1, strlen(yytext)-2); + return cal_ATNAME; +} "${" { //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl; - //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); + //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); yylvalp->str = yyextra->DCURLYVariable; return cal_DCURLY; } "}" { //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl; - //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); + //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); yylvalp->str = yyextra->RCURLYVariable; return cal_RCURLY; } "@" { //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl; - //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); + //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); yylvalp->str = yyextra->ATVariable; return cal_AT; } -[A-Za-z0-9/_.+-]+ { +[A-Za-z0-9/_.+-]+ { //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl; - yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); - return cal_NAME; + yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); + return cal_NAME; } <ESCAPES>\\. { @@ -110,31 +110,31 @@ Modify cmCommandArgumentLexer.h: { return cal_ERROR; } - return cal_SYMBOL; + return cal_SYMBOL; } -[^\${}\\@]+ { +[^\${}\\@]+ { //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl; - yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); - return cal_SYMBOL; + yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); + return cal_SYMBOL; } "$" { - //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); + //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); yylvalp->str = yyextra->DOLLARVariable; - return cal_DOLLAR; + return cal_DOLLAR; } "{" { - //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); + //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); yylvalp->str = yyextra->LCURLYVariable; - return cal_LCURLY; + return cal_LCURLY; } <ESCAPES>"\\" { - //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); + //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); yylvalp->str = yyextra->BSLASHVariable; - return cal_BSLASH; + return cal_BSLASH; } <NOESCAPES>"\\" { diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx index a781767..2f26b0c 100644 --- a/Source/cmCommandArgumentParserHelper.cxx +++ b/Source/cmCommandArgumentParserHelper.cxx @@ -61,7 +61,7 @@ char* cmCommandArgumentParserHelper::AddString(const char* str) return stVal; } -char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key, +char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key, const char* var) { if ( !key ) @@ -163,7 +163,7 @@ char* cmCommandArgumentParserHelper::ExpandVariableForAt(const char* var) // try to expand the variable char* ret = this->ExpandVariable(var); // if the return was 0 and we want to replace empty strings - // then return an empty string + // then return an empty string if(!ret && this->RemoveEmpty) { return this->AddString(ret); @@ -175,7 +175,7 @@ char* cmCommandArgumentParserHelper::ExpandVariableForAt(const char* var) } } // at this point we want to put it back because of one of these cases: - // - this->ReplaceAtSyntax is false + // - this->ReplaceAtSyntax is false // - this->ReplaceAtSyntax is true, but this->RemoveEmpty is false, // and the variable was not defined std::string ref = "@"; @@ -274,7 +274,7 @@ int cmCommandArgumentParserHelper::ParseString(const char* str, int verb) this->InputBuffer = str; this->InputBufferPos = 0; this->CurrentLine = 0; - + this->Result = ""; yyscan_t yyscanner; @@ -292,7 +292,7 @@ int cmCommandArgumentParserHelper::ParseString(const char* str, int verb) if ( Verbose ) { - std::cerr << "Expanding [" << str << "] produced: [" + std::cerr << "Expanding [" << str << "] produced: [" << this->Result.c_str() << "]" << std::endl; } return 1; diff --git a/Source/cmCommandArgumentParserHelper.h b/Source/cmCommandArgumentParserHelper.h index cdb832b..f8c672f 100644 --- a/Source/cmCommandArgumentParserHelper.h +++ b/Source/cmCommandArgumentParserHelper.h @@ -66,8 +66,8 @@ public: void SetNoEscapeMode(bool b) { this->NoEscapeMode = b; } void SetReplaceAtSyntax(bool b) { this->ReplaceAtSyntax = b; } void SetRemoveEmpty(bool b) { this->RemoveEmpty = b; } - - const char* GetError() { return this->ErrorString.c_str(); } + + const char* GetError() { return this->ErrorString.c_str(); } char EmptyVariable[1]; char DCURLYVariable[3]; char RCURLYVariable[3]; @@ -102,7 +102,7 @@ private: std::string ErrorString; bool NoEscapeMode; bool ReplaceAtSyntax; - bool RemoveEmpty; + bool RemoveEmpty; }; #endif diff --git a/Source/cmCommandArgumentsHelper.cxx b/Source/cmCommandArgumentsHelper.cxx index d920137..1d5fc07 100644 --- a/Source/cmCommandArgumentsHelper.cxx +++ b/Source/cmCommandArgumentsHelper.cxx @@ -12,20 +12,20 @@ #include "cmCommandArgumentsHelper.h" -cmCommandArgument::cmCommandArgument(cmCommandArgumentsHelper* args, - const char* key, +cmCommandArgument::cmCommandArgument(cmCommandArgumentsHelper* args, + const char* key, cmCommandArgumentGroup* group) :Key(key) ,Group(group) ,WasActive(false) ,ArgumentsBeforeEmpty(true) -,CurrentIndex(0) +,CurrentIndex(0) { if (args!=0) { args->AddArgument(this); } - + if (this->Group!=0) { this->Group->ContainedArguments.push_back(this); @@ -50,7 +50,7 @@ void cmCommandArgument::FollowsGroup(const cmCommandArgumentGroup* group) if (group!=0) { this->ArgumentsBeforeEmpty = false; - for(std::vector<cmCommandArgument*>::const_iterator + for(std::vector<cmCommandArgument*>::const_iterator argIt= group->ContainedArguments.begin(); argIt != group->ContainedArguments.end(); ++argIt) @@ -67,7 +67,7 @@ bool cmCommandArgument::MayFollow(const cmCommandArgument* current) const return true; } - std::set<const cmCommandArgument*>::const_iterator argIt + std::set<const cmCommandArgument*>::const_iterator argIt = this->ArgumentsBefore.find(current); if (argIt != this->ArgumentsBefore.end()) { @@ -90,7 +90,7 @@ void cmCommandArgument::ApplyOwnGroup() { if (this->Group!=0) { - for (std::vector<cmCommandArgument*>::const_iterator + for (std::vector<cmCommandArgument*>::const_iterator it = this->Group->ContainedArguments.begin(); it != this->Group->ContainedArguments.end(); ++it) @@ -105,7 +105,7 @@ void cmCommandArgument::ApplyOwnGroup() void cmCommandArgument::Activate() { - this->WasActive = true; + this->WasActive = true; this->CurrentIndex = 0; } @@ -117,8 +117,8 @@ bool cmCommandArgument::Consume(const std::string& arg) } -cmCAStringVector::cmCAStringVector(cmCommandArgumentsHelper* args, - const char* key, +cmCAStringVector::cmCAStringVector(cmCommandArgumentsHelper* args, + const char* key, cmCommandArgumentGroup* group) :cmCommandArgument(args, key, group) ,Ignore(0) @@ -151,8 +151,8 @@ void cmCAStringVector::DoReset() this->Vector.clear(); } -cmCAString::cmCAString(cmCommandArgumentsHelper* args, - const char* key, +cmCAString::cmCAString(cmCommandArgumentsHelper* args, + const char* key, cmCommandArgumentGroup* group) :cmCommandArgument(args, key, group) { @@ -181,11 +181,11 @@ void cmCAString::DoReset() this->String = ""; } -cmCAEnabler::cmCAEnabler(cmCommandArgumentsHelper* args, - const char* key, +cmCAEnabler::cmCAEnabler(cmCommandArgumentsHelper* args, + const char* key, cmCommandArgumentGroup* group) :cmCommandArgument(args, key, group) -,Enabled(false) +,Enabled(false) {} bool cmCAEnabler::DoConsume(const std::string&, unsigned int index) @@ -202,11 +202,11 @@ void cmCAEnabler::DoReset() this->Enabled = false; } -cmCADisabler::cmCADisabler(cmCommandArgumentsHelper* args, - const char* key, +cmCADisabler::cmCADisabler(cmCommandArgumentsHelper* args, + const char* key, cmCommandArgumentGroup* group) :cmCommandArgument(args, key, group) -,Enabled(true) +,Enabled(true) {} bool cmCADisabler::DoConsume(const std::string&, unsigned int index) @@ -225,7 +225,7 @@ void cmCADisabler::DoReset() void cmCommandArgumentGroup::Follows(const cmCommandArgument* arg) { - for(std::vector<cmCommandArgument*>::iterator + for(std::vector<cmCommandArgument*>::iterator it = this->ContainedArguments.begin(); it != this->ContainedArguments.end(); ++it) @@ -236,7 +236,7 @@ void cmCommandArgumentGroup::Follows(const cmCommandArgument* arg) void cmCommandArgumentGroup::FollowsGroup(const cmCommandArgumentGroup* group) { - for(std::vector<cmCommandArgument*>::iterator + for(std::vector<cmCommandArgument*>::iterator it = this->ContainedArguments.begin(); it != this->ContainedArguments.end(); ++it) @@ -245,7 +245,7 @@ void cmCommandArgumentGroup::FollowsGroup(const cmCommandArgumentGroup* group) } } -void cmCommandArgumentsHelper::Parse(const std::vector<std::string>* args, +void cmCommandArgumentsHelper::Parse(const std::vector<std::string>* args, std::vector<std::string>* unconsumedArgs) { if(args==0) @@ -253,7 +253,7 @@ void cmCommandArgumentsHelper::Parse(const std::vector<std::string>* args, return; } - for(std::vector<cmCommandArgument*>::iterator + for(std::vector<cmCommandArgument*>::iterator argIt = this->Arguments.begin(); argIt != this->Arguments.end(); ++argIt) @@ -268,7 +268,7 @@ void cmCommandArgumentsHelper::Parse(const std::vector<std::string>* args, it != args->end(); ++it) { - for(std::vector<cmCommandArgument*>::iterator + for(std::vector<cmCommandArgument*>::iterator argIt = this->Arguments.begin(); argIt != this->Arguments.end(); ++argIt) diff --git a/Source/cmCommandArgumentsHelper.h b/Source/cmCommandArgumentsHelper.h index 3b0b058..f732f8f 100644 --- a/Source/cmCommandArgumentsHelper.h +++ b/Source/cmCommandArgumentsHelper.h @@ -18,7 +18,7 @@ class cmCommandArgumentsHelper; class cmCommandArgumentGroup; /* cmCommandArgumentsHelper, cmCommandArgumentGroup and cmCommandArgument (i.e. -its derived classes cmCAXXX can be used to simplify the processing of +its derived classes cmCAXXX can be used to simplify the processing of arguments to cmake commands. Maybe they can also be used to generate documentation. @@ -26,11 +26,11 @@ For every argument supported by a command one cmCommandArgument is created and added to cmCommandArgumentsHelper. cmCommand has a cmCommandArgumentsHelper as member variable so this should be used. -The order of the arguments is defined using the Follows(arg) method. It says +The order of the arguments is defined using the Follows(arg) method. It says that this argument follows immediateley the given argument. It can be used with multiple arguments if the argument can follow after different arguments. -Arguments can be arranged in groups using cmCommandArgumentGroup. Every +Arguments can be arranged in groups using cmCommandArgumentGroup. Every member of a group can follow any other member of the group. These groups can also be used to define the order. @@ -42,8 +42,8 @@ For an example see cmExportCommand.cxx. class cmCommandArgument { public: - cmCommandArgument(cmCommandArgumentsHelper* args, - const char* key, + cmCommandArgument(cmCommandArgumentsHelper* args, + const char* key, cmCommandArgumentGroup* group=0); virtual ~cmCommandArgument() {} @@ -56,8 +56,8 @@ class cmCommandArgument /// Returns true if the argument was found in the argument list bool WasFound() const {return this->WasActive;} - // The following methods are only called from - // cmCommandArgumentsHelper::Parse(), but making this a friend would + // The following methods are only called from + // cmCommandArgumentsHelper::Parse(), but making this a friend would // give it access to everything /// Make the current argument the currently active argument @@ -89,19 +89,19 @@ class cmCommandArgument virtual void DoReset() = 0; }; -/** cmCAStringVector is to be used for arguments which can consist of more +/** cmCAStringVector is to be used for arguments which can consist of more than one string, e.g. the FILES argument in INSTALL(FILES f1 f2 f3 ...). */ class cmCAStringVector : public cmCommandArgument { public: - cmCAStringVector(cmCommandArgumentsHelper* args, - const char* key, + cmCAStringVector(cmCommandArgumentsHelper* args, + const char* key, cmCommandArgumentGroup* group=0); /// Return the vector of strings const std::vector<std::string>& GetVector() const {return this->Vector;} - /** Is there a keyword which should be skipped in + /** Is there a keyword which should be skipped in the arguments (e.g. ARGS for ADD_CUSTOM_COMMAND) ? */ void SetIgnore(const char* ignore) {this->Ignore=ignore;} private: @@ -118,8 +118,8 @@ e.g. the executable name in ADD_EXECUTABLE(). */ class cmCAString : public cmCommandArgument { public: - cmCAString(cmCommandArgumentsHelper* args, - const char* key, + cmCAString(cmCommandArgumentsHelper* args, + const char* key, cmCommandArgumentGroup* group=0); /// Return the string @@ -138,8 +138,8 @@ enabled using a special argument, e.g. EXCLUDE_FROM_ALL in ADD_EXECUTABLE(). */ class cmCAEnabler : public cmCommandArgument { public: - cmCAEnabler(cmCommandArgumentsHelper* args, - const char* key, + cmCAEnabler(cmCommandArgumentsHelper* args, + const char* key, cmCommandArgumentGroup* group=0); /// Has it been enabled ? @@ -156,8 +156,8 @@ disabled using a special argument.*/ class cmCADisabler : public cmCommandArgument { public: - cmCADisabler(cmCommandArgumentsHelper* args, - const char* key, + cmCADisabler(cmCommandArgumentsHelper* args, + const char* key, cmCommandArgumentGroup* group=0); /// Is it still enabled ? @@ -170,7 +170,7 @@ class cmCADisabler : public cmCommandArgument }; -/** Group of arguments, needed for ordering. E.g. WIN32, EXCLUDE_FROM_ALL and +/** Group of arguments, needed for ordering. E.g. WIN32, EXCLUDE_FROM_ALL and MACSOX_BUNDLE from ADD_EXECUTABLE() are a group. */ class cmCommandArgumentGroup @@ -192,7 +192,7 @@ class cmCommandArgumentsHelper { public: /// Parse the argument list - void Parse(const std::vector<std::string>* args, + void Parse(const std::vector<std::string>* args, std::vector<std::string>* unconsumedArgs); /// Add an argument. void AddArgument(cmCommandArgument* arg); diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index df78bf8..cd3ef59 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -1214,7 +1214,7 @@ void cmComputeLinkInformation::AddUserItem(std::string const& item, { // if this is a -l option then we might need to warn about // CMP0003 so put it in OldUserFlagItems, if it is not a -l - // or -Wl,-l (-framework -pthread), then allow it without a + // or -Wl,-l (-framework -pthread), then allow it without a // CMP0003 as -L will not affect those other linker flags if(item.find("-l") == 0 || item.find("-Wl,-l") == 0) { diff --git a/Source/cmConfigureFileCommand.cxx b/Source/cmConfigureFileCommand.cxx index ea98326..e52ddef 100644 --- a/Source/cmConfigureFileCommand.cxx +++ b/Source/cmConfigureFileCommand.cxx @@ -104,7 +104,7 @@ bool cmConfigureFileCommand this->Immediate = true; } } - + // If we were told to copy the file immediately, then do it on the // first pass (now). if(this->Immediate) @@ -115,7 +115,7 @@ bool cmConfigureFileCommand return false; } } - + return true; } diff --git a/Source/cmConfigureFileCommand.h b/Source/cmConfigureFileCommand.h index de497a9..347174a 100644 --- a/Source/cmConfigureFileCommand.h +++ b/Source/cmConfigureFileCommand.h @@ -19,7 +19,7 @@ class cmConfigureFileCommand : public cmCommand public: cmTypeMacro(cmConfigureFileCommand, cmCommand); - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmConfigureFileCommand; } @@ -48,7 +48,7 @@ public: { return "Copy a file to another location and modify its contents."; } - + /** * Longer documentation. */ @@ -93,7 +93,7 @@ public: private: int ConfigureFile(); - + cmNewLineStyle NewLineStyle; std::string InputFile; diff --git a/Source/cmCreateTestSourceList.h b/Source/cmCreateTestSourceList.h index 806e5a9..3aa0a79 100644 --- a/Source/cmCreateTestSourceList.h +++ b/Source/cmCreateTestSourceList.h @@ -15,7 +15,7 @@ #include "cmCommand.h" /** \class cmCreateTestSourceList - * \brief + * \brief * */ @@ -25,7 +25,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmCreateTestSourceList; } @@ -41,7 +41,7 @@ public: * The name of the command as specified in CMakeList.txt. */ virtual const char* GetName() const {return "create_test_sourcelist";} - + /** * Succinct documentation. */ @@ -49,7 +49,7 @@ public: { return "Create a test driver and source list for building test programs."; } - + /** * More documentation. */ @@ -81,7 +81,7 @@ public: "CMAKE_TESTDRIVER_AFTER_TESTMAIN can be set to have code that will be " "placed directly after the call to the test main function."; } - + cmTypeMacro(cmCreateTestSourceList, cmCommand); }; diff --git a/Source/cmDefinePropertyCommand.h b/Source/cmDefinePropertyCommand.h index 55ef521..b5175d5 100644 --- a/Source/cmDefinePropertyCommand.h +++ b/Source/cmDefinePropertyCommand.h @@ -17,7 +17,7 @@ class cmDefinePropertyCommand : public cmCommand { public: - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmDefinePropertyCommand; } @@ -41,7 +41,7 @@ public: { return "Define and document custom properties."; } - + /** * Longer documentation. */ @@ -80,7 +80,7 @@ public: "Corresponding options to the get_property command will retrieve the " "documentation."; } - + cmTypeMacro(cmDefinePropertyCommand, cmCommand); private: std::string PropertyName; diff --git a/Source/cmDepends.cxx b/Source/cmDepends.cxx index 9296d4c..545fe97 100644 --- a/Source/cmDepends.cxx +++ b/Source/cmDepends.cxx @@ -154,7 +154,7 @@ bool cmDepends::CheckDependencies(std::istream& internalDepends, while(internalDepends.getline(this->Dependee, this->MaxPath)) { - if ( this->Dependee[0] == 0 || this->Dependee[0] == '#' || + if ( this->Dependee[0] == 0 || this->Dependee[0] == '#' || this->Dependee[0] == '\r' ) { continue; diff --git a/Source/cmDepends.h b/Source/cmDepends.h index 087da64..100e187 100644 --- a/Source/cmDepends.h +++ b/Source/cmDepends.h @@ -30,7 +30,7 @@ public: /** Instances need to know the build directory name and the relative path from the build directory to the target file. */ cmDepends(cmLocalGenerator* lg=0, const char* targetDir=""); - + /** at what level will the compile be done from */ void SetCompileDirectory(const char *dir) {this->CompileDirectory = dir;}; @@ -48,7 +48,7 @@ public: /** should this be verbose in its output */ void SetVerbose(bool verb) { this->Verbose = verb; } - + /** Virtual destructor to cleanup subclasses properly. */ virtual ~cmDepends(); @@ -69,7 +69,7 @@ public: void Clear(const char *file); /** Set the file comparison object */ - void SetFileComparison(cmFileTimeComparison* fc) { + void SetFileComparison(cmFileTimeComparison* fc) { this->FileComparison = fc; } protected: diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index c1b6090..3e66058 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -889,7 +889,7 @@ bool cmDependsFortran::FindIncludeFile(const char* dir, } // Search the include path for the file. - for(std::vector<std::string>::const_iterator i = + for(std::vector<std::string>::const_iterator i = this->IncludePath.begin(); i != this->IncludePath.end(); ++i) { fullName = *i; diff --git a/Source/cmDependsJavaLexer.h b/Source/cmDependsJavaLexer.h index 09c19bf..61aa66d 100644 --- a/Source/cmDependsJavaLexer.h +++ b/Source/cmDependsJavaLexer.h @@ -58,7 +58,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; #endif /* ! C99 */ @@ -188,7 +188,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ diff --git a/Source/cmDependsJavaLexer.in.l b/Source/cmDependsJavaLexer.in.l index aae7ec6..9796ad5 100644 --- a/Source/cmDependsJavaLexer.in.l +++ b/Source/cmDependsJavaLexer.in.l @@ -171,18 +171,18 @@ null { PRIMITIVE; return jp_NULLLITERAL; } "\*" { SYMBOL; return jp_TIMES; } "\*=" { SYMBOL; return jp_TIMESEQUALS; } -[a-z_A-Z][a-z_0-9A-Z]* { - yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); - return jp_NAME; +[a-z_A-Z][a-z_0-9A-Z]* { + yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); + return jp_NAME; } \/\/.*\n { } [ \f\t\n\r] { } -. { - std::cerr << "Unknown character: " << yytext[0] - << " (" << (int)yytext[0] << ")" << std::endl; - yyextra->Error("Unknown character"); - return jp_ERROR; +. { + std::cerr << "Unknown character: " << yytext[0] + << " (" << (int)yytext[0] << ")" << std::endl; + yyextra->Error("Unknown character"); + return jp_ERROR; } %% diff --git a/Source/cmDependsJavaParserHelper.cxx b/Source/cmDependsJavaParserHelper.cxx index 7b595cc..6136baa 100644 --- a/Source/cmDependsJavaParserHelper.cxx +++ b/Source/cmDependsJavaParserHelper.cxx @@ -35,7 +35,7 @@ cmDependsJavaParserHelper::~cmDependsJavaParserHelper() } void cmDependsJavaParserHelper::CurrentClass -::AddFileNamesForPrinting(std::vector<cmStdString> *files, +::AddFileNamesForPrinting(std::vector<cmStdString> *files, const char* prefix, const char* sep) { cmStdString rname = ""; @@ -103,7 +103,7 @@ void cmDependsJavaParserHelper::AddPackagesImport(const char* sclass) this->PackagesImport.push_back(sclass); } -void cmDependsJavaParserHelper::SafePrintMissing(const char* str, +void cmDependsJavaParserHelper::SafePrintMissing(const char* str, int line, int cnt) { if ( str ) @@ -134,7 +134,7 @@ void cmDependsJavaParserHelper::Print(const char* place, const char* str) } } -void cmDependsJavaParserHelper::CombineUnions(char** out, +void cmDependsJavaParserHelper::CombineUnions(char** out, const char* in1, char** in2, const char* sep) { @@ -193,7 +193,7 @@ void cmDependsJavaParserHelper } void cmDependsJavaParserHelper -::AllocateParserType(cmDependsJavaParserHelper::ParserType* pt, +::AllocateParserType(cmDependsJavaParserHelper::ParserType* pt, const char* str, int len) { pt->str = 0; @@ -270,7 +270,7 @@ std::vector<cmStdString> cmDependsJavaParserHelper::GetFilesProduced() std::vector<cmStdString> files; CurrentClass* toplevel = &(*(this->ClassStack.begin())); std::vector<CurrentClass>::iterator it; - for ( it = toplevel->NestedClasses->begin(); + for ( it = toplevel->NestedClasses->begin(); it != toplevel->NestedClasses->end(); ++ it ) { @@ -289,7 +289,7 @@ int cmDependsJavaParserHelper::ParseString(const char* str, int verb) this->InputBuffer = str; this->InputBufferPos = 0; this->CurrentLine = 0; - + yyscan_t yyscanner; cmDependsJava_yylex_init(&yyscanner); @@ -306,7 +306,7 @@ int cmDependsJavaParserHelper::ParseString(const char* str, int verb) { if ( this->CurrentPackage.size() > 0 ) { - std::cout << "Current package is: " << + std::cout << "Current package is: " << this->CurrentPackage.c_str() << std::endl; } std::cout << "Imports packages:"; @@ -337,7 +337,7 @@ int cmDependsJavaParserHelper::ParseString(const char* str, int verb) this->PrintClasses(); if ( this->UnionsAvailable != 0 ) { - std::cout << "There are still " << + std::cout << "There are still " << this->UnionsAvailable << " unions available" << std::endl; } } @@ -348,13 +348,13 @@ int cmDependsJavaParserHelper::ParseString(const char* str, int verb) void cmDependsJavaParserHelper::CleanupParser() { std::vector<char*>::iterator it; - for ( it = this->Allocates.begin(); + for ( it = this->Allocates.begin(); it != this->Allocates.end(); ++ it ) { delete [] *it; } - this->Allocates.erase(this->Allocates.begin(), + this->Allocates.erase(this->Allocates.begin(), this->Allocates.end()); } @@ -382,11 +382,11 @@ 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", + fprintf(stderr, "JPError: %s (%lu / Line: %d)\n", str, pos, this->CurrentLine); int cc; std::cerr << "String: ["; - for ( cc = 0; + for ( cc = 0; cc < 30 && *(this->InputBuffer.c_str() + this->InputBufferPos + cc); cc ++ ) { @@ -395,7 +395,7 @@ void cmDependsJavaParserHelper::Error(const char* str) std::cerr << "]" << std::endl; } -void cmDependsJavaParserHelper::UpdateCombine(const char* str1, +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 baecab3..9807a04 100644 --- a/Source/cmDependsJavaParserHelper.h +++ b/Source/cmDependsJavaParserHelper.h @@ -9,7 +9,7 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ -#ifndef cmDependsJavaParserHelper_h +#ifndef cmDependsJavaParserHelper_h #define cmDependsJavaParserHelper_h #include "cmStandardIncludes.h" @@ -39,7 +39,7 @@ public: int ParseFile(const char* file); // For the lexer: - void AllocateParserType(cmDependsJavaParserHelper::ParserType* pt, + void AllocateParserType(cmDependsJavaParserHelper::ParserType* pt, const char* str, int len = 0); int LexInput(char* buf, int maxlen); @@ -69,7 +69,7 @@ private: public: cmStdString Name; std::vector<CurrentClass>* NestedClasses; - CurrentClass() + CurrentClass() { this->NestedClasses = new std::vector<CurrentClass>; } @@ -77,7 +77,7 @@ private: { delete this->NestedClasses; } - CurrentClass& operator=(CurrentClass const& c) + CurrentClass& operator=(CurrentClass const& c) { this->NestedClasses->clear(); this->Name = c.Name; @@ -93,7 +93,7 @@ private: { (*this) = c; } - void AddFileNamesForPrinting(std::vector<cmStdString> *files, + void AddFileNamesForPrinting(std::vector<cmStdString> *files, const char* prefix, const char* sep); }; cmStdString CurrentPackage; @@ -117,7 +117,7 @@ private: void PrintClasses(); void Print(const char* place, const char* str); - void CombineUnions(char** out, const char* in1, char** in2, + void CombineUnions(char** out, const char* in1, char** in2, const char* sep); void SafePrintMissing(const char* str, int line, int cnt); diff --git a/Source/cmDocumentationFormatter.cxx b/Source/cmDocumentationFormatter.cxx index 6762d66..9f01949 100644 --- a/Source/cmDocumentationFormatter.cxx +++ b/Source/cmDocumentationFormatter.cxx @@ -19,7 +19,7 @@ cmDocumentationFormatter::~cmDocumentationFormatter() { } -void cmDocumentationFormatter::PrintFormatted(std::ostream& os, +void cmDocumentationFormatter::PrintFormatted(std::ostream& os, const char* text) { if(!text) diff --git a/Source/cmDocumentationFormatterDocbook.cxx b/Source/cmDocumentationFormatterDocbook.cxx index 3087330..eabdbc1 100644 --- a/Source/cmDocumentationFormatterDocbook.cxx +++ b/Source/cmDocumentationFormatterDocbook.cxx @@ -34,7 +34,7 @@ static void cmDocumentationPrintDocbookChar(std::ostream& os, char c) case '<': os << "<"; break; - case '>': + case '>': os << ">"; break; case '&': @@ -126,13 +126,13 @@ void cmDocumentationFormatterDocbook std::string prefix = this->ComputeSectionLinkPrefix(name); - const std::vector<cmDocumentationEntry> &entries = + const std::vector<cmDocumentationEntry> &entries = section.GetEntries(); if (!entries.empty()) { os << "<itemizedlist>\n"; - for(std::vector<cmDocumentationEntry>::const_iterator op + for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin(); op != entries.end(); ++ op ) { if(op->Name.size()) @@ -147,7 +147,7 @@ void cmDocumentationFormatterDocbook os << "</itemizedlist>\n" ; } - for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin(); + for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin(); op != entries.end();) { if(op->Name.size()) @@ -160,8 +160,8 @@ void cmDocumentationFormatterDocbook cmDocumentationPrintDocbookEscapes(os, op->Name.c_str()); // make sure that each id exists only once. Since it seems - // not easily possible to determine which link refers to which id, - // we have at least to make sure that the duplicated id's get a + // not easily possible to determine which link refers to which id, + // we have at least to make sure that the duplicated id's get a // different name (by appending an increasing number), Alex std::string id = prefix; id += "_"; @@ -191,7 +191,7 @@ void cmDocumentationFormatterDocbook if(op->Full.size()) { // a line break seems to be simply a line break with docbook - os << "\n "; + os << "\n "; this->PrintFormatted(os, op->Full.c_str()); } os << "\n"; @@ -210,7 +210,7 @@ void cmDocumentationFormatterDocbook } } -void cmDocumentationFormatterDocbook::PrintPreformatted(std::ostream& os, +void cmDocumentationFormatterDocbook::PrintPreformatted(std::ostream& os, const char* text) { os << "<literallayout>"; @@ -218,7 +218,7 @@ void cmDocumentationFormatterDocbook::PrintPreformatted(std::ostream& os, os << "</literallayout>\n "; } -void cmDocumentationFormatterDocbook::PrintParagraph(std::ostream& os, +void cmDocumentationFormatterDocbook::PrintParagraph(std::ostream& os, const char* text) { os << "<para>"; @@ -232,7 +232,7 @@ void cmDocumentationFormatterDocbook::PrintHeader(const char* docname, std::ostream& os) { // this one is used to ensure that we don't create multiple link targets - // with the same name. We can clear it here since we are at the + // with the same name. We can clear it here since we are at the // start of a document here. this->EmittedLinkIds.clear(); diff --git a/Source/cmDocumentationFormatterHTML.cxx b/Source/cmDocumentationFormatterHTML.cxx index cd0077e..7213b43 100644 --- a/Source/cmDocumentationFormatterHTML.cxx +++ b/Source/cmDocumentationFormatterHTML.cxx @@ -29,7 +29,7 @@ static void cmDocumentationPrintHTMLChar(std::ostream& os, char c) // Use an escape sequence if necessary. switch (c) { - case '<': + case '<': os << "<"; break; case '>': @@ -114,7 +114,7 @@ void cmDocumentationFormatterHTML { std::string prefix = this->ComputeSectionLinkPrefix(name); - const std::vector<cmDocumentationEntry> &entries = + const std::vector<cmDocumentationEntry> &entries = section.GetEntries(); // skip the index if the help for only a single item (--help-command, @@ -131,7 +131,7 @@ void cmDocumentationFormatterHTML } // Is a list needed? - for(std::vector<cmDocumentationEntry>::const_iterator op + for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin(); op != entries.end(); ++ op ) { if (op->Name.size()) @@ -154,7 +154,7 @@ void cmDocumentationFormatterHTML } } - for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin(); + for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin(); op != entries.end();) { if(op->Name.size()) @@ -191,7 +191,7 @@ void cmDocumentationFormatterHTML } } -void cmDocumentationFormatterHTML::PrintPreformatted(std::ostream& os, +void cmDocumentationFormatterHTML::PrintPreformatted(std::ostream& os, const char* text) { os << "<pre>"; @@ -199,7 +199,7 @@ void cmDocumentationFormatterHTML::PrintPreformatted(std::ostream& os, os << "</pre>\n "; } -void cmDocumentationFormatterHTML::PrintParagraph(std::ostream& os, +void cmDocumentationFormatterHTML::PrintParagraph(std::ostream& os, const char* text) { os << "<p>"; @@ -229,7 +229,7 @@ void cmDocumentationFormatterHTML::PrintFooter(std::ostream& os) } //---------------------------------------------------------------------------- -void cmDocumentationFormatterHTML::PrintHTMLEscapes(std::ostream& os, +void cmDocumentationFormatterHTML::PrintHTMLEscapes(std::ostream& os, const char* text) { // Hyperlink prefixes. @@ -262,7 +262,7 @@ void cmDocumentationFormatterHTML std::vector<const cmDocumentationSection *>& sections) { // skip the index if only the help for a single item is printed - if ((sections.size() == 1) + if ((sections.size() == 1) && (sections[0]->GetName(this->GetForm()) != 0 ) && (std::string(sections[0]->GetName(this->GetForm())) == "SingleItem")) { diff --git a/Source/cmDocumentationFormatterHTML.h b/Source/cmDocumentationFormatterHTML.h index 427e04b..44bf240 100644 --- a/Source/cmDocumentationFormatterHTML.h +++ b/Source/cmDocumentationFormatterHTML.h @@ -32,7 +32,7 @@ public: const cmDocumentationSection& section, const char* name); virtual void PrintPreformatted(std::ostream& os, const char* text); - virtual void PrintParagraph(std::ostream& os, const char* text); + virtual void PrintParagraph(std::ostream& os, const char* text); virtual void PrintIndex(std::ostream& , std::vector<const cmDocumentationSection *>&); private: diff --git a/Source/cmDocumentationFormatterText.cxx b/Source/cmDocumentationFormatterText.cxx index 0b04b73..5def194 100644 --- a/Source/cmDocumentationFormatterText.cxx +++ b/Source/cmDocumentationFormatterText.cxx @@ -33,9 +33,9 @@ void cmDocumentationFormatterText os << name << "\n\n"; } - const std::vector<cmDocumentationEntry> &entries = + const std::vector<cmDocumentationEntry> &entries = section.GetEntries(); - for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin(); + for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin(); op != entries.end(); ++op) { if(op->Name.size()) @@ -58,7 +58,7 @@ void cmDocumentationFormatterText } } -void cmDocumentationFormatterText::PrintPreformatted(std::ostream& os, +void cmDocumentationFormatterText::PrintPreformatted(std::ostream& os, const char* text) { bool newline = true; @@ -78,7 +78,7 @@ void cmDocumentationFormatterText::PrintPreformatted(std::ostream& os, os << "\n"; } -void cmDocumentationFormatterText::PrintParagraph(std::ostream& os, +void cmDocumentationFormatterText::PrintParagraph(std::ostream& os, const char* text) { os << this->TextIndent; @@ -91,7 +91,7 @@ void cmDocumentationFormatterText::SetIndent(const char* indent) this->TextIndent = indent; } -void cmDocumentationFormatterText::PrintColumn(std::ostream& os, +void cmDocumentationFormatterText::PrintColumn(std::ostream& os, const char* text) { // Print text arranged in an indented column of fixed witdh. @@ -100,14 +100,14 @@ void cmDocumentationFormatterText::PrintColumn(std::ostream& os, bool newSentence = false; bool firstLine = true; int width = this->TextWidth - static_cast<int>(strlen(this->TextIndent)); - + // Loop until the end of the text. while(*l) { // Parse the next word. const char* r = l; while(*r && (*r != '\n') && (*r != ' ')) { ++r; } - + // Does it fit on this line? if(r-l < (width-column-(newSentence?1:0))) { @@ -135,12 +135,12 @@ void cmDocumentationFormatterText::PrintColumn(std::ostream& os, // first line. os << (firstLine?"":this->TextIndent); } - + // Print the word. os.write(l, static_cast<long>(r-l)); newSentence = (*(r-1) == '.'); } - + if(*r == '\n') { // Text provided a newline. Start a new line. @@ -175,6 +175,6 @@ void cmDocumentationFormatterText::PrintColumn(std::ostream& os, // Move to beginning of next word. Skip over whitespace. l = r; - while(*l && (*l == ' ')) { ++l; } + while(*l && (*l == ' ')) { ++l; } } } diff --git a/Source/cmDocumentationFormatterUsage.cxx b/Source/cmDocumentationFormatterUsage.cxx index 8a415cb..a068e56 100644 --- a/Source/cmDocumentationFormatterUsage.cxx +++ b/Source/cmDocumentationFormatterUsage.cxx @@ -28,9 +28,9 @@ void cmDocumentationFormatterUsage os << name << "\n"; } - const std::vector<cmDocumentationEntry> &entries = + const std::vector<cmDocumentationEntry> &entries = section.GetEntries(); - for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin(); + for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin(); op != entries.end(); ++op) { if(op->Name.size()) diff --git a/Source/cmDocumentationSection.h b/Source/cmDocumentationSection.h index 0fab38f..4f8c10d 100644 --- a/Source/cmDocumentationSection.h +++ b/Source/cmDocumentationSection.h @@ -26,28 +26,28 @@ public: /** Create a cmSection, with a special name for man-output mode. */ cmDocumentationSection(const char* name, const char* manName) :Name(name), ManName(manName) {} - + /** Has any content been added to this section or is it empty ? */ bool IsEmpty() const { return this->Entries.empty(); } - + /** Clear contents. */ void Clear() { this->Entries.clear(); } - + /** Return the name of this section for the given output form. */ const char* GetName(cmDocumentationEnums::Form form) const { return (form==cmDocumentationEnums::ManForm ? this->ManName.c_str() : this->Name.c_str()); } - + /** Return a pointer to the first entry of this section. */ const std::vector<cmDocumentationEntry> &GetEntries() const { return this->Entries; } - + /** Append an entry to this section. */ void Append(const cmDocumentationEntry& entry) { this->Entries.push_back(entry); } void Append(const std::vector<cmDocumentationEntry> &entries) { this->Entries.insert(this->Entries.end(),entries.begin(),entries.end()); } - + /** Append an entry to this section using NULL terminated chars */ void Append(const char *[][3]); void Append(const char *n, const char *b, const char *f); @@ -58,7 +58,7 @@ public: { this->Entries.insert(this->Entries.begin(), entries.begin(),entries.end()); } - + private: std::string Name; std::string ManName; diff --git a/Source/cmElseCommand.h b/Source/cmElseCommand.h index 5e8b790..f259919 100644 --- a/Source/cmElseCommand.h +++ b/Source/cmElseCommand.h @@ -25,7 +25,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmElseCommand; } @@ -54,7 +54,7 @@ public: { return "Starts the else portion of an if block."; } - + /** * More documentation. */ @@ -64,7 +64,7 @@ public: " else(expression)\n" "See the if command."; } - + cmTypeMacro(cmElseCommand, cmCommand); }; diff --git a/Source/cmElseIfCommand.h b/Source/cmElseIfCommand.h index 20cd81a..46e2bd9 100644 --- a/Source/cmElseIfCommand.h +++ b/Source/cmElseIfCommand.h @@ -25,7 +25,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmElseIfCommand; } @@ -54,7 +54,7 @@ public: { return "Starts the elseif portion of an if block."; } - + /** * More documentation. */ @@ -64,7 +64,7 @@ public: " elseif(expression)\n" "See the if command."; } - + cmTypeMacro(cmElseIfCommand, cmCommand); }; diff --git a/Source/cmEnableLanguageCommand.cxx b/Source/cmEnableLanguageCommand.cxx index f8f36eb..dcabf6a 100644 --- a/Source/cmEnableLanguageCommand.cxx +++ b/Source/cmEnableLanguageCommand.cxx @@ -22,7 +22,7 @@ bool cmEnableLanguageCommand this->SetError ("called with incorrect number of arguments"); return false; - } + } for (std::vector<std::string>::const_iterator it = args.begin(); it != args.end(); ++it) diff --git a/Source/cmEnableLanguageCommand.h b/Source/cmEnableLanguageCommand.h index 5958e44..e4bb251 100644 --- a/Source/cmEnableLanguageCommand.h +++ b/Source/cmEnableLanguageCommand.h @@ -28,7 +28,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmEnableLanguageCommand; } @@ -39,7 +39,7 @@ public: */ virtual bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus &status); - + /** * The name of the command as specified in CMakeList.txt. */ @@ -52,7 +52,7 @@ public: { return "Enable a language (CXX/C/Fortran/etc)"; } - + /** * More documentation. */ @@ -67,7 +67,7 @@ public: "If OPTIONAL is used, use the CMAKE_<languageName>_COMPILER_WORKS " "variable to check whether the language has been enabled successfully."; } - + cmTypeMacro(cmEnableLanguageCommand, cmCommand); }; diff --git a/Source/cmEnableTestingCommand.cxx b/Source/cmEnableTestingCommand.cxx index 5abb873..aa41ef7 100644 --- a/Source/cmEnableTestingCommand.cxx +++ b/Source/cmEnableTestingCommand.cxx @@ -12,7 +12,7 @@ #include "cmEnableTestingCommand.h" #include "cmLocalGenerator.h" -// we do this in the final pass so that we now the subdirs have all +// we do this in the final pass so that we now the subdirs have all // been defined bool cmEnableTestingCommand::InitialPass(std::vector<std::string> const&, cmExecutionStatus &) diff --git a/Source/cmEnableTestingCommand.h b/Source/cmEnableTestingCommand.h index b607818..9b9e985 100644 --- a/Source/cmEnableTestingCommand.h +++ b/Source/cmEnableTestingCommand.h @@ -24,7 +24,7 @@ * within the valid control structures are replicated in Testfile * (i.e. SUBDIRS() and ADD_TEST() commands within IF() commands that are * not entered by CMake are not replicated in Testfile). - * Note that CTest expects to find this file in the build directory root; + * Note that CTest expects to find this file in the build directory root; * therefore, this command should be in the source directory root too. */ class cmEnableTestingCommand : public cmCommand @@ -33,7 +33,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmEnableTestingCommand; } @@ -57,7 +57,7 @@ public: { return "Enable testing for current directory and below."; } - + /** * More documentation. */ @@ -70,9 +70,9 @@ public: "a test file in the build directory root. Therefore, this command " "should be in the source directory root."; } - + cmTypeMacro(cmEnableTestingCommand, cmCommand); - + }; diff --git a/Source/cmEndForEachCommand.cxx b/Source/cmEndForEachCommand.cxx index 2eca4e2..7f11ae5 100644 --- a/Source/cmEndForEachCommand.cxx +++ b/Source/cmEndForEachCommand.cxx @@ -12,7 +12,7 @@ #include "cmEndForEachCommand.h" bool cmEndForEachCommand -::InvokeInitialPass(std::vector<cmListFileArgument> const&, +::InvokeInitialPass(std::vector<cmListFileArgument> const&, cmExecutionStatus &) { this->SetError("An ENDFOREACH command was found outside of a proper " diff --git a/Source/cmEndForEachCommand.h b/Source/cmEndForEachCommand.h index 37b2d2a..d5ee8a6 100644 --- a/Source/cmEndForEachCommand.h +++ b/Source/cmEndForEachCommand.h @@ -25,7 +25,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmEndForEachCommand; } @@ -36,7 +36,7 @@ public: */ virtual bool InvokeInitialPass(std::vector<cmListFileArgument> const&, cmExecutionStatus &); - + /** * This is called when the command is first encountered in * the CMakeLists.txt file. @@ -61,7 +61,7 @@ public: { return "Ends a list of commands in a FOREACH block."; } - + /** * More documentation. */ @@ -71,7 +71,7 @@ public: " endforeach(expression)\n" "See the FOREACH command."; } - + cmTypeMacro(cmEndForEachCommand, cmCommand); }; diff --git a/Source/cmEndFunctionCommand.h b/Source/cmEndFunctionCommand.h index 54ac068..d7b74e9 100644 --- a/Source/cmEndFunctionCommand.h +++ b/Source/cmEndFunctionCommand.h @@ -25,7 +25,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmEndFunctionCommand; } @@ -36,7 +36,7 @@ public: */ virtual bool InvokeInitialPass(std::vector<cmListFileArgument> const&, cmExecutionStatus &); - + /** * This is called when the command is first encountered in * the CMakeLists.txt file. @@ -61,7 +61,7 @@ public: { return "Ends a list of commands in a function block."; } - + /** * More documentation. */ @@ -71,7 +71,7 @@ public: " endfunction(expression)\n" "See the function command."; } - + cmTypeMacro(cmEndFunctionCommand, cmCommand); }; diff --git a/Source/cmEndIfCommand.cxx b/Source/cmEndIfCommand.cxx index e98d4d4..0ac09de 100644 --- a/Source/cmEndIfCommand.cxx +++ b/Source/cmEndIfCommand.cxx @@ -20,7 +20,7 @@ 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."); diff --git a/Source/cmEndIfCommand.h b/Source/cmEndIfCommand.h index 81d1b5f..5c4b9e3 100644 --- a/Source/cmEndIfCommand.h +++ b/Source/cmEndIfCommand.h @@ -25,7 +25,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmEndIfCommand; } @@ -54,7 +54,7 @@ public: { return "Ends a list of commands in an if block."; } - + /** * More documentation. */ @@ -64,7 +64,7 @@ public: " endif(expression)\n" "See the if command."; } - + cmTypeMacro(cmEndIfCommand, cmCommand); }; diff --git a/Source/cmEndMacroCommand.h b/Source/cmEndMacroCommand.h index 25e86b7..9d0e70f 100644 --- a/Source/cmEndMacroCommand.h +++ b/Source/cmEndMacroCommand.h @@ -25,7 +25,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmEndMacroCommand; } @@ -36,7 +36,7 @@ public: */ virtual bool InvokeInitialPass(std::vector<cmListFileArgument> const&, cmExecutionStatus &); - + /** * This is called when the command is first encountered in * the CMakeLists.txt file. @@ -61,7 +61,7 @@ public: { return "Ends a list of commands in a macro block."; } - + /** * More documentation. */ @@ -71,7 +71,7 @@ public: " endmacro(expression)\n" "See the macro command."; } - + cmTypeMacro(cmEndMacroCommand, cmCommand); }; diff --git a/Source/cmEndWhileCommand.h b/Source/cmEndWhileCommand.h index 635ad5a..18ba5ea 100644 --- a/Source/cmEndWhileCommand.h +++ b/Source/cmEndWhileCommand.h @@ -25,7 +25,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmEndWhileCommand; } @@ -36,7 +36,7 @@ public: */ virtual bool InvokeInitialPass(std::vector<cmListFileArgument> const& args, cmExecutionStatus &status); - + /** * This is called when the command is first encountered in * the CMakeLists.txt file. @@ -61,7 +61,7 @@ public: { return "Ends a list of commands in a while block."; } - + /** * More documentation. */ @@ -71,7 +71,7 @@ public: " endwhile(expression)\n" "See the while command."; } - + cmTypeMacro(cmEndWhileCommand, cmCommand); }; diff --git a/Source/cmExecProgramCommand.cxx b/Source/cmExecProgramCommand.cxx index 61b27ea..9fdb1e8 100644 --- a/Source/cmExecProgramCommand.cxx +++ b/Source/cmExecProgramCommand.cxx @@ -36,7 +36,7 @@ bool cmExecProgramCommand doingargs = false; havereturn_variable = false; haveoutput_variable = true; - } + } else if ( haveoutput_variable ) { if ( output_variable.size() > 0 ) @@ -54,7 +54,7 @@ bool cmExecProgramCommand doingargs = false; haveoutput_variable = false; havereturn_variable = true; - } + } else if ( havereturn_variable ) { if ( return_variable.size() > 0 ) @@ -108,16 +108,16 @@ bool cmExecProgramCommand } else { - result = cmSystemTools::RunCommand(command.c_str(), output, + result = cmSystemTools::RunCommand(command.c_str(), output, retVal, 0, verbose); } if(!result) { retVal = -1; - } + } if ( output_variable.size() > 0 ) - { + { std::string::size_type first = output.find_first_not_of(" \n\t\r"); std::string::size_type last = output.find_last_not_of(" \n\t\r"); if(first == std::string::npos) @@ -128,7 +128,7 @@ bool cmExecProgramCommand { last = output.size()-1; } - + std::string coutput = std::string(output, first, last-first+1); this->Makefile->AddDefinition(output_variable.c_str(), coutput.c_str()); } @@ -139,7 +139,7 @@ bool cmExecProgramCommand sprintf(buffer, "%d", retVal); this->Makefile->AddDefinition(return_variable.c_str(), buffer); } - + return true; } diff --git a/Source/cmExecProgramCommand.h b/Source/cmExecProgramCommand.h index 7233860..f752501 100644 --- a/Source/cmExecProgramCommand.h +++ b/Source/cmExecProgramCommand.h @@ -27,7 +27,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmExecProgramCommand; } @@ -38,13 +38,13 @@ public: */ virtual bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus &status); - + /** * The name of the command as specified in CMakeList.txt. */ virtual const char* GetName() const {return "exec_program";} - + /** * This determines if the command is invoked when in script mode. */ @@ -55,10 +55,10 @@ public: */ virtual const char* GetTerseDocumentation() const { - return + return "Deprecated. Use the execute_process() command instead."; } - + /** * More documentation. */ @@ -82,7 +82,7 @@ public: "stdout/stderr of the console running cmake.\n" ; } - + /** This command is kept for compatibility with older CMake versions. */ virtual bool IsDiscouraged() const { diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx index a0d9c9c..994c170 100644 --- a/Source/cmExecuteProcessCommand.cxx +++ b/Source/cmExecuteProcessCommand.cxx @@ -266,12 +266,12 @@ bool cmExecuteProcessCommand } if(!output_file.empty()) { - cmsysProcess_SetPipeFile(cp, cmsysProcess_Pipe_STDOUT, + cmsysProcess_SetPipeFile(cp, cmsysProcess_Pipe_STDOUT, output_file.c_str()); } if(!error_file.empty()) { - cmsysProcess_SetPipeFile(cp, cmsysProcess_Pipe_STDERR, + cmsysProcess_SetPipeFile(cp, cmsysProcess_Pipe_STDERR, error_file.c_str()); } @@ -326,12 +326,12 @@ bool cmExecuteProcessCommand // Store the output obtained. if(!output_variable.empty() && tempOutput.size()) { - this->Makefile->AddDefinition(output_variable.c_str(), + this->Makefile->AddDefinition(output_variable.c_str(), &*tempOutput.begin()); } if(!merge_output && !error_variable.empty() && tempError.size()) { - this->Makefile->AddDefinition(error_variable.c_str(), + this->Makefile->AddDefinition(error_variable.c_str(), &*tempError.begin()); } diff --git a/Source/cmExecutionStatus.h b/Source/cmExecutionStatus.h index 9fbecac..1488924 100644 --- a/Source/cmExecutionStatus.h +++ b/Source/cmExecutionStatus.h @@ -23,19 +23,19 @@ class cmExecutionStatus : public cmObject { public: cmTypeMacro(cmExecutionStatus, cmObject); - + cmExecutionStatus() { this->Clear();}; - - virtual void SetReturnInvoked(bool val) + + virtual void SetReturnInvoked(bool val) { this->ReturnInvoked = val; } virtual bool GetReturnInvoked() { return this->ReturnInvoked; } - - virtual void SetBreakInvoked(bool val) + + virtual void SetBreakInvoked(bool val) { this->BreakInvoked = val; } virtual bool GetBreakInvoked() { return this->BreakInvoked; } - + virtual void Clear() { this->ReturnInvoked = false; @@ -45,7 +45,7 @@ public: virtual void SetNestedError(bool val) { this->NestedError = val; } virtual bool GetNestedError() { return this->NestedError; } - + protected: bool ReturnInvoked; bool BreakInvoked; diff --git a/Source/cmExportLibraryDependencies.cxx b/Source/cmExportLibraryDependencies.cxx index 8fdb069..f07b783 100644 --- a/Source/cmExportLibraryDependencies.cxx +++ b/Source/cmExportLibraryDependencies.cxx @@ -26,7 +26,7 @@ bool cmExportLibraryDependenciesCommand this->SetError("called with incorrect number of arguments"); return false; } - + // store the arguments for the final pass this->Filename = args[0]; this->Append = false; diff --git a/Source/cmExportLibraryDependencies.h b/Source/cmExportLibraryDependencies.h index 2a2ff21..d8b65cc 100644 --- a/Source/cmExportLibraryDependencies.h +++ b/Source/cmExportLibraryDependencies.h @@ -18,7 +18,7 @@ * \brief Add a test to the lists of tests to run. * * cmExportLibraryDependenciesCommand adds a test to the list of tests to run - * + * */ class cmExportLibraryDependenciesCommand : public cmCommand { @@ -26,7 +26,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmExportLibraryDependenciesCommand; } @@ -40,7 +40,7 @@ public: /** * This is called at the end after all the information - * specified by the command is accumulated. + * specified by the command is accumulated. */ virtual void FinalPass(); virtual bool HasFinalPass() const { return true; } @@ -57,7 +57,7 @@ public: { return "Deprecated. Use INSTALL(EXPORT) or EXPORT command."; } - + /** * More documentation. */ @@ -87,7 +87,7 @@ public: { return true; } - + cmTypeMacro(cmExportLibraryDependenciesCommand, cmCommand); private: diff --git a/Source/cmExprLexer.h b/Source/cmExprLexer.h index 4c10496..03b36ce 100644 --- a/Source/cmExprLexer.h +++ b/Source/cmExprLexer.h @@ -58,7 +58,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; #endif /* ! C99 */ @@ -188,7 +188,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ diff --git a/Source/cmExprLexer.in.l b/Source/cmExprLexer.in.l index db9018f..f344b40 100644 --- a/Source/cmExprLexer.in.l +++ b/Source/cmExprLexer.in.l @@ -54,19 +54,19 @@ Modify cmExprLexer.h: %% -[0-9][0-9]* { yylvalp->Number = atoi(yytext); return exp_NUMBER; } +[0-9][0-9]* { yylvalp->Number = atoi(yytext); return exp_NUMBER; } "+" { return exp_PLUS; } -"-" { return exp_MINUS; } -"*" { return exp_TIMES; } -"/" { return exp_DIVIDE; } -"%" { return exp_MOD; } -"\|" { return exp_OR; } -"&" { return exp_AND; } -"^" { return exp_XOR; } -"~" { return exp_NOT; } -"<<" { return exp_SHIFTLEFT; } -">>" { return exp_SHIFTRIGHT; } +"-" { return exp_MINUS; } +"*" { return exp_TIMES; } +"/" { return exp_DIVIDE; } +"%" { return exp_MOD; } +"\|" { return exp_OR; } +"&" { return exp_AND; } +"^" { return exp_XOR; } +"~" { return exp_NOT; } +"<<" { return exp_SHIFTLEFT; } +">>" { return exp_SHIFTRIGHT; } "(" { return exp_OPENPARENT; } ")" { return exp_CLOSEPARENT; } diff --git a/Source/cmExprParserHelper.cxx b/Source/cmExprParserHelper.cxx index 7728d74..9c1795e 100644 --- a/Source/cmExprParserHelper.cxx +++ b/Source/cmExprParserHelper.cxx @@ -42,7 +42,7 @@ int cmExprParserHelper::ParseString(const char* str, int verb) this->InputBuffer = str; this->InputBufferPos = 0; this->CurrentLine = 0; - + this->Result = 0; yyscan_t yyscanner; @@ -61,7 +61,7 @@ int cmExprParserHelper::ParseString(const char* str, int verb) if ( Verbose ) { - std::cerr << "Expanding [" << str << "] produced: [" + std::cerr << "Expanding [" << str << "] produced: [" << this->Result << "]" << std::endl; } return 1; diff --git a/Source/cmExprParserHelper.h b/Source/cmExprParserHelper.h index 690426d..4b76b33 100644 --- a/Source/cmExprParserHelper.h +++ b/Source/cmExprParserHelper.h @@ -9,7 +9,7 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ -#ifndef cmExprParserHelper_h +#ifndef cmExprParserHelper_h #define cmExprParserHelper_h #include "cmStandardIncludes.h" diff --git a/Source/cmExternalMakefileProjectGenerator.cxx b/Source/cmExternalMakefileProjectGenerator.cxx index 6ed84bd..9c965cc 100644 --- a/Source/cmExternalMakefileProjectGenerator.cxx +++ b/Source/cmExternalMakefileProjectGenerator.cxx @@ -49,7 +49,7 @@ const char* cmExternalMakefileProjectGenerator::GetGlobalGeneratorName( } // otherwise search for the matching global generator - for (std::vector<std::string>::const_iterator + for (std::vector<std::string>::const_iterator it = this->SupportedGlobalGenerators.begin(); it != this->SupportedGlobalGenerators.end(); ++it) diff --git a/Source/cmExternalMakefileProjectGenerator.h b/Source/cmExternalMakefileProjectGenerator.h index 46f1d31..182c1a8 100644 --- a/Source/cmExternalMakefileProjectGenerator.h +++ b/Source/cmExternalMakefileProjectGenerator.h @@ -22,12 +22,12 @@ class cmGlobalGenerator; * \brief Base class for generators for "External Makefile based IDE projects". * * cmExternalMakefileProjectGenerator is a base class for generators - * for "external makefile based projects", i.e. IDE projects which work + * for "external makefile based projects", i.e. IDE projects which work * an already existing makefiles. * See cmGlobalKdevelopGenerator as an example. - * After the makefiles have been generated by one of the Makefile + * After the makefiles have been generated by one of the Makefile * generators, the Generate() method is called and this generator - * can iterate over the local generators and/or projects to produce the + * can iterate over the local generators and/or projects to produce the * project files for the IDE. */ class cmExternalMakefileProjectGenerator @@ -39,7 +39,7 @@ public: ///! Get the name for this generator. virtual const char* GetName() const = 0; /** Get the documentation entry for this generator. */ - virtual void GetDocumentation(cmDocumentationEntry& entry, + virtual void GetDocumentation(cmDocumentationEntry& entry, const char* fullName) const = 0; ///! set the global generator which will generate the makefiles @@ -47,7 +47,7 @@ public: {this->GlobalGenerator = generator;} ///! Return the list of global generators supported by this extra generator - const std::vector<std::string>& GetSupportedGlobalGenerators() const + const std::vector<std::string>& GetSupportedGlobalGenerators() const {return this->SupportedGlobalGenerators;} ///! Get the name of the global generator for the given full name @@ -55,7 +55,7 @@ public: /** Create a full name from the given global generator name and the * extra generator name */ - static std::string CreateFullGeneratorName(const char* globalGenerator, + static std::string CreateFullGeneratorName(const char* globalGenerator, const char* extraGenerator); ///! Generate the project files, the Makefiles have already been generated diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx index 93533e5..a4aa75a 100644 --- a/Source/cmFLTKWrapUICommand.cxx +++ b/Source/cmFLTKWrapUICommand.cxx @@ -33,19 +33,19 @@ bool cmFLTKWrapUICommand std::vector<std::string> newArgs; this->Makefile->ExpandSourceListArguments(args,newArgs, 1); - - // get the list of GUI files from which .cxx and .h will be generated + + // get the list of GUI files from which .cxx and .h will be generated std::string outputDirectory = this->Makefile->GetCurrentOutputDirectory(); - // Some of the generated files are *.h so the directory "GUI" + // Some of the generated files are *.h so the directory "GUI" // where they are created have to be added to the include path this->Makefile->AddIncludeDirectory( outputDirectory.c_str() ); - for(std::vector<std::string>::iterator i = (newArgs.begin() + 1); + for(std::vector<std::string>::iterator i = (newArgs.begin() + 1); i != newArgs.end(); i++) { cmSourceFile *curr = this->Makefile->GetSource(i->c_str()); - // if we should use the source GUI + // if we should use the source GUI // to generate .cxx and .h files if (!curr || !curr->GetPropertyAsBool("WRAP_EXCLUDE")) { @@ -107,11 +107,11 @@ bool cmFLTKWrapUICommand std::string varName = this->Target; varName += "_FLTK_UI_SRCS"; this->Makefile->AddDefinition(varName.c_str(), sourceListValue.c_str()); - + return true; } -void cmFLTKWrapUICommand::FinalPass() +void cmFLTKWrapUICommand::FinalPass() { // people should add the srcs to the target themselves, but the old command // didn't support that, so check and see if they added the files in and if @@ -119,7 +119,7 @@ void cmFLTKWrapUICommand::FinalPass() cmTarget* target = this->Makefile->FindTarget(this->Target.c_str()); if(!target) { - std::string msg = + std::string msg = "FLTK_WRAP_UI was called with a target that was never created: "; msg += this->Target; msg +=". The problem was found while processing the source directory: "; @@ -128,12 +128,12 @@ void cmFLTKWrapUICommand::FinalPass() cmSystemTools::Message(msg.c_str(),"Warning"); return; } - std::vector<cmSourceFile*> const& srcs = + std::vector<cmSourceFile*> const& srcs = target->GetSourceFiles(); bool found = false; for (unsigned int i = 0; i < srcs.size(); ++i) { - if (srcs[i]->GetFullPath() == + if (srcs[i]->GetFullPath() == this->GeneratedSourcesClasses[0]->GetFullPath()) { found = true; @@ -142,7 +142,7 @@ void cmFLTKWrapUICommand::FinalPass() } if (!found) { - std::string msg = + 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. " @@ -153,13 +153,13 @@ void cmFLTKWrapUICommand::FinalPass() "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."; + "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 size_t lastHeadersClass = this->GeneratedSourcesClasses.size(); - + // Generate code for all the .fl files for(size_t classNum = 0; classNum < lastHeadersClass; classNum++) { diff --git a/Source/cmFLTKWrapUICommand.h b/Source/cmFLTKWrapUICommand.h index cb0f9d5..530de2c 100644 --- a/Source/cmFLTKWrapUICommand.h +++ b/Source/cmFLTKWrapUICommand.h @@ -28,7 +28,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmFLTKWrapUICommand; } @@ -39,7 +39,7 @@ public: */ virtual bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus &status); - + /** * This is called at the end after all the information * specified by the command is accumulated. Most commands do @@ -61,7 +61,7 @@ public: { return "Create FLTK user interfaces Wrappers."; } - + /** * More documentation. */ @@ -75,7 +75,7 @@ public: "resultingLibraryName_FLTK_UI_SRCS which should be added to your " "library."; } - + private: /** * List of produced files. @@ -83,7 +83,7 @@ private: std::vector<cmSourceFile *> GeneratedSourcesClasses; /** - * List of Fluid files that provide the source + * List of Fluid files that provide the source * generating .cxx and .h files */ std::string Target; diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 5da5a01..5103d39 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -271,7 +271,7 @@ bool cmFileCommand::HandleReadCommand(std::vector<std::string> const& args) // Open the specified file. #if defined(_WIN32) || defined(__CYGWIN__) - std::ifstream file(fileName.c_str(), std::ios::in | + std::ifstream file(fileName.c_str(), std::ios::in | (hexOutputArg.IsEnabled() ? std::ios::binary : std::ios::in)); #else std::ifstream file(fileName.c_str(), std::ios::in); @@ -2621,17 +2621,17 @@ namespace { ::curl_easy_cleanup(this->Easy); } } - - inline void release(void) + + inline void release(void) { this->Easy = 0; return; } - + private: ::CURL * Easy; }; - + } #endif diff --git a/Source/cmFileTimeComparison.cxx b/Source/cmFileTimeComparison.cxx index b1050d3..3167be4 100644 --- a/Source/cmFileTimeComparison.cxx +++ b/Source/cmFileTimeComparison.cxx @@ -116,7 +116,7 @@ cmFileTimeComparison::~cmFileTimeComparison() } //---------------------------------------------------------------------------- -bool cmFileTimeComparison::FileTimeCompare(const char* f1, +bool cmFileTimeComparison::FileTimeCompare(const char* f1, const char* f2, int* result) { return this->Internals->FileTimeCompare(f1, f2, result); @@ -129,7 +129,7 @@ bool cmFileTimeComparison::FileTimesDiffer(const char* f1, const char* f2) } //---------------------------------------------------------------------------- -int cmFileTimeComparisonInternal::Compare(cmFileTimeComparison_Type* s1, +int cmFileTimeComparisonInternal::Compare(cmFileTimeComparison_Type* s1, cmFileTimeComparison_Type* s2) { #if !defined(_WIN32) || defined(__CYGWIN__) diff --git a/Source/cmFileTimeComparison.h b/Source/cmFileTimeComparison.h index f5de2f6..cc1ef63 100644 --- a/Source/cmFileTimeComparison.h +++ b/Source/cmFileTimeComparison.h @@ -31,7 +31,7 @@ public: * Compare file modification times. * Return true for successful comparison and false for error. * When true is returned, result has -1, 0, +1 for - * f1 older, same, or newer than f2. + * f1 older, same, or newer than f2. */ bool FileTimeCompare(const char* f1, const char* f2, int* result); @@ -42,7 +42,7 @@ public: bool FileTimesDiffer(const char* f1, const char* f2); protected: - + cmFileTimeComparisonInternal* Internals; }; diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index fb8bcf7..a54bf7c 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -10,7 +10,7 @@ See the License for more information. ============================================================================*/ #include "cmFindBase.h" - + cmFindBase::cmFindBase() { this->AlreadyInCache = false; @@ -132,7 +132,7 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn) bool compatibility = this->Makefile->NeedBackwardsCompatibility(2,3); // copy argsIn into args so it can be modified, - // in the process extract the DOC "documentation" + // in the process extract the DOC "documentation" size_t size = argsIn.size(); std::vector<std::string> args; bool foundDoc = false; @@ -178,7 +178,7 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn) this->AlreadyInCache = true; return true; } - this->AlreadyInCache = false; + this->AlreadyInCache = false; // Find the current root path mode. this->SelectDefaultRootPathMode(); @@ -264,17 +264,17 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn) } else if(this->Names.size() == 1) { - this->VariableDocumentation += "the " + this->VariableDocumentation += "the " + this->Names[0] + " library be found"; } else - { + { this->VariableDocumentation += "one of the " + this->Names[0]; for (unsigned int j = 1; j < this->Names.size() - 1; ++j) { this->VariableDocumentation += ", " + this->Names[j]; } - this->VariableDocumentation += " or " + this->VariableDocumentation += " or " + this->Names[this->Names.size() - 1] + " libraries be found"; } } @@ -504,7 +504,7 @@ void cmFindBase::AddPathSuffixes() cmSystemTools::ConvertToUnixSlashes(*i); // copy each finalPath combined with SearchPathSuffixes // to the SearchPaths ivar - for(std::vector<std::string>::iterator j = + for(std::vector<std::string>::iterator j = this->SearchPathSuffixes.begin(); j != this->SearchPathSuffixes.end(); ++j) { @@ -517,7 +517,7 @@ void cmFindBase::AddPathSuffixes() p += std::string("/"); } p += *j; - // add to all paths because the search path may be modified + // add to all paths because the search path may be modified // later with lib being replaced for lib64 which may exist paths.push_back(p); } @@ -535,13 +535,13 @@ void cmFindBase::PrintFindStuff() std::cerr << "SearchAppBundleOnly: " << this->SearchAppBundleOnly << "\n"; std::cerr << "SearchAppBundleFirst: " << this->SearchAppBundleFirst << "\n"; std::cerr << "VariableName " << this->VariableName << "\n"; - std::cerr << "VariableDocumentation " + std::cerr << "VariableDocumentation " << this->VariableDocumentation << "\n"; std::cerr << "NoDefaultPath " << this->NoDefaultPath << "\n"; - std::cerr << "NoCMakeEnvironmentPath " + std::cerr << "NoCMakeEnvironmentPath " << this->NoCMakeEnvironmentPath << "\n"; std::cerr << "NoCMakePath " << this->NoCMakePath << "\n"; - std::cerr << "NoSystemEnvironmentPath " + std::cerr << "NoSystemEnvironmentPath " << this->NoSystemEnvironmentPath << "\n"; std::cerr << "NoCMakeSystemPath " << this->NoCMakeSystemPath << "\n"; std::cerr << "EnvironmentPath " << this->EnvironmentPath << "\n"; diff --git a/Source/cmFindBase.h b/Source/cmFindBase.h index 37ab2ec..eac1885 100644 --- a/Source/cmFindBase.h +++ b/Source/cmFindBase.h @@ -30,7 +30,7 @@ public: */ virtual bool ParseArguments(std::vector<std::string> const& args); cmTypeMacro(cmFindBase, cmFindCommon); - + virtual const char* GetFullDocumentation() const; protected: @@ -43,7 +43,7 @@ protected: // also copy the documentation from the cache to VariableDocumentation // if it has documentation in the cache bool CheckForVariableInCache(); - + cmStdString GenericDocumentation; // use by command during find cmStdString VariableDocumentation; diff --git a/Source/cmFindFileCommand.h b/Source/cmFindFileCommand.h index 7d349d3..1bfdcbd 100644 --- a/Source/cmFindFileCommand.h +++ b/Source/cmFindFileCommand.h @@ -18,7 +18,7 @@ * \brief Define a command to search for an executable program. * * cmFindFileCommand is used to define a CMake variable - * that specifies an executable program. The command searches + * that specifies an executable program. The command searches * in the current path (e.g., PATH environment variable) for * an executable that matches one of the supplied names. */ @@ -29,7 +29,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmFindFileCommand; } @@ -42,7 +42,7 @@ public: { return "Find the full path to a file."; } - + cmTypeMacro(cmFindFileCommand, cmFindPathCommand); protected: virtual void GenerateDocumentation(); diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx index 652e697..0080e55 100644 --- a/Source/cmFindLibraryCommand.cxx +++ b/Source/cmFindLibraryCommand.cxx @@ -15,7 +15,7 @@ #include <cmsys/stl/algorithm> cmFindLibraryCommand::cmFindLibraryCommand() -{ +{ this->EnvironmentPath = "LIB"; } diff --git a/Source/cmFindLibraryCommand.h b/Source/cmFindLibraryCommand.h index 31a5c3f..455348a 100644 --- a/Source/cmFindLibraryCommand.h +++ b/Source/cmFindLibraryCommand.h @@ -29,7 +29,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmFindLibraryCommand; } @@ -59,7 +59,7 @@ public: return "Find a library."; } cmTypeMacro(cmFindLibraryCommand, cmFindBase); - + protected: void AddArchitecturePaths(const char* suffix); void AddArchitecturePath(std::string const& dir, diff --git a/Source/cmFindPathCommand.cxx b/Source/cmFindPathCommand.cxx index 846d187..9524924 100644 --- a/Source/cmFindPathCommand.cxx +++ b/Source/cmFindPathCommand.cxx @@ -104,7 +104,7 @@ bool cmFindPathCommand (this->VariableName.c_str(), (this->VariableName + "-NOTFOUND").c_str(), this->VariableDocumentation.c_str(), - (this->IncludeFileInPath) ? + (this->IncludeFileInPath) ? cmCacheManager::FILEPATH :cmCacheManager::PATH); return true; } @@ -143,14 +143,14 @@ cmFindPathCommand::FindHeaderInFramework(std::string const& file, // remove the name from the slash; fileName = fileName.substr(pos+1); frameWorkName = file; - frameWorkName = + 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) { fileName = file; frameWorkName = ""; - } + } if(frameWorkName.size()) { std::string fpath = dir; @@ -160,7 +160,7 @@ cmFindPathCommand::FindHeaderInFramework(std::string const& file, intPath += "/Headers/"; intPath += fileName; if(cmSystemTools::FileExists(intPath.c_str())) - { + { if(this->IncludeFileInPath) { return intPath; diff --git a/Source/cmFindPathCommand.h b/Source/cmFindPathCommand.h index a612990..759567d 100644 --- a/Source/cmFindPathCommand.h +++ b/Source/cmFindPathCommand.h @@ -29,7 +29,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmFindPathCommand; } diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx index 00f5419..909b333 100644 --- a/Source/cmFindProgramCommand.cxx +++ b/Source/cmFindProgramCommand.cxx @@ -81,7 +81,7 @@ bool cmFindProgramCommand result.c_str(), this->VariableDocumentation.c_str(), cmCacheManager::FILEPATH); - + return true; } this->Makefile->AddCacheDefinition(this->VariableName.c_str(), @@ -117,21 +117,21 @@ std::string cmFindProgramCommand 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, + std::string appPath = cmSystemTools::FindDirectory(appName.c_str(), + this->SearchPaths, true); if ( !appPath.empty() ) { std::string executable = GetBundleExecutable(appPath); - if (!executable.empty()) + if (!executable.empty()) { return cmSystemTools::CollapseFullPath(executable.c_str()); } - } - } + } + } // Couldn't find app bundle return ""; @@ -142,44 +142,44 @@ std::string cmFindProgramCommand::GetBundleExecutable(std::string bundlePath) std::string executable = ""; (void)bundlePath; #if defined(__APPLE__) - // Started with an example on developer.apple.com about finding bundles + // Started with an example on developer.apple.com about finding bundles // and modified from that. - + // 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. - CFURLRef bundleURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, + CFURLRef bundleURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, bundlePathCFS, kCFURLPOSIXPathStyle, true ); - + // Make a bundle instance using the URLRef. CFBundleRef appBundle = CFBundleCreate( kCFAllocatorDefault, bundleURL ); - + // returned executableURL is relative to <appbundle>/Contents/MacOS/ CFURLRef executableURL = CFBundleCopyExecutableURL(appBundle); - + if (executableURL != NULL) { const int MAX_OSX_PATH_SIZE = 1024; char buffer[MAX_OSX_PATH_SIZE]; - + // Convert the CFString to a C string - CFStringGetCString( CFURLGetString(executableURL), buffer, + CFStringGetCString( CFURLGetString(executableURL), buffer, MAX_OSX_PATH_SIZE, kCFStringEncodingUTF8 ); - + // And finally to a c++ string executable = bundlePath + "/Contents/MacOS/" + std::string(buffer); // Only release CFURLRef if it's not null CFRelease( executableURL ); } - // Any CF objects returned from functions with "create" or + // Any CF objects returned from functions with "create" or // "copy" in their names must be released by us! CFRelease( bundlePathCFS ); CFRelease( bundleURL ); diff --git a/Source/cmFindProgramCommand.h b/Source/cmFindProgramCommand.h index c1b14f9..8350c9b 100644 --- a/Source/cmFindProgramCommand.h +++ b/Source/cmFindProgramCommand.h @@ -18,7 +18,7 @@ * \brief Define a command to search for an executable program. * * cmFindProgramCommand is used to define a CMake variable - * that specifies an executable program. The command searches + * that specifies an executable program. The command searches * in the current path (e.g., PATH environment variable) for * an executable that matches one of the supplied names. */ @@ -28,7 +28,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmFindProgramCommand; } @@ -57,7 +57,7 @@ public: { return "Find an executable program."; } - + cmTypeMacro(cmFindProgramCommand, cmFindBase); protected: diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx index 74966c9..d697067 100644 --- a/Source/cmForEachCommand.cxx +++ b/Source/cmForEachCommand.cxx @@ -25,7 +25,7 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf, else if (!cmSystemTools::Strucmp(lff.Name.c_str(),"endforeach")) { // if this is the endofreach for this statement - if (!this->Depth) + if (!this->Depth) { // Remove the function blocker for this scope or bail. cmsys::auto_ptr<cmFunctionBlocker> @@ -45,7 +45,7 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf, std::string tmps; cmListFileArgument arg; for( ; j != this->Args.end(); ++j) - { + { // set the variable to the loop value mf.AddDefinition(this->Args[0].c_str(),j->c_str()); // Invoke all the functions that were collected in the block. @@ -83,10 +83,10 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf, this->Depth--; } } - + // record the command this->Functions.push_back(lff); - + // always return true return true; } @@ -121,7 +121,7 @@ bool cmForEachCommand { return this->HandleInMode(args); } - + // create a function blocker cmForEachFunctionBlocker *f = new cmForEachFunctionBlocker(); if ( args.size() > 1 ) @@ -157,7 +157,7 @@ bool cmForEachCommand step = 1; } } - if ( + if ( (start > stop && step > 0) || (start < stop && step < 0) || step == 0 @@ -198,7 +198,7 @@ bool cmForEachCommand f->Args = args; } this->Makefile->AddFunctionBlocker(f); - + return true; } diff --git a/Source/cmForEachCommand.h b/Source/cmForEachCommand.h index ae50005..dc47613 100644 --- a/Source/cmForEachCommand.h +++ b/Source/cmForEachCommand.h @@ -25,7 +25,7 @@ public: cmMakefile &mf, cmExecutionStatus &); virtual bool ShouldRemove(const cmListFileFunction& lff, cmMakefile &mf); - + std::vector<std::string> Args; std::vector<cmListFileFunction> Functions; private: @@ -39,7 +39,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmForEachCommand; } @@ -68,7 +68,7 @@ public: { return "Evaluate a group of commands for each value in a list."; } - + /** * More documentation. */ @@ -106,7 +106,7 @@ public: "following it in the iteration." ; } - + cmTypeMacro(cmForEachCommand, cmCommand); private: bool HandleInMode(std::vector<std::string> const& args); diff --git a/Source/cmFunctionBlocker.h b/Source/cmFunctionBlocker.h index 9ee0b5c..68bf762 100644 --- a/Source/cmFunctionBlocker.h +++ b/Source/cmFunctionBlocker.h @@ -29,7 +29,7 @@ public: /** * should this function blocker be removed, useful when one function adds a - * blocker and another must remove it + * blocker and another must remove it */ virtual bool ShouldRemove(const cmListFileFunction&, cmMakefile&) {return false;} diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx index ce36145..10b47b9 100644 --- a/Source/cmFunctionCommand.cxx +++ b/Source/cmFunctionCommand.cxx @@ -65,7 +65,7 @@ public: * The name of the command as specified in CMakeList.txt. */ virtual const char* GetName() const { return this->Args[0].c_str(); } - + /** * Succinct documentation. */ @@ -131,15 +131,15 @@ bool cmFunctionHelperCommand::InvokeInitialPass { cmOStringStream tmpStream; tmpStream << "ARGV" << t; - this->Makefile->AddDefinition(tmpStream.str().c_str(), + this->Makefile->AddDefinition(tmpStream.str().c_str(), expandedArgs[t].c_str()); this->Makefile->MarkVariableAsUsed(tmpStream.str().c_str()); } - + // define the formal arguments for (unsigned int j = 1; j < this->Args.size(); ++j) { - this->Makefile->AddDefinition(this->Args[j].c_str(), + this->Makefile->AddDefinition(this->Args[j].c_str(), expandedArgs[j-1].c_str()); } @@ -208,7 +208,7 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf, else if(!cmSystemTools::Strucmp(lff.Name.c_str(),"endfunction")) { // if this is the endfunction for this function then execute - if (!this->Depth) + if (!this->Depth) { std::string name = this->Args[0]; std::vector<std::string>::size_type cc; @@ -224,20 +224,20 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf, f->Args = this->Args; f->Functions = this->Functions; mf.RecordPolicies(f->Policies); - + // Set the FilePath on the arguments to match the function since it is // not stored and the original values may be freed for (unsigned int i = 0; i < f->Functions.size(); ++i) { for (unsigned int j = 0; j < f->Functions[i].Arguments.size(); ++j) { - f->Functions[i].Arguments[j].FilePath = + f->Functions[i].Arguments[j].FilePath = f->Functions[i].FilePath.c_str(); } } std::string newName = "_" + this->Args[0]; - mf.GetCMakeInstance()->RenameCommand(this->Args[0].c_str(), + mf.GetCMakeInstance()->RenameCommand(this->Args[0].c_str(), newName.c_str()); mf.AddCommand(f); @@ -265,7 +265,7 @@ ShouldRemove(const cmListFileFunction& lff, cmMakefile &mf) if(!cmSystemTools::Strucmp(lff.Name.c_str(),"endfunction")) { std::vector<std::string> expandedArguments; - mf.ExpandArguments(lff.Arguments, expandedArguments); + mf.ExpandArguments(lff.Arguments, expandedArguments); // if the endfunction has arguments then make sure // they match the ones in the openeing function command if ((expandedArguments.empty() || @@ -291,7 +291,7 @@ bool cmFunctionCommand cmFunctionFunctionBlocker *f = new cmFunctionFunctionBlocker(); for(std::vector<std::string>::const_iterator j = args.begin(); j != args.end(); ++j) - { + { f->Args.push_back(*j); } this->Makefile->AddFunctionBlocker(f); diff --git a/Source/cmFunctionCommand.h b/Source/cmFunctionCommand.h index 43c8e29..730a7a7 100644 --- a/Source/cmFunctionCommand.h +++ b/Source/cmFunctionCommand.h @@ -20,11 +20,11 @@ class cmFunctionFunctionBlocker : public cmFunctionBlocker public: cmFunctionFunctionBlocker() {this->Depth=0;} virtual ~cmFunctionFunctionBlocker() {} - virtual bool IsFunctionBlocked(const cmListFileFunction&, + virtual bool IsFunctionBlocked(const cmListFileFunction&, cmMakefile &mf, cmExecutionStatus &); virtual bool ShouldRemove(const cmListFileFunction&, cmMakefile &mf); - + std::vector<std::string> Args; std::vector<cmListFileFunction> Functions; int Depth; diff --git a/Source/cmGeneratedFileStream.cxx b/Source/cmGeneratedFileStream.cxx index 1a391ed..0af0753 100644 --- a/Source/cmGeneratedFileStream.cxx +++ b/Source/cmGeneratedFileStream.cxx @@ -31,7 +31,7 @@ cmGeneratedFileStream::cmGeneratedFileStream(const char* name, bool quiet): // Check if the file opened. if(!*this && !quiet) { - cmSystemTools::Error("Cannot open file for write: ", + cmSystemTools::Error("Cannot open file for write: ", this->TempName.c_str()); cmSystemTools::ReportLastSystemError(""); } @@ -58,7 +58,7 @@ cmGeneratedFileStream::Open(const char* name, bool quiet, bool binaryFlag) // Open the temporary output file. if ( binaryFlag ) { - this->Stream::open(this->TempName.c_str(), + this->Stream::open(this->TempName.c_str(), std::ios::out | std::ios::binary); } else @@ -69,7 +69,7 @@ cmGeneratedFileStream::Open(const char* name, bool quiet, bool binaryFlag) // Check if the file opened. if(!*this && !quiet) { - cmSystemTools::Error("Cannot open file for write: ", + cmSystemTools::Error("Cannot open file for write: ", this->TempName.c_str()); cmSystemTools::ReportLastSystemError(""); } diff --git a/Source/cmGetCMakePropertyCommand.h b/Source/cmGetCMakePropertyCommand.h index 0a5917c..b77eaae 100644 --- a/Source/cmGetCMakePropertyCommand.h +++ b/Source/cmGetCMakePropertyCommand.h @@ -17,7 +17,7 @@ class cmGetCMakePropertyCommand : public cmCommand { public: - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmGetCMakePropertyCommand; } @@ -46,7 +46,7 @@ public: { return "Get a property of the CMake instance."; } - + /** * Longer documentation. */ @@ -63,7 +63,7 @@ public: "\n" "See also the more general get_property() command."; } - + cmTypeMacro(cmGetCMakePropertyCommand, cmCommand); }; diff --git a/Source/cmGetDirectoryPropertyCommand.cxx b/Source/cmGetDirectoryPropertyCommand.cxx index 5714b50..9e76e1b 100644 --- a/Source/cmGetDirectoryPropertyCommand.cxx +++ b/Source/cmGetDirectoryPropertyCommand.cxx @@ -22,12 +22,12 @@ bool cmGetDirectoryPropertyCommand this->SetError("called with incorrect number of arguments"); return false; } - + std::vector<std::string>::const_iterator i = args.begin(); std::string variable = *i; ++i; std::string output = ""; - + // get the directory argument if there is one cmMakefile *dir = this->Makefile; if (*i == "DIRECTORY") @@ -52,7 +52,7 @@ bool cmGetDirectoryPropertyCommand sd = cmSystemTools::CollapseFullPath(sd.c_str()); // lookup the makefile from the directory name - cmLocalGenerator *lg = + cmLocalGenerator *lg = this->Makefile->GetLocalGenerator()->GetGlobalGenerator()-> FindLocalGenerator(sd.c_str()); if (!lg) @@ -69,7 +69,7 @@ bool cmGetDirectoryPropertyCommand // OK, now we have the directory to process, we just get the requested // information out of it - + if ( *i == "DEFINITION" ) { ++i; diff --git a/Source/cmGetDirectoryPropertyCommand.h b/Source/cmGetDirectoryPropertyCommand.h index 901b90c..d0d5820 100644 --- a/Source/cmGetDirectoryPropertyCommand.h +++ b/Source/cmGetDirectoryPropertyCommand.h @@ -17,7 +17,7 @@ class cmGetDirectoryPropertyCommand : public cmCommand { public: - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmGetDirectoryPropertyCommand; } @@ -46,7 +46,7 @@ public: { return "Get a property of DIRECTORY scope."; } - + /** * Longer documentation. */ @@ -69,7 +69,7 @@ public: "\n" "See also the more general get_property() command."; } - + cmTypeMacro(cmGetDirectoryPropertyCommand, cmCommand); }; diff --git a/Source/cmGetFilenameComponentCommand.cxx b/Source/cmGetFilenameComponentCommand.cxx index 1a31d54..fd1ad60 100644 --- a/Source/cmGetFilenameComponentCommand.cxx +++ b/Source/cmGetFilenameComponentCommand.cxx @@ -32,7 +32,7 @@ bool cmGetFilenameComponentCommand return true; } } - + std::string result; std::string filename = args[1]; if(filename.find("[HKEY") != filename.npos) @@ -79,7 +79,7 @@ bool cmGetFilenameComponentCommand } } } - cmSystemTools::SplitProgramFromArgs(filename.c_str(), + cmSystemTools::SplitProgramFromArgs(filename.c_str(), result, programArgs); } else if (args[2] == "EXT") @@ -104,7 +104,7 @@ bool cmGetFilenameComponentCommand result = cmSystemTools::GetRealPath(result.c_str()); } } - else + else { std::string err = "unknown component " + args[2]; this->SetError(err.c_str()); @@ -125,7 +125,7 @@ bool cmGetFilenameComponentCommand args[2] == "PATH" ? cmCacheManager::FILEPATH : cmCacheManager::STRING); } - else + else { if(programArgs.size() && storeArgs.size()) { diff --git a/Source/cmGetFilenameComponentCommand.h b/Source/cmGetFilenameComponentCommand.h index 0c8e57a..c461016 100644 --- a/Source/cmGetFilenameComponentCommand.h +++ b/Source/cmGetFilenameComponentCommand.h @@ -18,7 +18,7 @@ * \brief Get a specific component of a filename. * * cmGetFilenameComponentCommand is a utility command used to get the path, - * name, extension or name without extension of a full filename. + * name, extension or name without extension of a full filename. */ class cmGetFilenameComponentCommand : public cmCommand { @@ -26,7 +26,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmGetFilenameComponentCommand; } @@ -55,7 +55,7 @@ public: { return "Get a specific component of a full filename."; } - + /** * More documentation. */ @@ -82,7 +82,7 @@ public: "from the program name and stored in <ARG_VAR>. This is used to " "separate a program name from its arguments in a command line string."; } - + cmTypeMacro(cmGetFilenameComponentCommand, cmCommand); }; diff --git a/Source/cmGetPropertyCommand.h b/Source/cmGetPropertyCommand.h index dca2627..3c597fd 100644 --- a/Source/cmGetPropertyCommand.h +++ b/Source/cmGetPropertyCommand.h @@ -19,7 +19,7 @@ class cmGetPropertyCommand : public cmCommand public: cmGetPropertyCommand(); - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmGetPropertyCommand; } @@ -48,7 +48,7 @@ public: { return "Get a property."; } - + /** * Longer documentation. */ @@ -92,7 +92,7 @@ public: "If documentation is requested for a property that has not been " "defined NOTFOUND is returned."; } - + cmTypeMacro(cmGetPropertyCommand, cmCommand); private: enum OutType { OutValue, OutDefined, OutBriefDoc, OutFullDoc, OutSet }; diff --git a/Source/cmGetSourceFilePropertyCommand.h b/Source/cmGetSourceFilePropertyCommand.h index 6d52503..2ba8103 100644 --- a/Source/cmGetSourceFilePropertyCommand.h +++ b/Source/cmGetSourceFilePropertyCommand.h @@ -17,7 +17,7 @@ class cmGetSourceFilePropertyCommand : public cmCommand { public: - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmGetSourceFilePropertyCommand; } @@ -41,7 +41,7 @@ public: { return "Get a property for a source file."; } - + /** * Longer documentation. */ @@ -57,7 +57,7 @@ public: "\n" "See also the more general get_property() command."; } - + cmTypeMacro(cmGetSourceFilePropertyCommand, cmCommand); }; diff --git a/Source/cmGetTargetPropertyCommand.h b/Source/cmGetTargetPropertyCommand.h index b60abea..f5e1aa7 100644 --- a/Source/cmGetTargetPropertyCommand.h +++ b/Source/cmGetTargetPropertyCommand.h @@ -17,7 +17,7 @@ class cmGetTargetPropertyCommand : public cmCommand { public: - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmGetTargetPropertyCommand; } @@ -41,7 +41,7 @@ public: { return "Get a property from a target."; } - + /** * Longer documentation. */ @@ -59,7 +59,7 @@ public: "\n" "See also the more general get_property() command."; } - + cmTypeMacro(cmGetTargetPropertyCommand, cmCommand); }; diff --git a/Source/cmGetTestPropertyCommand.h b/Source/cmGetTestPropertyCommand.h index af6bafa..01f54d9 100644 --- a/Source/cmGetTestPropertyCommand.h +++ b/Source/cmGetTestPropertyCommand.h @@ -17,7 +17,7 @@ class cmGetTestPropertyCommand : public cmCommand { public: - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmGetTestPropertyCommand; } diff --git a/Source/cmGlobalBorlandMakefileGenerator.cxx b/Source/cmGlobalBorlandMakefileGenerator.cxx index b87b7e1..8c6787a 100644 --- a/Source/cmGlobalBorlandMakefileGenerator.cxx +++ b/Source/cmGlobalBorlandMakefileGenerator.cxx @@ -25,14 +25,14 @@ cmGlobalBorlandMakefileGenerator::cmGlobalBorlandMakefileGenerator() void cmGlobalBorlandMakefileGenerator -::EnableLanguage(std::vector<std::string>const& l, - cmMakefile *mf, +::EnableLanguage(std::vector<std::string>const& l, + cmMakefile *mf, bool optional) { std::string outdir = this->CMakeInstance->GetStartOutputDirectory(); mf->AddDefinition("BORLAND", "1"); mf->AddDefinition("CMAKE_GENERATOR_CC", "bcc32"); - mf->AddDefinition("CMAKE_GENERATOR_CXX", "bcc32"); + mf->AddDefinition("CMAKE_GENERATOR_CXX", "bcc32"); this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional); } diff --git a/Source/cmGlobalBorlandMakefileGenerator.h b/Source/cmGlobalBorlandMakefileGenerator.h index 0d38689..c0cb8a6 100644 --- a/Source/cmGlobalBorlandMakefileGenerator.h +++ b/Source/cmGlobalBorlandMakefileGenerator.h @@ -23,9 +23,9 @@ class cmGlobalBorlandMakefileGenerator : public cmGlobalNMakeMakefileGenerator { public: cmGlobalBorlandMakefileGenerator(); - static cmGlobalGenerator* New() + static cmGlobalGenerator* New() { return new cmGlobalBorlandMakefileGenerator; } - + ///! Get the name for the generator. virtual const char* GetName() const { return cmGlobalBorlandMakefileGenerator::GetActualName();} @@ -33,13 +33,13 @@ public: /** Get the documentation entry for this generator. */ virtual void GetDocumentation(cmDocumentationEntry& entry) const; - + ///! Create a local generator appropriate to this Global Generator virtual cmLocalGenerator *CreateLocalGenerator(); /** * Try to determine system infomation such as shared library - * extension, pthreads, byte order etc. + * extension, pthreads, byte order etc. */ virtual void EnableLanguage(std::vector<std::string>const& languages, cmMakefile *, bool optional); diff --git a/Source/cmGlobalJOMMakefileGenerator.cxx b/Source/cmGlobalJOMMakefileGenerator.cxx index 411e28b..ef42bd4 100644 --- a/Source/cmGlobalJOMMakefileGenerator.cxx +++ b/Source/cmGlobalJOMMakefileGenerator.cxx @@ -22,14 +22,14 @@ cmGlobalJOMMakefileGenerator::cmGlobalJOMMakefileGenerator() } void cmGlobalJOMMakefileGenerator -::EnableLanguage(std::vector<std::string>const& l, - cmMakefile *mf, +::EnableLanguage(std::vector<std::string>const& l, + cmMakefile *mf, bool optional) { - // pick a default + // pick a default mf->AddDefinition("CMAKE_GENERATOR_CC", "cl"); mf->AddDefinition("CMAKE_GENERATOR_CXX", "cl"); - if(!(cmSystemTools::GetEnv("INCLUDE") && + if(!(cmSystemTools::GetEnv("INCLUDE") && cmSystemTools::GetEnv("LIB")) ) { @@ -40,7 +40,7 @@ void cmGlobalJOMMakefileGenerator mf->IssueMessage(cmake::WARNING, message); } - + this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional); } diff --git a/Source/cmGlobalJOMMakefileGenerator.h b/Source/cmGlobalJOMMakefileGenerator.h index 08be4b4..691ebdb 100644 --- a/Source/cmGlobalJOMMakefileGenerator.h +++ b/Source/cmGlobalJOMMakefileGenerator.h @@ -34,13 +34,13 @@ public: /** Get the documentation entry for this generator. */ virtual void GetDocumentation(cmDocumentationEntry& entry) const; - + ///! Create a local generator appropriate to this Global Generator virtual cmLocalGenerator *CreateLocalGenerator(); /** * Try to determine system infomation such as shared library - * extension, pthreads, byte order etc. + * extension, pthreads, byte order etc. */ virtual void EnableLanguage(std::vector<std::string>const& languages, cmMakefile *, bool optional); diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx index f699448..a81c26c 100644 --- a/Source/cmGlobalKdevelopGenerator.cxx +++ b/Source/cmGlobalKdevelopGenerator.cxx @@ -51,11 +51,11 @@ cmGlobalKdevelopGenerator::cmGlobalKdevelopGenerator() void cmGlobalKdevelopGenerator::Generate() { - // for each sub project in the project create + // for each sub project in the project create // a kdevelop project - for (std::map<cmStdString, std::vector<cmLocalGenerator*> >::const_iterator - it = this->GlobalGenerator->GetProjectMap().begin(); - it!= this->GlobalGenerator->GetProjectMap().end(); + for (std::map<cmStdString, std::vector<cmLocalGenerator*> >::const_iterator + it = this->GlobalGenerator->GetProjectMap().begin(); + it!= this->GlobalGenerator->GetProjectMap().end(); ++it) { cmMakefile* mf = it->second[0]->GetMakefile(); @@ -94,7 +94,7 @@ void cmGlobalKdevelopGenerator::Generate() break; } } - + // now create a project file this->CreateProjectFile(outputDir, projectDir, projectName, executable, cmakeFilePattern, fileToOpen); @@ -103,7 +103,7 @@ void cmGlobalKdevelopGenerator::Generate() bool cmGlobalKdevelopGenerator ::CreateFilelistFile(const std::vector<cmLocalGenerator*>& lgs, - const std::string& outputDir, + const std::string& outputDir, const std::string& projectDirIn, const std::string& projectname, std::string& cmakeFilePattern, @@ -115,24 +115,24 @@ bool cmGlobalKdevelopGenerator std::set<cmStdString> files; std::string tmp; - for (std::vector<cmLocalGenerator*>::const_iterator it=lgs.begin(); + for (std::vector<cmLocalGenerator*>::const_iterator it=lgs.begin(); it!=lgs.end(); it++) { cmMakefile* makefile=(*it)->GetMakefile(); const std::vector<std::string>& listFiles=makefile->GetListFiles(); - for (std::vector<std::string>::const_iterator lt=listFiles.begin(); + for (std::vector<std::string>::const_iterator lt=listFiles.begin(); lt!=listFiles.end(); lt++) { tmp=*lt; cmSystemTools::ReplaceString(tmp, projectDir.c_str(), ""); // make sure the file is part of this source tree - if ((tmp[0]!='/') && - (strstr(tmp.c_str(), + if ((tmp[0]!='/') && + (strstr(tmp.c_str(), cmake::GetCMakeFilesDirectoryPostSlash())==0)) { files.insert(tmp); tmp=cmSystemTools::GetFilenameName(tmp); - //add all files which dont match the default + //add all files which dont match the default // */CMakeLists.txt;*cmake; to the file pattern if ((tmp!="CMakeLists.txt") && (strstr(tmp.c_str(), ".cmake")==0)) @@ -141,7 +141,7 @@ bool cmGlobalKdevelopGenerator } } } - + //get all sources cmTargets& targets=makefile->GetTargets(); for (cmTargets::iterator ti = targets.begin(); @@ -158,8 +158,8 @@ bool cmGlobalKdevelopGenerator cmSystemTools::ReplaceString(tmp, projectDir.c_str(), ""); - if ((tmp[0]!='/') && - (strstr(tmp.c_str(), + if ((tmp[0]!='/') && + (strstr(tmp.c_str(), cmake::GetCMakeFilesDirectoryPostSlash())==0) && (cmSystemTools::GetFilenameExtension(tmp)!=".moc")) { @@ -187,8 +187,8 @@ bool cmGlobalKdevelopGenerator { tmp=*lt; cmSystemTools::ReplaceString(tmp, projectDir.c_str(), ""); - if ((tmp[0]!='/') && - (strstr(tmp.c_str(), + if ((tmp[0]!='/') && + (strstr(tmp.c_str(), cmake::GetCMakeFilesDirectoryPostSlash())==0)) { files.insert(tmp.c_str()); @@ -223,9 +223,9 @@ bool cmGlobalKdevelopGenerator { return false; } - + fileToOpen=""; - for (std::set<cmStdString>::const_iterator it=files.begin(); + for (std::set<cmStdString>::const_iterator it=files.begin(); it!=files.end(); it++) { // get the full path to the file @@ -257,7 +257,7 @@ existing one, otherwise create a new one */ void cmGlobalKdevelopGenerator ::CreateProjectFile(const std::string& outputDir, const std::string& projectDir, - const std::string& projectname, + const std::string& projectname, const std::string& executable, const std::string& cmakeFilePattern, const std::string& fileToOpen) @@ -271,13 +271,13 @@ void cmGlobalKdevelopGenerator if (cmSystemTools::FileExists(filename.c_str())) { - this->MergeProjectFiles(outputDir, projectDir, filename, - executable, cmakeFilePattern, + this->MergeProjectFiles(outputDir, projectDir, filename, + executable, cmakeFilePattern, fileToOpen, sessionFilename); } else { - // add all subdirectories which are cmake build directories to the + // add all subdirectories which are cmake build directories to the // kdevelop blacklist so they are not monitored for added or removed files // since this is handled by adding files to the cmake files cmsys::Directory d; @@ -295,7 +295,7 @@ void cmGlobalKdevelopGenerator if (cmSystemTools::FileIsDirectory(tmp.c_str())) { tmp += "/CMakeCache.txt"; - if ((nextFile == "CMakeFiles") + if ((nextFile == "CMakeFiles") || (cmSystemTools::FileExists(tmp.c_str()))) { this->Blacklist.push_back(nextFile); @@ -305,17 +305,17 @@ void cmGlobalKdevelopGenerator } } this->CreateNewProjectFile(outputDir, projectDir, filename, - executable, cmakeFilePattern, + executable, cmakeFilePattern, fileToOpen, sessionFilename); } } void cmGlobalKdevelopGenerator -::MergeProjectFiles(const std::string& outputDir, - const std::string& projectDir, - const std::string& filename, - const std::string& executable, +::MergeProjectFiles(const std::string& outputDir, + const std::string& projectDir, + const std::string& filename, + const std::string& executable, const std::string& cmakeFilePattern, const std::string& fileToOpen, const std::string& sessionFilename) @@ -323,8 +323,8 @@ void cmGlobalKdevelopGenerator std::ifstream oldProjectFile(filename.c_str()); if (!oldProjectFile) { - this->CreateNewProjectFile(outputDir, projectDir, filename, - executable, cmakeFilePattern, + this->CreateNewProjectFile(outputDir, projectDir, filename, + executable, cmakeFilePattern, fileToOpen, sessionFilename); return; } @@ -346,7 +346,7 @@ void cmGlobalKdevelopGenerator return; } - for (std::vector<std::string>::const_iterator it=lines.begin(); + for (std::vector<std::string>::const_iterator it=lines.begin(); it!=lines.end(); it++) { const char* line=(*it).c_str(); @@ -368,7 +368,7 @@ void cmGlobalKdevelopGenerator if (strstr(line, "<general>")) { fout<< " <projectmanagement>KDevCustomProject</projectmanagement>\n"; - fout<< " <projectdirectory>" <<projectDir.c_str() + fout<< " <projectdirectory>" <<projectDir.c_str() << "</projectdirectory>\n"; //this one is important fout<<" <absoluteprojectpath>true</absoluteprojectpath>\n"; //and this one @@ -407,7 +407,7 @@ void cmGlobalKdevelopGenerator bool hasSvn = cmSystemTools::FileExists((projectDir + "/.svn").c_str()); bool hasCvs = cmSystemTools::FileExists((projectDir + "/CVS").c_str()); - bool enableCxx = (this->GlobalGenerator->GetLanguageEnabled("C") + bool enableCxx = (this->GlobalGenerator->GetLanguageEnabled("C") || this->GlobalGenerator->GetLanguageEnabled("CXX")); bool enableFortran = this->GlobalGenerator->GetLanguageEnabled("Fortran"); std::string primaryLanguage = "C++"; @@ -425,7 +425,7 @@ void cmGlobalKdevelopGenerator " <projectmanagement>KDevCustomProject</projectmanagement>\n" " <primarylanguage>" << primaryLanguage << "</primarylanguage>\n" " <ignoreparts/>\n" - " <projectdirectory>" << projectDir.c_str() << + " <projectdirectory>" << projectDir.c_str() << "</projectdirectory>\n"; //this one is important fout<<" <absoluteprojectpath>true</absoluteprojectpath>\n"; //and this one @@ -472,7 +472,7 @@ void cmGlobalKdevelopGenerator " <numberofjobs>1</numberofjobs>\n" " <dontact>false</dontact>\n" " <makebin>" << this->GlobalGenerator->GetLocalGenerators()[0]-> - GetMakefile()->GetRequiredDefinition("CMAKE_BUILD_TOOL") + GetMakefile()->GetRequiredDefinition("CMAKE_BUILD_TOOL") << " </makebin>\n" " <selectedenvironment>default</selectedenvironment>\n" " <environments>\n" diff --git a/Source/cmGlobalMSYSMakefileGenerator.cxx b/Source/cmGlobalMSYSMakefileGenerator.cxx index 820e7e6..80526aa 100644 --- a/Source/cmGlobalMSYSMakefileGenerator.cxx +++ b/Source/cmGlobalMSYSMakefileGenerator.cxx @@ -22,7 +22,7 @@ cmGlobalMSYSMakefileGenerator::cmGlobalMSYSMakefileGenerator() this->UseLinkScript = false; } -std::string +std::string cmGlobalMSYSMakefileGenerator::FindMinGW(std::string const& makeloc) { std::string fstab = makeloc; @@ -45,8 +45,8 @@ cmGlobalMSYSMakefileGenerator::FindMinGW(std::string const& makeloc) } void cmGlobalMSYSMakefileGenerator -::EnableLanguage(std::vector<std::string>const& l, - cmMakefile *mf, +::EnableLanguage(std::vector<std::string>const& l, + cmMakefile *mf, bool optional) { this->FindMakeProgram(mf); diff --git a/Source/cmGlobalMSYSMakefileGenerator.h b/Source/cmGlobalMSYSMakefileGenerator.h index b5294ac..b76a5bf 100644 --- a/Source/cmGlobalMSYSMakefileGenerator.h +++ b/Source/cmGlobalMSYSMakefileGenerator.h @@ -23,7 +23,7 @@ class cmGlobalMSYSMakefileGenerator : public cmGlobalUnixMakefileGenerator3 { public: cmGlobalMSYSMakefileGenerator(); - static cmGlobalGenerator* New() { + static cmGlobalGenerator* New() { return new cmGlobalMSYSMakefileGenerator; } ///! Get the name for the generator. @@ -33,13 +33,13 @@ public: /** Get the documentation entry for this generator. */ virtual void GetDocumentation(cmDocumentationEntry& entry) const; - + ///! Create a local generator appropriate to this Global Generator virtual cmLocalGenerator *CreateLocalGenerator(); /** * Try to determine system infomation such as shared library - * extension, pthreads, byte order etc. + * extension, pthreads, byte order etc. */ virtual void EnableLanguage(std::vector<std::string>const& languages, cmMakefile *, bool optional); diff --git a/Source/cmGlobalMinGWMakefileGenerator.cxx b/Source/cmGlobalMinGWMakefileGenerator.cxx index a9e7798..d6045c8 100644 --- a/Source/cmGlobalMinGWMakefileGenerator.cxx +++ b/Source/cmGlobalMinGWMakefileGenerator.cxx @@ -22,10 +22,10 @@ cmGlobalMinGWMakefileGenerator::cmGlobalMinGWMakefileGenerator() } void cmGlobalMinGWMakefileGenerator -::EnableLanguage(std::vector<std::string>const& l, - cmMakefile *mf, +::EnableLanguage(std::vector<std::string>const& l, + cmMakefile *mf, bool optional) -{ +{ this->FindMakeProgram(mf); std::string makeProgram = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM"); std::vector<std::string> locations; diff --git a/Source/cmGlobalMinGWMakefileGenerator.h b/Source/cmGlobalMinGWMakefileGenerator.h index 366146b..9a6a513 100644 --- a/Source/cmGlobalMinGWMakefileGenerator.h +++ b/Source/cmGlobalMinGWMakefileGenerator.h @@ -23,7 +23,7 @@ class cmGlobalMinGWMakefileGenerator : public cmGlobalUnixMakefileGenerator3 { public: cmGlobalMinGWMakefileGenerator(); - static cmGlobalGenerator* New() { + static cmGlobalGenerator* New() { return new cmGlobalMinGWMakefileGenerator; } ///! Get the name for the generator. virtual const char* GetName() const { @@ -32,13 +32,13 @@ public: /** Get the documentation entry for this generator. */ virtual void GetDocumentation(cmDocumentationEntry& entry) const; - + ///! Create a local generator appropriate to this Global Generator virtual cmLocalGenerator *CreateLocalGenerator(); /** * Try to determine system infomation such as shared library - * extension, pthreads, byte order etc. + * extension, pthreads, byte order etc. */ virtual void EnableLanguage(std::vector<std::string>const& languages, cmMakefile *, bool optional); diff --git a/Source/cmGlobalNMakeMakefileGenerator.cxx b/Source/cmGlobalNMakeMakefileGenerator.cxx index c3c15e7..57a26c8 100644 --- a/Source/cmGlobalNMakeMakefileGenerator.cxx +++ b/Source/cmGlobalNMakeMakefileGenerator.cxx @@ -22,14 +22,14 @@ cmGlobalNMakeMakefileGenerator::cmGlobalNMakeMakefileGenerator() } void cmGlobalNMakeMakefileGenerator -::EnableLanguage(std::vector<std::string>const& l, - cmMakefile *mf, +::EnableLanguage(std::vector<std::string>const& l, + cmMakefile *mf, bool optional) { - // pick a default + // pick a default mf->AddDefinition("CMAKE_GENERATOR_CC", "cl"); mf->AddDefinition("CMAKE_GENERATOR_CXX", "cl"); - if(!(cmSystemTools::GetEnv("INCLUDE") && + if(!(cmSystemTools::GetEnv("INCLUDE") && cmSystemTools::GetEnv("LIB")) ) { @@ -40,7 +40,7 @@ void cmGlobalNMakeMakefileGenerator mf->IssueMessage(cmake::WARNING, message); } - + this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional); } diff --git a/Source/cmGlobalNMakeMakefileGenerator.h b/Source/cmGlobalNMakeMakefileGenerator.h index 70a8c190..de33b8f 100644 --- a/Source/cmGlobalNMakeMakefileGenerator.h +++ b/Source/cmGlobalNMakeMakefileGenerator.h @@ -32,13 +32,13 @@ public: /** Get the documentation entry for this generator. */ virtual void GetDocumentation(cmDocumentationEntry& entry) const; - + ///! Create a local generator appropriate to this Global Generator virtual cmLocalGenerator *CreateLocalGenerator(); /** * Try to determine system infomation such as shared library - * extension, pthreads, byte order etc. + * extension, pthreads, byte order etc. */ virtual void EnableLanguage(std::vector<std::string>const& languages, cmMakefile *, bool optional); diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 947a1c9..48ead25 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -94,7 +94,7 @@ void cmGlobalVisualStudio10Generator //---------------------------------------------------------------------------- void cmGlobalVisualStudio10Generator -::EnableLanguage(std::vector<std::string>const & lang, +::EnableLanguage(std::vector<std::string>const & lang, cmMakefile *mf, bool optional) { cmGlobalVisualStudio8Generator::EnableLanguage(lang, mf, optional); @@ -146,12 +146,12 @@ std::string cmGlobalVisualStudio10Generator::GetUserMacrosRegKeyBase() std::string cmGlobalVisualStudio10Generator ::GenerateBuildCommand(const char* makeProgram, - const char *projectName, + const char *projectName, const char* additionalOptions, const char *targetName, const char* config, bool ignoreErrors, bool fast) { // now build the test - std::string makeCommand + std::string makeCommand = cmSystemTools::ConvertToOutputPath(makeProgram); std::string lowerCaseCommand = makeCommand; cmSystemTools::LowerCase(lowerCaseCommand); @@ -177,7 +177,7 @@ std::string cmGlobalVisualStudio10Generator if(!targetName || strlen(targetName) == 0) { targetName = "ALL_BUILD"; - } + } bool clean = false; if ( targetName && strcmp(targetName, "clean") == 0 ) { diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index 060cdff..47ce790 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -20,26 +20,26 @@ * * cmGlobalVisualStudio10Generator manages UNIX build process for a tree */ -class cmGlobalVisualStudio10Generator : +class cmGlobalVisualStudio10Generator : public cmGlobalVisualStudio8Generator { public: cmGlobalVisualStudio10Generator(); - static cmGlobalGenerator* New() { + static cmGlobalGenerator* New() { return new cmGlobalVisualStudio10Generator; } - - virtual std::string + + virtual std::string GenerateBuildCommand(const char* makeProgram, - const char *projectName, + const char *projectName, const char* additionalOptions, const char *targetName, const char* config, bool ignoreErrors, bool); - + ///! Get the name for the generator. virtual const char* GetName() const { return cmGlobalVisualStudio10Generator::GetActualName();} static const char* GetActualName() {return "Visual Studio 10";} virtual void AddPlatformDefinitions(cmMakefile* mf); - + /** Get the documentation entry for this generator. */ virtual void GetDocumentation(cmDocumentationEntry& entry) const; @@ -50,9 +50,9 @@ public: /** * Try to determine system infomation such as shared library - * extension, pthreads, byte order etc. + * extension, pthreads, byte order etc. */ - virtual void EnableLanguage(std::vector<std::string>const& languages, + virtual void EnableLanguage(std::vector<std::string>const& languages, cmMakefile *, bool optional); virtual void WriteSLNHeader(std::ostream& fout); diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx index fe44e20..cc70341 100644 --- a/Source/cmGlobalVisualStudio6Generator.cxx +++ b/Source/cmGlobalVisualStudio6Generator.cxx @@ -36,13 +36,13 @@ cmGlobalVisualStudio6Generator::cmGlobalVisualStudio6Generator() } void cmGlobalVisualStudio6Generator -::EnableLanguage(std::vector<std::string>const& lang, - cmMakefile *mf, +::EnableLanguage(std::vector<std::string>const& lang, + cmMakefile *mf, bool optional) { mf->AddDefinition("CMAKE_GENERATOR_CC", "cl"); mf->AddDefinition("CMAKE_GENERATOR_CXX", "cl"); - mf->AddDefinition("CMAKE_GENERATOR_RC", "rc"); + mf->AddDefinition("CMAKE_GENERATOR_RC", "rc"); mf->AddDefinition("CMAKE_GENERATOR_NO_COMPILER_ENV", "1"); mf->AddDefinition("CMAKE_GENERATOR_Fortran", "ifort"); mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", "X86"); @@ -84,10 +84,10 @@ void cmGlobalVisualStudio6Generator::GenerateConfigurations(cmMakefile* mf) std::string cmGlobalVisualStudio6Generator ::GenerateBuildCommand(const char* makeProgram, - const char *projectName, - const char* additionalOptions, + const char *projectName, + const char* additionalOptions, const char *targetName, - const char* config, + const char* config, bool ignoreErrors, bool) { @@ -100,7 +100,7 @@ std::string cmGlobalVisualStudio6Generator "\\6.0\\Setup;VsCommonDir]/MSDev98/Bin"); cmSystemTools::ExpandRegistryValues(mp[0]); std::string originalCommand = makeProgram; - std::string makeCommand = + std::string makeCommand = cmSystemTools::FindProgram(makeProgram, mp); if(makeCommand.size() == 0) { @@ -116,7 +116,7 @@ std::string cmGlobalVisualStudio6Generator // if there are spaces in the makeCommand, assume a full path // and convert it to a path with no spaces in it as the // RunSingleCommand does not like spaces -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) if(makeCommand.find(' ') != std::string::npos) { cmSystemTools::GetShortPath(makeCommand.c_str(), makeCommand); @@ -226,7 +226,7 @@ void cmGlobalVisualStudio6Generator } void cmGlobalVisualStudio6Generator -::OutputDSWFile(cmLocalGenerator* root, +::OutputDSWFile(cmLocalGenerator* root, std::vector<cmLocalGenerator*>& generators) { if(generators.size() == 0) @@ -250,7 +250,7 @@ void cmGlobalVisualStudio6Generator // output the DSW file void cmGlobalVisualStudio6Generator::OutputDSWFile() -{ +{ std::map<cmStdString, std::vector<cmLocalGenerator*> >::iterator it; for(it = this->ProjectMap.begin(); it!= this->ProjectMap.end(); ++it) { @@ -259,16 +259,16 @@ void cmGlobalVisualStudio6Generator::OutputDSWFile() } // Write a dsp file into the DSW file, -// Note, that dependencies from executables to +// Note, that dependencies from executables to // the libraries it uses are also done here -void cmGlobalVisualStudio6Generator::WriteProject(std::ostream& fout, +void cmGlobalVisualStudio6Generator::WriteProject(std::ostream& fout, const char* dspname, const char* dir, cmTarget& target) { fout << "#########################################################" "######################\n\n"; - fout << "Project: \"" << dspname << "\"=" + fout << "Project: \"" << dspname << "\"=" << dir << "\\" << dspname << ".dsp - Package Owner=<4>\n\n"; fout << "Package=<5>\n{{{\n}}}\n\n"; fout << "Package=<4>\n"; @@ -304,22 +304,22 @@ void cmGlobalVisualStudio6Generator::WriteProject(std::ostream& fout, // Write a dsp file into the DSW file, -// Note, that dependencies from executables to +// Note, that dependencies from executables to // the libraries it uses are also done here -void cmGlobalVisualStudio6Generator::WriteExternalProject(std::ostream& fout, +void cmGlobalVisualStudio6Generator::WriteExternalProject(std::ostream& fout, const char* name, const char* location, const std::set<cmStdString>& dependencies) { fout << "#########################################################" "######################\n\n"; - fout << "Project: \"" << name << "\"=" + fout << "Project: \"" << name << "\"=" << location << " - Package Owner=<4>\n\n"; fout << "Package=<5>\n{{{\n}}}\n\n"; fout << "Package=<4>\n"; fout << "{{{\n"; - + std::set<cmStdString>::const_iterator i, end; // write dependencies. i = dependencies.begin(); @@ -347,7 +347,7 @@ void cmGlobalVisualStudio6Generator::WriteDSWFooter(std::ostream& fout) "##########################\n\n"; } - + // ouput standard header for dsw file void cmGlobalVisualStudio6Generator::WriteDSWHeader(std::ostream& fout) { diff --git a/Source/cmGlobalVisualStudio6Generator.h b/Source/cmGlobalVisualStudio6Generator.h index da08a12..259aa8d 100644 --- a/Source/cmGlobalVisualStudio6Generator.h +++ b/Source/cmGlobalVisualStudio6Generator.h @@ -25,9 +25,9 @@ class cmGlobalVisualStudio6Generator : public cmGlobalVisualStudioGenerator { public: cmGlobalVisualStudio6Generator(); - static cmGlobalGenerator* New() { + static cmGlobalGenerator* New() { return new cmGlobalVisualStudio6Generator; } - + ///! Get the name for the generator. virtual const char* GetName() const { return cmGlobalVisualStudio6Generator::GetActualName();} @@ -35,15 +35,15 @@ public: /** Get the documentation entry for this generator. */ virtual void GetDocumentation(cmDocumentationEntry& entry) const; - + ///! Create a local generator appropriate to this Global Generator virtual cmLocalGenerator *CreateLocalGenerator(); /** * Try to determine system infomation such as shared library - * extension, pthreads, byte order etc. + * extension, pthreads, byte order etc. */ - virtual void EnableLanguage(std::vector<std::string>const& languages, + virtual void EnableLanguage(std::vector<std::string>const& languages, cmMakefile *, bool optional); /** @@ -52,8 +52,8 @@ public: */ virtual std::string GenerateBuildCommand(const char* makeProgram, const char *projectName, - const char* additionalOptions, - const char *targetName, + const char* additionalOptions, + const char *targetName, const char* config, bool ignoreErrors, bool fast); @@ -61,7 +61,7 @@ public: /** * Generate the all required files for building this project/tree. This * basically creates a series of LocalGenerators for each directory and - * requests that they Generate. + * requests that they Generate. */ virtual void Generate(); @@ -90,9 +90,9 @@ private: void GenerateConfigurations(cmMakefile* mf); void WriteDSWFile(std::ostream& fout); void WriteDSWHeader(std::ostream& fout); - void WriteProject(std::ostream& fout, + void WriteProject(std::ostream& fout, const char* name, const char* path, cmTarget &t); - void WriteExternalProject(std::ostream& fout, + void WriteExternalProject(std::ostream& fout, const char* name, const char* path, const std::set<cmStdString>& dependencies); void WriteDSWFooter(std::ostream& fout); diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index d6b653c..1da575e 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -99,7 +99,7 @@ void cmGlobalVisualStudio71Generator ::WriteSLNFile(std::ostream& fout, cmLocalGenerator* root, std::vector<cmLocalGenerator*>& generators) -{ +{ // Write out the header for a SLN file this->WriteSLNHeader(fout); @@ -156,7 +156,7 @@ cmGlobalVisualStudio71Generator //---------------------------------------------------------------------------- // Write a dsp file into the SLN file, -// Note, that dependencies from executables to +// Note, that dependencies from executables to // the libraries it uses are also done here void cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout, @@ -166,11 +166,11 @@ cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout, { // check to see if this is a fortran build const char* ext = ".vcproj"; - const char* project = + const char* project = "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \""; if(this->TargetIsFortranOnly(t)) { - ext = ".vfproj"; + ext = ".vfproj"; project = "Project(\"{6989167D-11E4-40FE-8C1A-2192A86A7E90}\") = \""; } const char* targetExt = t.GetProperty("GENERATOR_FILE_NAME_EXT"); @@ -187,7 +187,7 @@ cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout, fout << "\tProjectSection(ProjectDependencies) = postProject\n"; this->WriteProjectDepends(fout, dspname, dir, t); fout << "\tEndProjectSection\n"; - + fout <<"EndProject\n"; UtilityDependsMap::iterator ui = this->UtilityDepends.find(&t); @@ -208,7 +208,7 @@ cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout, //---------------------------------------------------------------------------- // Write a dsp file into the SLN file, -// Note, that dependencies from executables to +// Note, that dependencies from executables to // the libraries it uses are also done here void cmGlobalVisualStudio71Generator @@ -238,12 +238,12 @@ cmGlobalVisualStudio71Generator // Write a dsp file into the SLN file, Note, that dependencies from // executables to the libraries it uses are also done here void cmGlobalVisualStudio71Generator -::WriteExternalProject(std::ostream& fout, +::WriteExternalProject(std::ostream& fout, const char* name, const char* location, const char* typeGuid, const std::set<cmStdString>& depends) -{ +{ fout << "Project(\"{" << (typeGuid ? typeGuid : "8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942") << "}\") = \"" @@ -251,7 +251,7 @@ void cmGlobalVisualStudio71Generator << this->ConvertToSolutionPath(location) << "\", \"{" << this->GetGUID(name) << "}\"\n"; - + // write out the dependencies here VS 7.1 includes dependencies with the // project instead of in the global section if(!depends.empty()) @@ -262,18 +262,18 @@ void cmGlobalVisualStudio71Generator { if(it->size() > 0) { - fout << "\t\t{" - << this->GetGUID(it->c_str()) - << "} = {" - << this->GetGUID(it->c_str()) + fout << "\t\t{" + << this->GetGUID(it->c_str()) + << "} = {" + << this->GetGUID(it->c_str()) << "}\n"; } } fout << "\tEndProjectSection\n"; - } + } fout << "EndProject\n"; - + } @@ -289,7 +289,7 @@ void cmGlobalVisualStudio71Generator for(std::vector<std::string>::iterator i = this->Configurations.begin(); i != this->Configurations.end(); ++i) { - fout << "\t\t{" << guid << "}." << *i + fout << "\t\t{" << guid << "}." << *i << ".ActiveCfg = " << *i << "|" << (platformMapping ? platformMapping : "Win32") << std::endl; if(partOfDefaultBuild) diff --git a/Source/cmGlobalVisualStudio71Generator.h b/Source/cmGlobalVisualStudio71Generator.h index 503b708..285f202 100644 --- a/Source/cmGlobalVisualStudio71Generator.h +++ b/Source/cmGlobalVisualStudio71Generator.h @@ -24,9 +24,9 @@ class cmGlobalVisualStudio71Generator : public cmGlobalVisualStudio7Generator { public: cmGlobalVisualStudio71Generator(); - static cmGlobalGenerator* New() + static cmGlobalGenerator* New() { return new cmGlobalVisualStudio71Generator; } - + ///! Get the name for the generator. virtual const char* GetName() const { return cmGlobalVisualStudio71Generator::GetActualName();} @@ -34,7 +34,7 @@ public: /** Get the documentation entry for this generator. */ virtual void GetDocumentation(cmDocumentationEntry& entry) const; - + ///! Create a local generator appropriate to this Global Generator virtual cmLocalGenerator *CreateLocalGenerator(); @@ -54,13 +54,13 @@ public: protected: virtual const char* GetIDEVersion() { return "7.1"; } virtual void AddPlatformDefinitions(cmMakefile* mf); - virtual void WriteSLNFile(std::ostream& fout, + virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root, std::vector<cmLocalGenerator*>& generators); virtual void WriteSolutionConfigurations(std::ostream& fout); - virtual void WriteProject(std::ostream& fout, + virtual void WriteProject(std::ostream& fout, const char* name, const char* path, cmTarget &t); - virtual void WriteProjectDepends(std::ostream& fout, + virtual void WriteProjectDepends(std::ostream& fout, const char* name, const char* path, cmTarget &t); virtual void WriteProjectConfigurations(std::ostream& fout, const char* name, diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 6332d0b..d485d6e 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -23,7 +23,7 @@ cmGlobalVisualStudio7Generator::cmGlobalVisualStudio7Generator() void cmGlobalVisualStudio7Generator -::EnableLanguage(std::vector<std::string>const & lang, +::EnableLanguage(std::vector<std::string>const & lang, cmMakefile *mf, bool optional) { mf->AddDefinition("CMAKE_GENERATOR_CC", "cl"); @@ -32,13 +32,13 @@ void cmGlobalVisualStudio7Generator mf->AddDefinition("CMAKE_GENERATOR_NO_COMPILER_ENV", "1"); mf->AddDefinition("CMAKE_GENERATOR_FC", "ifort"); this->AddPlatformDefinitions(mf); - + // Create list of configurations requested by user's cache, if any. this->cmGlobalGenerator::EnableLanguage(lang, mf, optional); this->GenerateConfigurations(mf); - + // if this environment variable is set, then copy it to - // a static cache entry. It will be used by + // a static cache entry. It will be used by // cmLocalGenerator::ConstructScript, to add an extra PATH // to all custom commands. This is because the VS IDE // does not use the environment it is run in, and this allows @@ -48,7 +48,7 @@ void cmGlobalVisualStudio7Generator if(extraPath) { mf->AddCacheDefinition - ("CMAKE_MSVCIDE_RUN_PATH", extraPath, + ("CMAKE_MSVCIDE_RUN_PATH", extraPath, "Saved environment variable CMAKE_MSVCIDE_RUN_PATH", cmCacheManager::STATIC); } @@ -64,7 +64,7 @@ void cmGlobalVisualStudio7Generator::AddPlatformDefinitions(cmMakefile* mf) std::string cmGlobalVisualStudio7Generator ::GenerateBuildCommand(const char* makeProgram, - const char *projectName, + const char *projectName, const char* additionalOptions, const char *targetName, const char* config, bool ignoreErrors, bool) { @@ -72,7 +72,7 @@ std::string cmGlobalVisualStudio7Generator (void) ignoreErrors; // now build the test - std::string makeCommand = + std::string makeCommand = cmSystemTools::ConvertToOutputPath(makeProgram); std::string lowerCaseCommand = makeCommand; cmSystemTools::LowerCase(lowerCaseCommand); @@ -80,7 +80,7 @@ std::string cmGlobalVisualStudio7Generator // if there are spaces in the makeCommand, assume a full path // and convert it to a path with no spaces in it as the // RunSingleCommand does not like spaces -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) if(makeCommand.find(' ') != std::string::npos) { cmSystemTools::GetShortPath(makeCommand.c_str(), makeCommand); @@ -143,7 +143,7 @@ cmLocalGenerator *cmGlobalVisualStudio7Generator::CreateLocalGenerator() void cmGlobalVisualStudio7Generator::GenerateConfigurations(cmMakefile* mf) { // process the configurations - const char* ct + const char* ct = this->CMakeInstance->GetCacheDefinition("CMAKE_CONFIGURATION_TYPES"); if ( ct ) { @@ -152,7 +152,7 @@ void cmGlobalVisualStudio7Generator::GenerateConfigurations(cmMakefile* mf) for(std::vector<std::string>::iterator i = argsOut.begin(); i != argsOut.end(); ++i) { - if(std::find(this->Configurations.begin(), + if(std::find(this->Configurations.begin(), this->Configurations.end(), *i) == this->Configurations.end()) { @@ -166,7 +166,7 @@ void cmGlobalVisualStudio7Generator::GenerateConfigurations(cmMakefile* mf) this->Configurations.push_back("Debug"); this->Configurations.push_back("Release"); } - + // Reset the entry to have a semi-colon separated list. std::string configs = this->Configurations[0]; for(unsigned int i=1; i < this->Configurations.size(); ++i) @@ -237,7 +237,7 @@ void cmGlobalVisualStudio7Generator::OutputSLNFile() void cmGlobalVisualStudio7Generator::WriteTargetConfigurations( - std::ostream& fout, + std::ostream& fout, cmLocalGenerator* root, OrderedTargetDependSet const& projectTargets) { @@ -258,7 +258,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetConfigurations( { bool partOfDefaultBuild = this->IsPartOfDefaultBuild( root->GetMakefile()->GetProjectName(), target); - const char *vcprojName = + const char *vcprojName = target->GetProperty("GENERATOR_FILE_NAME"); if (vcprojName) { @@ -369,13 +369,13 @@ void cmGlobalVisualStudio7Generator::WriteTargetDepends( projectTargets.begin(); tt != projectTargets.end(); ++tt) { cmTarget* target = *tt; - cmMakefile* mf = target->GetMakefile(); - const char *vcprojName = + cmMakefile* mf = target->GetMakefile(); + const char *vcprojName = target->GetProperty("GENERATOR_FILE_NAME"); if (vcprojName) - { + { std::string dir = mf->GetStartDirectory(); - this->WriteProjectDepends(fout, vcprojName, + this->WriteProjectDepends(fout, vcprojName, dir.c_str(), *target); } } @@ -409,7 +409,7 @@ void cmGlobalVisualStudio7Generator // Write out the configurations information for the solution fout << "Global\n" << "\tGlobalSection(SolutionConfiguration) = preSolution\n"; - + int c = 0; for(std::vector<std::string>::iterator i = this->Configurations.begin(); i != this->Configurations.end(); ++i) @@ -418,7 +418,7 @@ void cmGlobalVisualStudio7Generator c++; } fout << "\tEndGlobalSection\n"; - // Write out project(target) depends + // Write out project(target) depends fout << "\tGlobalSection(ProjectDependencies) = postSolution\n"; this->WriteTargetDepends(fout, orderedProjectTargets); fout << "\tEndGlobalSection\n"; @@ -506,12 +506,12 @@ cmGlobalVisualStudio7Generator::ConvertToSolutionPath(const char* path) } // Write a dsp file into the SLN file, -// Note, that dependencies from executables to +// Note, that dependencies from executables to // the libraries it uses are also done here -void cmGlobalVisualStudio7Generator::WriteProject(std::ostream& fout, +void cmGlobalVisualStudio7Generator::WriteProject(std::ostream& fout, const char* dspname, const char* dir, cmTarget& target) -{ +{ // check to see if this is a fortran build const char* ext = ".vcproj"; const char* project = @@ -544,7 +544,7 @@ void cmGlobalVisualStudio7Generator::WriteProject(std::ostream& fout, // Write a dsp file into the SLN file, -// Note, that dependencies from executables to +// Note, that dependencies from executables to // the libraries it uses are also done here void cmGlobalVisualStudio7Generator @@ -607,14 +607,14 @@ void cmGlobalVisualStudio7Generator // Write a dsp file into the SLN file, -// Note, that dependencies from executables to +// Note, that dependencies from executables to // the libraries it uses are also done here -void cmGlobalVisualStudio7Generator::WriteExternalProject(std::ostream& fout, +void cmGlobalVisualStudio7Generator::WriteExternalProject(std::ostream& fout, const char* name, const char* location, const char* typeGuid, const std::set<cmStdString>&) -{ +{ std::string d = cmSystemTools::ConvertToOutputPath(location); fout << "Project(" << "\"{" @@ -639,7 +639,7 @@ void cmGlobalVisualStudio7Generator::WriteSLNFooter(std::ostream& fout) << "EndGlobal\n"; } - + // ouput standard header for dsw file void cmGlobalVisualStudio7Generator::WriteSLNHeader(std::ostream& fout) { @@ -705,7 +705,7 @@ std::string cmGlobalVisualStudio7Generator::GetGUID(const char* name) { std::string guidStoreName = name; guidStoreName += "_GUID_CMAKE"; - const char* storedGUID = + const char* storedGUID = this->CMakeInstance->GetCacheDefinition(guidStoreName.c_str()); if(storedGUID) { @@ -733,8 +733,8 @@ void cmGlobalVisualStudio7Generator::CreateGUID(const char* name) ret = reinterpret_cast<char*>(uidstr); RpcStringFree(&uidstr); ret = cmSystemTools::UpperCase(ret); - this->CMakeInstance->AddCacheEntry(guidStoreName.c_str(), - ret.c_str(), "Stored GUID", + this->CMakeInstance->AddCacheEntry(guidStoreName.c_str(), + ret.c_str(), "Stored GUID", cmCacheManager::INTERNAL); } @@ -775,7 +775,7 @@ bool cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild(const char* project, { return false; } - // if it is a utilitiy target then only make it part of the + // if it is a utilitiy target then only make it part of the // default build if another target depends on it int type = target->GetType(); if (type == cmTarget::GLOBAL_TARGET) @@ -785,7 +785,7 @@ bool cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild(const char* project, if(type == cmTarget::UTILITY) { return this->IsDependedOn(project, target); - } + } // default is to be part of the build return true; } diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index e7c4232..a74a4ee 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -35,7 +35,7 @@ cmLocalGenerator *cmGlobalVisualStudio8Generator::CreateLocalGenerator() lg->SetGlobalGenerator(this); return lg; } - + //---------------------------------------------------------------------------- // ouput standard header for dsw file void cmGlobalVisualStudio8Generator::WriteSLNHeader(std::ostream& fout) @@ -336,7 +336,7 @@ bool cmGlobalVisualStudio8Generator::NeedLinkLibraryDependencies( //---------------------------------------------------------------------------- static cmVS7FlagTable cmVS8ExtraFlagTable[] = -{ +{ {"CallingConvention", "Gd", "cdecl", "0", 0 }, {"CallingConvention", "Gr", "fastcall", "1", 0 }, {"CallingConvention", "Gz", "stdcall", "2", 0 }, diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h index 7dae429..31501bc 100644 --- a/Source/cmGlobalVisualStudio8Generator.h +++ b/Source/cmGlobalVisualStudio8Generator.h @@ -24,9 +24,9 @@ class cmGlobalVisualStudio8Generator : public cmGlobalVisualStudio71Generator { public: cmGlobalVisualStudio8Generator(); - static cmGlobalGenerator* New() { + static cmGlobalGenerator* New() { return new cmGlobalVisualStudio8Generator; } - + ///! Get the name for the generator. virtual const char* GetName() const { return cmGlobalVisualStudio8Generator::GetActualName();} @@ -36,7 +36,7 @@ public: /** Get the documentation entry for this generator. */ virtual void GetDocumentation(cmDocumentationEntry& entry) const; - + ///! Create a local generator appropriate to this Global Generator virtual cmLocalGenerator *CreateLocalGenerator(); diff --git a/Source/cmGlobalVisualStudio8Win64Generator.h b/Source/cmGlobalVisualStudio8Win64Generator.h index 084ba69..136cdb8 100644 --- a/Source/cmGlobalVisualStudio8Win64Generator.h +++ b/Source/cmGlobalVisualStudio8Win64Generator.h @@ -20,14 +20,14 @@ * * cmGlobalVisualStudio8Win64Generator manages UNIX build process for a tree */ -class cmGlobalVisualStudio8Win64Generator : +class cmGlobalVisualStudio8Win64Generator : public cmGlobalVisualStudio8Generator { public: cmGlobalVisualStudio8Win64Generator(); - static cmGlobalGenerator* New() { + static cmGlobalGenerator* New() { return new cmGlobalVisualStudio8Win64Generator; } - + ///! Get the name for the generator. virtual const char* GetName() const { return cmGlobalVisualStudio8Win64Generator::GetActualName();} @@ -43,7 +43,7 @@ public: /** * Try to determine system infomation such as shared library - * extension, pthreads, byte order etc. + * extension, pthreads, byte order etc. */ virtual void AddPlatformDefinitions(cmMakefile *); }; diff --git a/Source/cmGlobalVisualStudio9Generator.cxx b/Source/cmGlobalVisualStudio9Generator.cxx index f082675..fcf00d5 100644 --- a/Source/cmGlobalVisualStudio9Generator.cxx +++ b/Source/cmGlobalVisualStudio9Generator.cxx @@ -59,7 +59,7 @@ void cmGlobalVisualStudio9Generator //---------------------------------------------------------------------------- void cmGlobalVisualStudio9Generator -::EnableLanguage(std::vector<std::string>const & lang, +::EnableLanguage(std::vector<std::string>const & lang, cmMakefile *mf, bool optional) { cmGlobalVisualStudio8Generator::EnableLanguage(lang, mf, optional); diff --git a/Source/cmGlobalVisualStudio9Generator.h b/Source/cmGlobalVisualStudio9Generator.h index bfb03c4c..361b58c 100644 --- a/Source/cmGlobalVisualStudio9Generator.h +++ b/Source/cmGlobalVisualStudio9Generator.h @@ -20,20 +20,20 @@ * * cmGlobalVisualStudio9Generator manages UNIX build process for a tree */ -class cmGlobalVisualStudio9Generator : +class cmGlobalVisualStudio9Generator : public cmGlobalVisualStudio8Generator { public: cmGlobalVisualStudio9Generator(); - static cmGlobalGenerator* New() { + static cmGlobalGenerator* New() { return new cmGlobalVisualStudio9Generator; } - + ///! Get the name for the generator. virtual const char* GetName() const { return cmGlobalVisualStudio9Generator::GetActualName();} static const char* GetActualName() {return "Visual Studio 9 2008";} virtual void AddPlatformDefinitions(cmMakefile* mf); - + /** Get the documentation entry for this generator. */ virtual void GetDocumentation(cmDocumentationEntry& entry) const; @@ -42,9 +42,9 @@ public: /** * Try to determine system infomation such as shared library - * extension, pthreads, byte order etc. + * extension, pthreads, byte order etc. */ - virtual void EnableLanguage(std::vector<std::string>const& languages, + virtual void EnableLanguage(std::vector<std::string>const& languages, cmMakefile *, bool optional); virtual void WriteSLNHeader(std::ostream& fout); diff --git a/Source/cmGlobalVisualStudio9Win64Generator.h b/Source/cmGlobalVisualStudio9Win64Generator.h index f6dcc03..0ce1afe 100644 --- a/Source/cmGlobalVisualStudio9Win64Generator.h +++ b/Source/cmGlobalVisualStudio9Win64Generator.h @@ -20,14 +20,14 @@ * * cmGlobalVisualStudio8Win64Generator manages UNIX build process for a tree */ -class cmGlobalVisualStudio9Win64Generator : +class cmGlobalVisualStudio9Win64Generator : public cmGlobalVisualStudio9Generator { public: cmGlobalVisualStudio9Win64Generator(); - static cmGlobalGenerator* New() { + static cmGlobalGenerator* New() { return new cmGlobalVisualStudio9Win64Generator; } - + ///! Get the name for the generator. virtual const char* GetName() const { return cmGlobalVisualStudio9Win64Generator::GetActualName();} @@ -43,7 +43,7 @@ public: /** * Try to determine system infomation such as shared library - * extension, pthreads, byte order etc. + * extension, pthreads, byte order etc. */ virtual void AddPlatformDefinitions(cmMakefile *); }; diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index 2a918c9..a2b4c65 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -53,7 +53,7 @@ void cmGlobalVisualStudioGenerator::Generate() { // Use no actual command lines so that the target itself is not // considered always out of date. - cmTarget* allBuild = + cmTarget* allBuild = gen[0]->GetMakefile()-> AddUtilityCommand("ALL_BUILD", true, no_working_dir, no_depends, no_commands, false, diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h index b62ba22..27fc8cf 100644 --- a/Source/cmGlobalVisualStudioGenerator.h +++ b/Source/cmGlobalVisualStudioGenerator.h @@ -58,7 +58,7 @@ public: */ virtual void CallVisualStudioMacro(MacroName m, const char* vsSolutionFile = 0); - + // return true if target is fortran only bool TargetIsFortranOnly(cmTarget& t); diff --git a/Source/cmGlobalWatcomWMakeGenerator.cxx b/Source/cmGlobalWatcomWMakeGenerator.cxx index 8c6dff9..45b171f 100644 --- a/Source/cmGlobalWatcomWMakeGenerator.cxx +++ b/Source/cmGlobalWatcomWMakeGenerator.cxx @@ -23,11 +23,11 @@ cmGlobalWatcomWMakeGenerator::cmGlobalWatcomWMakeGenerator() } void cmGlobalWatcomWMakeGenerator -::EnableLanguage(std::vector<std::string>const& l, - cmMakefile *mf, +::EnableLanguage(std::vector<std::string>const& l, + cmMakefile *mf, bool optional) { - // pick a default + // pick a default mf->AddDefinition("WATCOM", "1"); mf->AddDefinition("CMAKE_QUOTE_INCLUDE_PATHS", "1"); mf->AddDefinition("CMAKE_MANGLE_OBJECT_FILE_NAMES", "1"); diff --git a/Source/cmGlobalWatcomWMakeGenerator.h b/Source/cmGlobalWatcomWMakeGenerator.h index b416bb1..ee16eae 100644 --- a/Source/cmGlobalWatcomWMakeGenerator.h +++ b/Source/cmGlobalWatcomWMakeGenerator.h @@ -31,15 +31,15 @@ public: /** Get the documentation entry for this generator. */ virtual void GetDocumentation(cmDocumentationEntry& entry) const; - + ///! Create a local generator appropriate to this Global Generator virtual cmLocalGenerator *CreateLocalGenerator(); /** * Try to determine system infomation such as shared library - * extension, pthreads, byte order etc. + * extension, pthreads, byte order etc. */ - virtual void EnableLanguage(std::vector<std::string>const& languages, + virtual void EnableLanguage(std::vector<std::string>const& languages, cmMakefile *, bool optional); }; diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index 800963b..afa1ca2 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -38,15 +38,15 @@ public: /** Get the documentation entry for this generator. */ virtual void GetDocumentation(cmDocumentationEntry& entry) const; - + ///! Create a local generator appropriate to this Global Generator virtual cmLocalGenerator *CreateLocalGenerator(); /** * Try to determine system infomation such as shared library - * extension, pthreads, byte order etc. + * extension, pthreads, byte order etc. */ - virtual void EnableLanguage(std::vector<std::string>const& languages, + virtual void EnableLanguage(std::vector<std::string>const& languages, cmMakefile *, bool optional); /** * Try running cmake and building a file. This is used for dynalically @@ -54,16 +54,16 @@ public: */ virtual std::string GenerateBuildCommand(const char* makeProgram, const char *projectName, - const char* additionalOptions, + const char* additionalOptions, const char *targetName, - const char* config, + const char* config, bool ignoreErrors, bool fast); /** * Generate the all required files for building this project/tree. This * basically creates a series of LocalGenerators for each directory and - * requests that they Generate. + * requests that they Generate. */ virtual void Generate(); @@ -82,7 +82,7 @@ public: i.e. "Can I build Debug and Release in the same tree?" */ virtual bool IsMultiConfig(); -private: +private: cmXCodeObject* CreateOrGetPBXGroup(cmTarget& cmtarget, cmSourceGroup* sg); cmXCodeObject* CreatePBXGroup(cmXCodeObject *parent, @@ -107,18 +107,18 @@ private: void AddCommandsToBuildPhase(cmXCodeObject* buildphase, cmTarget& target, - std::vector<cmCustomCommand> + std::vector<cmCustomCommand> const & commands, const char* commandFileName); - - void CreateCustomRulesMakefile(const char* makefileBasename, + + void CreateCustomRulesMakefile(const char* makefileBasename, cmTarget& target, std::vector<cmCustomCommand> const & commands, const char* configName, - const std::map<cmStdString, cmStdString>& + const std::map<cmStdString, cmStdString>& multipleOutputPairs ); - + cmXCodeObject* FindXCodeTarget(cmTarget*); std::string GetOrCreateId(const char* name, const char* id); @@ -135,9 +135,9 @@ private: const char* GetTargetFileType(cmTarget& cmtarget); const char* GetTargetProductType(cmTarget& cmtarget); std::string AddConfigurations(cmXCodeObject* target, cmTarget& cmtarget); - void AppendOrAddBuildSetting(cmXCodeObject* settings, const char* attr, + void AppendOrAddBuildSetting(cmXCodeObject* settings, const char* attr, const char* value); - void AppendBuildSettingAttribute(cmXCodeObject* target, const char* attr, + void AppendBuildSettingAttribute(cmXCodeObject* target, const char* attr, const char* value, const char* configName); cmXCodeObject* CreateUtilityTarget(cmTarget& target); void AddDependAndLinkInformation(cmXCodeObject* target); @@ -161,10 +161,10 @@ private: const std::string &lang); cmXCodeObject* CreateXCodeFileReference(cmSourceFile* sf, cmTarget& cmtarget); - cmXCodeObject* CreateXCodeSourceFile(cmLocalGenerator* gen, + cmXCodeObject* CreateXCodeSourceFile(cmLocalGenerator* gen, cmSourceFile* sf, cmTarget& cmtarget); - void CreateXCodeTargets(cmLocalGenerator* gen, + void CreateXCodeTargets(cmLocalGenerator* gen, std::vector<cmXCodeObject*>&); bool IsHeaderFile(cmSourceFile*); void AddDependTarget(cmXCodeObject* target, @@ -172,9 +172,9 @@ private: void CreateXCodeDependHackTarget(std::vector<cmXCodeObject*>& targets); bool SpecialTargetEmitted(std::string const& tname); void SetGenerationRoot(cmLocalGenerator* root); - void AddExtraTargets(cmLocalGenerator* root, + void AddExtraTargets(cmLocalGenerator* root, std::vector<cmLocalGenerator*>& gens); - cmXCodeObject* CreateBuildPhase(const char* name, + cmXCodeObject* CreateBuildPhase(const char* name, const char* name2, cmTarget& cmtarget, const std::vector<cmCustomCommand>&); diff --git a/Source/cmHexFileConverter.cxx b/Source/cmHexFileConverter.cxx index 2ff7945..a540825 100644 --- a/Source/cmHexFileConverter.cxx +++ b/Source/cmHexFileConverter.cxx @@ -22,8 +22,8 @@ // might go to SystemTools ? static bool cm_IsHexChar(char c) { - return (((c >= '0') && (c <= '9')) - || ((c >= 'a') && (c <= 'f')) + return (((c >= '0') && (c <= '9')) + || ((c >= 'a') && (c <= 'f')) || ((c >= 'A') && (c <= 'F'))); } @@ -45,7 +45,7 @@ static unsigned int ChompStrlen(const char* line) return length; } -static bool OutputBin(FILE* file, const char * buf, +static bool OutputBin(FILE* file, const char * buf, unsigned int startIndex, unsigned int stopIndex) { bool success = true; @@ -77,7 +77,7 @@ static bool OutputBin(FILE* file, const char * buf, static bool ConvertMotorolaSrecLine(const char* buf, FILE* outFile) { unsigned int slen = ChompStrlen(buf); - if ((slen < MOTOROLA_SREC_MIN_LINE_LENGTH) + if ((slen < MOTOROLA_SREC_MIN_LINE_LENGTH) || (slen > MOTOROLA_SREC_MAX_LINE_LENGTH)) { return false; @@ -125,7 +125,7 @@ static bool ConvertMotorolaSrecLine(const char* buf, FILE* outFile) static bool ConvertIntelHexLine(const char* buf, FILE* outFile) { unsigned int slen = ChompStrlen(buf); - if ((slen < INTEL_HEX_MIN_LINE_LENGTH) + if ((slen < INTEL_HEX_MIN_LINE_LENGTH) || (slen > INTEL_HEX_MAX_LINE_LENGTH)) { return false; @@ -148,7 +148,7 @@ static bool ConvertIntelHexLine(const char* buf, FILE* outFile) dataStart = 9; } // ignore extra address records - else if ((buf[8] == '2') || (buf[8] == '3') || (buf[8] == '4') + else if ((buf[8] == '2') || (buf[8] == '3') || (buf[8] == '4') || (buf[8] == '5')) { return true; diff --git a/Source/cmHexFileConverter.h b/Source/cmHexFileConverter.h index 94c757f..e11d74a 100644 --- a/Source/cmHexFileConverter.h +++ b/Source/cmHexFileConverter.h @@ -13,7 +13,7 @@ #define cmHexFileConverter_h /** \class cmHexFileConverter - * \brief Can detects Intel Hex and Motorola S-record files and convert them + * \brief Can detects Intel Hex and Motorola S-record files and convert them * to binary files. * */ diff --git a/Source/cmIfCommand.h b/Source/cmIfCommand.h index 94e4d99..4893a17 100644 --- a/Source/cmIfCommand.h +++ b/Source/cmIfCommand.h @@ -26,7 +26,7 @@ public: cmExecutionStatus &); virtual bool ShouldRemove(const cmListFileFunction& lff, cmMakefile &mf); - + std::vector<cmListFileArgument> Args; std::vector<cmListFileFunction> Functions; bool IsBlocking; @@ -41,7 +41,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmIfCommand; } @@ -52,7 +52,7 @@ public: */ virtual bool InvokeInitialPass(const std::vector<cmListFileArgument>& args, cmExecutionStatus &); - + /** * This is called when the command is first encountered in * the CMakeLists.txt file. @@ -72,7 +72,7 @@ public: { return "Conditionally execute a group of commands."; } - + /** * This determines if the command is invoked when in script mode. */ @@ -238,22 +238,22 @@ public: "7) The left and right hand arguments to AND OR are " "independently tested to see if they are boolean constants, if " "so they are used as such, otherwise they are assumed to be " - "variables and are dereferenced. \n" + "variables and are dereferenced. \n" ; } // this is a shared function for both If and Else to determine if the // arguments were valid, and if so, was the response true. If there is // an error, the errorString will be set. - static bool IsTrue(const std::vector<std::string> &args, - std::string &errorString, cmMakefile *mf, + static bool IsTrue(const std::vector<std::string> &args, + std::string &errorString, cmMakefile *mf, cmake::MessageType &status); - + // Get a definition from the makefile. If it doesn't exist, // return the original string. static const char* GetVariableOrString(const char* str, const cmMakefile* mf); - + cmTypeMacro(cmIfCommand, cmCommand); }; diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx index 9e6f4b6..4dd98a1 100644 --- a/Source/cmIncludeDirectoryCommand.cxx +++ b/Source/cmIncludeDirectoryCommand.cxx @@ -67,8 +67,8 @@ bool cmIncludeDirectoryCommand // output from a program and passing it into a command the cleanup doesn't // always happen // -void cmIncludeDirectoryCommand::AddDirectory(const char *i, - bool before, +void cmIncludeDirectoryCommand::AddDirectory(const char *i, + bool before, bool system) { // break apart any line feed arguments @@ -91,7 +91,7 @@ void cmIncludeDirectoryCommand::AddDirectory(const char *i, // remove any leading or trailing spaces and \r std::string::size_type b = ret.find_first_not_of(" \r"); std::string::size_type e = ret.find_last_not_of(" \r"); - if ((b!=ret.npos) && (e!=ret.npos)) + if ((b!=ret.npos) && (e!=ret.npos)) { ret.assign(ret, b, 1+e-b); // copy the remaining substring } diff --git a/Source/cmIncludeDirectoryCommand.h b/Source/cmIncludeDirectoryCommand.h index dcc116a..6751fc0 100644 --- a/Source/cmIncludeDirectoryCommand.h +++ b/Source/cmIncludeDirectoryCommand.h @@ -26,7 +26,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmIncludeDirectoryCommand; } @@ -50,7 +50,7 @@ public: { return "Add include directories to the build."; } - + /** * More documentation. */ @@ -76,7 +76,7 @@ public: "directories are meant as system include directories on some " "platforms."; } - + cmTypeMacro(cmIncludeDirectoryCommand, cmCommand); protected: diff --git a/Source/cmIncludeExternalMSProjectCommand.cxx b/Source/cmIncludeExternalMSProjectCommand.cxx index d219c16..d40d8fe 100644 --- a/Source/cmIncludeExternalMSProjectCommand.cxx +++ b/Source/cmIncludeExternalMSProjectCommand.cxx @@ -15,7 +15,7 @@ bool cmIncludeExternalMSProjectCommand ::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &) { - if(args.size() < 2) + if(args.size() < 2) { this->SetError("INCLUDE_EXTERNAL_MSPROJECT called with incorrect " "number of arguments"); @@ -77,7 +77,7 @@ bool cmIncludeExternalMSProjectCommand } // Create a target instance for this utility. - cmTarget* target=this->Makefile->AddNewTarget(cmTarget::UTILITY, + cmTarget* target=this->Makefile->AddNewTarget(cmTarget::UTILITY, utility_name.c_str()); target->SetProperty("GENERATOR_FILE_NAME", utility_name.c_str()); diff --git a/Source/cmIncludeExternalMSProjectCommand.h b/Source/cmIncludeExternalMSProjectCommand.h index 2b2ed0d..d5cec01 100644 --- a/Source/cmIncludeExternalMSProjectCommand.h +++ b/Source/cmIncludeExternalMSProjectCommand.h @@ -27,7 +27,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmIncludeExternalMSProjectCommand; } @@ -38,7 +38,7 @@ public: */ virtual bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus &status); - + /** * The name of the command as specified in CMakeList.txt. */ @@ -51,7 +51,7 @@ public: { return "Include an external Microsoft project file in a workspace."; } - + /** * More documentation. */ @@ -75,7 +75,7 @@ public: "(e.g. WIX projects). " "These options are not supported by the Visual Studio 6 generator."; } - + cmTypeMacro(cmIncludeExternalMSProjectCommand, cmCommand); }; diff --git a/Source/cmIncludeRegularExpressionCommand.cxx b/Source/cmIncludeRegularExpressionCommand.cxx index b0d8325..ef6e8c6 100644 --- a/Source/cmIncludeRegularExpressionCommand.cxx +++ b/Source/cmIncludeRegularExpressionCommand.cxx @@ -21,12 +21,12 @@ bool cmIncludeRegularExpressionCommand return false; } this->Makefile->SetIncludeRegularExpression(args[0].c_str()); - + if(args.size() > 1) { this->Makefile->SetComplainRegularExpression(args[1].c_str()); } - + return true; } diff --git a/Source/cmIncludeRegularExpressionCommand.h b/Source/cmIncludeRegularExpressionCommand.h index 7c633c0..2e41775 100644 --- a/Source/cmIncludeRegularExpressionCommand.h +++ b/Source/cmIncludeRegularExpressionCommand.h @@ -26,7 +26,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmIncludeRegularExpressionCommand; } @@ -37,7 +37,7 @@ public: */ virtual bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus &status); - + /** * The name of the command as specified in CMakeList.txt. */ @@ -50,7 +50,7 @@ public: { return "Set the regular expression used for dependency checking."; } - + /** * More documentation. */ @@ -66,7 +66,7 @@ public: " regex_match = \"^.*$\" (match everything)\n" " regex_complain = \"^$\" (match empty string only)"; } - + cmTypeMacro(cmIncludeRegularExpressionCommand, cmCommand); }; diff --git a/Source/cmInstallFilesCommand.h b/Source/cmInstallFilesCommand.h index d3c7ed6..bb0a6cc 100644 --- a/Source/cmInstallFilesCommand.h +++ b/Source/cmInstallFilesCommand.h @@ -18,7 +18,7 @@ * \brief Specifies where to install some files * * cmInstallFilesCommand specifies the relative path where a list of - * files should be installed. + * files should be installed. */ class cmInstallFilesCommand : public cmCommand { @@ -26,7 +26,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmInstallFilesCommand; } @@ -50,7 +50,7 @@ public: { return "Deprecated. Use the install(FILES ) command instead."; } - + /** * This is called at the end after all the information * specified by the command is accumulated. Most commands do @@ -90,7 +90,7 @@ public: "The directory <dir> is relative to the installation prefix, which " "is stored in the variable CMAKE_INSTALL_PREFIX."; } - + /** This command is kept for compatibility with older CMake versions. */ virtual bool IsDiscouraged() const { @@ -102,7 +102,7 @@ public: protected: void CreateInstallGenerator() const; std::string FindInstallSource(const char* name) const; - + private: std::vector<std::string> FinalArgs; bool IsFilesForm; diff --git a/Source/cmInstallProgramsCommand.h b/Source/cmInstallProgramsCommand.h index 29c84a0..27a0498 100644 --- a/Source/cmInstallProgramsCommand.h +++ b/Source/cmInstallProgramsCommand.h @@ -18,7 +18,7 @@ * \brief Specifies where to install some programs * * cmInstallProgramsCommand specifies the relative path where a list of - * programs should be installed. + * programs should be installed. */ class cmInstallProgramsCommand : public cmCommand { @@ -26,7 +26,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmInstallProgramsCommand; } @@ -50,7 +50,7 @@ public: { return "Deprecated. Use the install(PROGRAMS ) command instead."; } - + /** * This is called at the end after all the information * specified by the command is accumulated. Most commands do @@ -87,7 +87,7 @@ public: "The directory <dir> is relative to the installation prefix, which " "is stored in the variable CMAKE_INSTALL_PREFIX."; } - + /** This command is kept for compatibility with older CMake versions. */ virtual bool IsDiscouraged() const { diff --git a/Source/cmInstallTargetGenerator.h b/Source/cmInstallTargetGenerator.h index b48d456..5d158b8 100644 --- a/Source/cmInstallTargetGenerator.h +++ b/Source/cmInstallTargetGenerator.h @@ -24,7 +24,7 @@ public: cmInstallTargetGenerator( cmTarget& t, const char* dest, bool implib, const char* file_permissions = "", - std::vector<std::string> const& configurations + std::vector<std::string> const& configurations = std::vector<std::string>(), const char* component = "Unspecified", bool optional = false @@ -86,7 +86,7 @@ protected: void AddRPathCheckRule(std::ostream& os, Indent const& indent, const char* config, std::string const& toDestDirPath); - + void AddStripRule(std::ostream& os, Indent const& indent, const std::string& toDestDirPath); void AddRanlibRule(std::ostream& os, Indent const& indent, diff --git a/Source/cmInstallTargetsCommand.h b/Source/cmInstallTargetsCommand.h index e05462f..c47b387 100644 --- a/Source/cmInstallTargetsCommand.h +++ b/Source/cmInstallTargetsCommand.h @@ -19,7 +19,7 @@ * * cmInstallTargetsCommand specifies the relative path where a list of * targets should be installed. The targets can be executables or - * libraries. + * libraries. */ class cmInstallTargetsCommand : public cmCommand { @@ -27,7 +27,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmInstallTargetsCommand; } @@ -51,7 +51,7 @@ public: { return "Deprecated. Use the install(TARGETS ) command instead."; } - + /** * More documentation. */ @@ -67,7 +67,7 @@ public: "is specified, then on systems with special runtime files " "(Windows DLL), the files will be copied to that directory."; } - + /** This command is kept for compatibility with older CMake versions. */ virtual bool IsDiscouraged() const { diff --git a/Source/cmLinkDirectoriesCommand.h b/Source/cmLinkDirectoriesCommand.h index a7cd583..889118c 100644 --- a/Source/cmLinkDirectoriesCommand.h +++ b/Source/cmLinkDirectoriesCommand.h @@ -18,8 +18,8 @@ * \brief Define a list of directories containing files to link. * * cmLinkDirectoriesCommand is used to specify a list - * of directories containing files to link into executable(s). - * Note that the command supports the use of CMake built-in variables + * of directories containing files to link into executable(s). + * Note that the command supports the use of CMake built-in variables * such as CMAKE_BINARY_DIR and CMAKE_SOURCE_DIR. */ class cmLinkDirectoriesCommand : public cmCommand @@ -28,7 +28,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmLinkDirectoriesCommand; } @@ -52,7 +52,7 @@ public: { return "Specify directories in which the linker will look for libraries."; } - + /** * More documentation. */ @@ -73,7 +73,7 @@ public: "them." ; } - + cmTypeMacro(cmLinkDirectoriesCommand, cmCommand); private: void AddLinkDir(std::string const& dir); diff --git a/Source/cmLinkLibrariesCommand.cxx b/Source/cmLinkLibrariesCommand.cxx index c4458aa..2f1db2a 100644 --- a/Source/cmLinkLibrariesCommand.cxx +++ b/Source/cmLinkLibrariesCommand.cxx @@ -19,7 +19,7 @@ bool cmLinkLibrariesCommand { return true; } - // add libraries, nothe that there is an optional prefix + // add libraries, nothe that there is an optional prefix // of debug and optimized than can be used for(std::vector<std::string>::const_iterator i = args.begin(); i != args.end(); ++i) @@ -50,10 +50,10 @@ bool cmLinkLibrariesCommand } else { - this->Makefile->AddLinkLibrary(i->c_str()); + this->Makefile->AddLinkLibrary(i->c_str()); } } - + return true; } diff --git a/Source/cmLinkLibrariesCommand.h b/Source/cmLinkLibrariesCommand.h index 2c0212c..c450a1c 100644 --- a/Source/cmLinkLibrariesCommand.h +++ b/Source/cmLinkLibrariesCommand.h @@ -19,7 +19,7 @@ * * cmLinkLibrariesCommand is used to specify a list of libraries to link * into executable(s) or shared objects. The names of the libraries - * should be those defined by the LIBRARY(library) command(s). + * should be those defined by the LIBRARY(library) command(s). */ class cmLinkLibrariesCommand : public cmCommand { @@ -27,7 +27,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmLinkLibrariesCommand; } @@ -51,7 +51,7 @@ public: { return "Deprecated. Use the target_link_libraries() command instead."; } - + /** * More documentation. */ @@ -68,7 +68,7 @@ public: "the next library listed is to be used only for that specific " "type of build."; } - + /** This command is kept for compatibility with older CMake versions. */ virtual bool IsDiscouraged() const { diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index 908f3b0..9d4f175 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -98,7 +98,7 @@ bool cmListCommand::GetList(std::vector<std::string>& list, const char* var) { return false; } - // if the size of the list + // if the size of the list if(listString.size() == 0) { return true; @@ -107,7 +107,7 @@ bool cmListCommand::GetList(std::vector<std::string>& list, const char* var) cmSystemTools::ExpandListArgument(listString, list, true); // check the list for empty values bool hasEmpty = false; - for(std::vector<std::string>::iterator i = list.begin(); + for(std::vector<std::string>::iterator i = list.begin(); i != list.end(); ++i) { if(i->size() == 0) @@ -116,7 +116,7 @@ bool cmListCommand::GetList(std::vector<std::string>& list, const char* var) break; } } - // if no empty elements then just return + // if no empty elements then just return if(!hasEmpty) { return true; @@ -124,7 +124,7 @@ bool cmListCommand::GetList(std::vector<std::string>& list, const char* var) // if we have empty elements we need to check policy CMP0007 switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0007)) { - case cmPolicies::WARN: + case cmPolicies::WARN: { // Default is to warn and use old behavior // OLD behavior is to allow compatibility, so recall diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx index 84cb8fd..36d84f3 100644 --- a/Source/cmListFileCache.cxx +++ b/Source/cmListFileCache.cxx @@ -26,7 +26,7 @@ bool cmListFileCacheParseFunction(cmListFileLexer* lexer, cmListFileFunction& function, const char* filename); -bool cmListFile::ParseFile(const char* filename, +bool cmListFile::ParseFile(const char* filename, bool topLevel, cmMakefile *mf) { @@ -47,7 +47,7 @@ bool cmListFile::ParseFile(const char* filename, if(!cmListFileLexer_SetFileName(lexer, filename)) { cmListFileLexer_Delete(lexer); - cmSystemTools::Error("cmListFileCache: error can not open file ", + cmSystemTools::Error("cmListFileCache: error can not open file ", filename); return false; } @@ -119,7 +119,7 @@ bool cmListFile::ParseFile(const char* filename, { bool hasVersion = false; // search for the right policy command - for(std::vector<cmListFileFunction>::iterator i + for(std::vector<cmListFileFunction>::iterator i = this->Functions.begin(); i != this->Functions.end(); ++i) { @@ -129,7 +129,7 @@ bool cmListFile::ParseFile(const char* filename, break; } } - // if no policy command is found this is an error if they use any + // if no policy command is found this is an error if they use any // non advanced functions or a lot of functions if(!hasVersion) { @@ -152,7 +152,7 @@ bool cmListFile::ParseFile(const char* filename, allowedCommands.insert("option"); allowedCommands.insert("message"); isProblem = false; - for(std::vector<cmListFileFunction>::iterator i + for(std::vector<cmListFileFunction>::iterator i = this->Functions.begin(); i != this->Functions.end(); ++i) { @@ -161,10 +161,10 @@ bool cmListFile::ParseFile(const char* filename, { isProblem = true; break; - } + } } } - + if (isProblem) { // Tell the top level cmMakefile to diagnose @@ -181,7 +181,7 @@ bool cmListFile::ParseFile(const char* filename, { bool hasProject = false; // search for a project command - for(std::vector<cmListFileFunction>::iterator i + for(std::vector<cmListFileFunction>::iterator i = this->Functions.begin(); i != this->Functions.end(); ++i) { @@ -256,7 +256,7 @@ bool cmListFileCacheParseFunction(cmListFileLexer* lexer, parenDepth--; cmListFileArgument a(")", false, filename, token->line); - function.Arguments.push_back(a); + function.Arguments.push_back(a); } else if(token->type == cmListFileLexer_Token_Identifier || token->type == cmListFileLexer_Token_ArgumentUnquoted) @@ -276,7 +276,7 @@ bool cmListFileCacheParseFunction(cmListFileLexer* lexer, // Error. cmOStringStream error; error << "Error in cmake code at\n" - << filename << ":" << cmListFileLexer_GetCurrentLine(lexer) + << filename << ":" << cmListFileLexer_GetCurrentLine(lexer) << ":\n" << "Parse error. Function missing ending \")\". " << "Instead found " diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h index ec5886d..c057754 100644 --- a/Source/cmListFileCache.h +++ b/Source/cmListFileCache.h @@ -22,7 +22,7 @@ */ class cmMakefile; - + struct cmListFileArgument { cmListFileArgument(): Value(), Quoted(false), FilePath(0), Line(0) {} @@ -64,11 +64,11 @@ class cmListFileBacktrace: public std::vector<cmListFileContext> {}; struct cmListFile { - cmListFile() - :ModifiedTime(0) + cmListFile() + :ModifiedTime(0) { } - bool ParseFile(const char* path, + bool ParseFile(const char* path, bool topLevel, cmMakefile *mf); diff --git a/Source/cmListFileLexer.c b/Source/cmListFileLexer.c index df5dc2b..b6424d6 100644 --- a/Source/cmListFileLexer.c +++ b/Source/cmListFileLexer.c @@ -43,7 +43,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; #endif /* ! C99 */ @@ -165,7 +165,7 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires * access to the local variable yy_act. Since yyless() is a macro, it would break - * existing scanners that call yyless() from OUTSIDE cmListFileLexer_yylex. + * existing scanners that call yyless() from OUTSIDE cmListFileLexer_yylex. * One obvious solution it to make yy_act a global. I tried that, and saw * a 5% performance hit in a non-yylineno scanner, because yy_act is * normally declared as a register variable-- so it is not worth it. @@ -177,7 +177,7 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; if ( yytext[yyl] == '\n' )\ --yylineno;\ }while(0) - + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ @@ -242,7 +242,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -834,7 +834,7 @@ yy_find_action: int yyl; for ( yyl = 0; yyl < yyleng; ++yyl ) if ( yytext[yyl] == '\n' ) - + do{ yylineno++; yycolumn=0; }while(0) @@ -1380,7 +1380,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) yyg->yy_hold_char = *++yyg->yy_c_buf_p; if ( c == '\n' ) - + do{ yylineno++; yycolumn=0; }while(0) @@ -1463,7 +1463,7 @@ static void cmListFileLexer_yy_load_buffer_state (yyscan_t yyscanner) YY_BUFFER_STATE cmListFileLexer_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) { YY_BUFFER_STATE b; - + b = (YY_BUFFER_STATE) cmListFileLexer_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in cmListFileLexer_yy_create_buffer()" ); @@ -1529,7 +1529,7 @@ static void cmListFileLexer_yy_load_buffer_state (yyscan_t yyscanner) } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; - + errno = oerrno; } @@ -1633,9 +1633,9 @@ static void cmListFileLexer_yyensure_buffer_stack (yyscan_t yyscanner) yyg->yy_buffer_stack = (struct yy_buffer_state**)cmListFileLexer_yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) , yyscanner); - + memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - + yyg->yy_buffer_stack_max = num_to_alloc; yyg->yy_buffer_stack_top = 0; return; @@ -1662,12 +1662,12 @@ static void cmListFileLexer_yyensure_buffer_stack (yyscan_t yyscanner) * @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. + * @return the newly allocated buffer state object. */ YY_BUFFER_STATE cmListFileLexer_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) { YY_BUFFER_STATE b; - + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) @@ -1703,7 +1703,7 @@ YY_BUFFER_STATE cmListFileLexer_yy_scan_buffer (char * base, yy_size_t size , */ YY_BUFFER_STATE cmListFileLexer_yy_scan_string (yyconst char * yy_str , yyscan_t yyscanner) { - + return cmListFileLexer_yy_scan_bytes(yy_str,strlen(yy_str) ,yyscanner); } @@ -1720,7 +1720,7 @@ YY_BUFFER_STATE cmListFileLexer_yy_scan_bytes (yyconst char * bytes, int len , char *buf; yy_size_t n; int i; - + /* Get memory for full buffer, including space for trailing EOB's. */ n = len + 2; buf = (char *) cmListFileLexer_yyalloc(n ,yyscanner ); @@ -1789,10 +1789,10 @@ YY_EXTRA_TYPE cmListFileLexer_yyget_extra (yyscan_t yyscanner) int cmListFileLexer_yyget_lineno (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - + if (! YY_CURRENT_BUFFER) return 0; - + return yylineno; } @@ -1802,10 +1802,10 @@ int cmListFileLexer_yyget_lineno (yyscan_t yyscanner) int cmListFileLexer_yyget_column (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - + if (! YY_CURRENT_BUFFER) return 0; - + return yycolumn; } @@ -1866,8 +1866,8 @@ void cmListFileLexer_yyset_lineno (int line_number , yyscan_t yyscanner) /* lineno is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "cmListFileLexer_yyset_lineno called with no buffer" , yyscanner); - + yy_fatal_error( "cmListFileLexer_yyset_lineno called with no buffer" , yyscanner); + yylineno = line_number; } @@ -1881,8 +1881,8 @@ void cmListFileLexer_yyset_column (int column_no , yyscan_t yyscanner) /* column is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "cmListFileLexer_yyset_column called with no buffer" , yyscanner); - + yy_fatal_error( "cmListFileLexer_yyset_column called with no buffer" , yyscanner); + yycolumn = column_no; } diff --git a/Source/cmLoadCacheCommand.cxx b/Source/cmLoadCacheCommand.cxx index a239e55..462e086 100644 --- a/Source/cmLoadCacheCommand.cxx +++ b/Source/cmLoadCacheCommand.cxx @@ -26,7 +26,7 @@ bool cmLoadCacheCommand { return this->ReadWithPrefix(args); } - + // Cache entries to be excluded from the import list. // If this set is empty, all cache entries are brought in // and they can not be overridden. @@ -97,7 +97,7 @@ bool cmLoadCacheCommand::ReadWithPrefix(std::vector<std::string> const& args) this->SetError("READ_WITH_PREFIX form must specify a prefix."); return false; } - + // Make sure the cache file exists. std::string cacheFile = args[0]+"/CMakeCache.txt"; if(!cmSystemTools::FileExists(cacheFile.c_str())) @@ -106,22 +106,22 @@ bool cmLoadCacheCommand::ReadWithPrefix(std::vector<std::string> const& args) this->SetError(e.c_str()); return false; } - + // Prepare the table of variables to read. this->Prefix = args[2]; for(unsigned int i=3; i < args.size(); ++i) { this->VariablesToRead.insert(args[i]); } - + // Read the cache file. - std::ifstream fin(cacheFile.c_str()); - + std::ifstream fin(cacheFile.c_str()); + // This is a big hack read loop to overcome a buggy ifstream // implementation on HP-UX. This should work on all platforms even // for small buffer sizes. const int bufferSize = 4096; - char buffer[bufferSize]; + char buffer[bufferSize]; std::string line; while(fin) { @@ -152,7 +152,7 @@ bool cmLoadCacheCommand::ReadWithPrefix(std::vector<std::string> const& args) // Completed a line. this->CheckLine(line.c_str()); line = ""; - + // Skip the newline character. ++i; } @@ -164,7 +164,7 @@ bool cmLoadCacheCommand::ReadWithPrefix(std::vector<std::string> const& args) // Partial last line. this->CheckLine(line.c_str()); } - + return true; } diff --git a/Source/cmLoadCacheCommand.h b/Source/cmLoadCacheCommand.h index ac50f8d..f55cbb3 100644 --- a/Source/cmLoadCacheCommand.h +++ b/Source/cmLoadCacheCommand.h @@ -25,7 +25,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmLoadCacheCommand; } @@ -49,7 +49,7 @@ public: { return "Load in the values from another project's CMake cache."; } - + /** * More documentation. */ @@ -74,13 +74,13 @@ public: "of this form of the command is strongly discouraged, but it is " "provided for backward compatibility."; } - + cmTypeMacro(cmLoadCacheCommand, cmCommand); protected: - + std::set<cmStdString> VariablesToRead; std::string Prefix; - + bool ReadWithPrefix(std::vector<std::string> const& args); void CheckLine(const char* line); }; diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx index 3a0115c..b2acf06 100644 --- a/Source/cmLoadCommandCommand.cxx +++ b/Source/cmLoadCommandCommand.cxx @@ -25,23 +25,23 @@ #include <signal.h> extern "C" void TrapsForSignalsCFunction(int sig); - + // a class for loadabple commands class cmLoadedCommand : public cmCommand { public: cmLoadedCommand() { - memset(&this->info,0,sizeof(this->info)); + memset(&this->info,0,sizeof(this->info)); this->info.CAPI = &cmStaticCAPI; } - + ///! clean up any memory allocated by the plugin ~cmLoadedCommand(); - + /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { cmLoadedCommand *newC = new cmLoadedCommand; // we must copy when we clone @@ -53,7 +53,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector<std::string> const& args, + virtual bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus &); /** @@ -70,7 +70,7 @@ public: * The name of the command as specified in CMakeList.txt. */ virtual const char* GetName() const { return info.Name; } - + /** * Succinct documentation. */ @@ -79,7 +79,7 @@ public: if (this->info.GetTerseDocumentation) { cmLoadedCommand::InstallSignalHandlers(info.Name); - const char* ret = info.GetTerseDocumentation(); + const char* ret = info.GetTerseDocumentation(); cmLoadedCommand::InstallSignalHandlers(info.Name, 1); return ret; } @@ -101,7 +101,7 @@ public: { cmLoadedCommand::LastName = "????"; } - + if(!remove) { signal(SIGSEGV, TrapsForSignalsCFunction); @@ -119,7 +119,7 @@ public: signal(SIGILL, 0); } } - + /** * More documentation. */ @@ -137,7 +137,7 @@ public: return "LoadedCommand without any additional documentation"; } } - + cmTypeMacro(cmLoadedCommand, cmCommand); cmLoadedCommandInfo info; @@ -164,7 +164,7 @@ bool cmLoadedCommand::InitialPass(std::vector<std::string> const& args, { free(this->info.Error); } - + // create argc and argv and then invoke the command int argc = static_cast<int> (args.size()); char **argv = 0; @@ -179,10 +179,10 @@ bool cmLoadedCommand::InitialPass(std::vector<std::string> const& args, } cmLoadedCommand::InstallSignalHandlers(info.Name); int result = info.InitialPass((void *)&info, - (void *)this->Makefile,argc,argv); + (void *)this->Makefile,argc,argv); cmLoadedCommand::InstallSignalHandlers(info.Name, 1); cmFreeArguments(argc,argv); - + if (result) { return true; @@ -249,7 +249,7 @@ bool cmLoadCommandCommand // expand variables std::string exp = args[j]; cmSystemTools::ExpandRegistryValues(exp); - + // Glob the entry in case of wildcards. cmSystemTools::GlobDirs(exp.c_str(), path); } @@ -298,7 +298,7 @@ bool cmLoadCommandCommand initFunction = (CM_INIT_FUNCTION)( cmsys::DynamicLoader::GetSymbolAddress(lib, initFuncName.c_str())); } - // if the symbol is found call it to set the name on the + // if the symbol is found call it to set the name on the // function blocker if(initFunction) { diff --git a/Source/cmLoadCommandCommand.h b/Source/cmLoadCommandCommand.h index 6517019..f0b34ee 100644 --- a/Source/cmLoadCommandCommand.h +++ b/Source/cmLoadCommandCommand.h @@ -25,7 +25,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmLoadCommandCommand; } @@ -41,7 +41,7 @@ public: * The name of the command as specified in CMakeList.txt. */ virtual const char* GetName() const {return "load_command";} - + /** * Succinct documentation. */ @@ -49,7 +49,7 @@ public: { return "Load a command into a running CMake."; } - + /** * More documentation. */ @@ -66,7 +66,7 @@ public: "will be set to the full path of the module that was loaded. " "Otherwise the variable will not be set."; } - + cmTypeMacro(cmLoadCommandCommand, cmCommand); }; diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx index ace7adf..c3789a0 100644 --- a/Source/cmLocalVisualStudio10Generator.cxx +++ b/Source/cmLocalVisualStudio10Generator.cxx @@ -21,9 +21,9 @@ class cmVS10XMLParser : public cmXMLParser public: virtual void EndElement(const char* /* name */) { - } + } virtual void CharacterDataHandler(const char* data, int length) - { + { if(this->DoGUID ) { this->GUID.assign(data+1, length-2); @@ -40,7 +40,7 @@ class cmVS10XMLParser : public cmXMLParser if(strcmp("ProjectGUID", name) == 0 || strcmp("ProjectGuid", name) == 0) { this->DoGUID = true; - } + } } int InitializeParser() { @@ -50,7 +50,7 @@ class cmVS10XMLParser : public cmXMLParser { return ret; } - // visual studio projects have a strange encoding, but it is + // visual studio projects have a strange encoding, but it is // really utf-8 XML_SetEncoding(static_cast<XML_Parser>(this->Parser), "utf-8"); return 1; @@ -72,7 +72,7 @@ cmLocalVisualStudio10Generator::~cmLocalVisualStudio10Generator() void cmLocalVisualStudio10Generator::Generate() { - + cmTargets &tgts = this->Makefile->GetTargets(); for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l) { @@ -98,7 +98,7 @@ void cmLocalVisualStudio10Generator const char* path) { cmVS10XMLParser parser; - parser.ParseFile(path); + parser.ParseFile(path); // if we can not find a GUID then create one if(parser.GUID.empty()) diff --git a/Source/cmLocalVisualStudio10Generator.h b/Source/cmLocalVisualStudio10Generator.h index 699de4c..41db735 100644 --- a/Source/cmLocalVisualStudio10Generator.h +++ b/Source/cmLocalVisualStudio10Generator.h @@ -31,7 +31,7 @@ public: /** - * Generate the makefile for this directory. + * Generate the makefile for this directory. */ virtual void Generate(); virtual void ReadAndStoreExternalGUID(const char* name, diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index 5ab223b..1a7e611 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -108,7 +108,7 @@ void cmLocalVisualStudio6Generator::Generate() } void cmLocalVisualStudio6Generator::OutputDSPFile() -{ +{ // If not an in source build, then create the output directory if(strcmp(this->Makefile->GetStartOutputDirectory(), this->Makefile->GetHomeDirectory()) != 0) @@ -126,7 +126,7 @@ void cmLocalVisualStudio6Generator::OutputDSPFile() cmTargets &tgts = this->Makefile->GetTargets(); // build any targets - for(cmTargets::iterator l = tgts.begin(); + for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); l++) { switch(l->second.GetType()) @@ -152,7 +152,7 @@ void cmLocalVisualStudio6Generator::OutputDSPFile() } // INCLUDE_EXTERNAL_MSPROJECT command only affects the workspace // so don't build a projectfile for it - const char* path = + const char* path = l->second.GetProperty("EXTERNAL_MSPROJECT"); if(!path) { @@ -178,7 +178,7 @@ void cmLocalVisualStudio6Generator::OutputDSPFile() // extern std::string GetVS6TargetName(const std::string& targetName); -void cmLocalVisualStudio6Generator::CreateSingleDSP(const char *lname, +void cmLocalVisualStudio6Generator::CreateSingleDSP(const char *lname, cmTarget &target) { // add to the list of projects @@ -210,7 +210,7 @@ void cmLocalVisualStudio6Generator::AddDSPBuildRule(cmTarget& tgt) { std::string dspname = GetVS6TargetName(tgt.GetName()); dspname += ".dsp.cmake"; - const char* dsprule = + const char* dsprule = this->Makefile->GetRequiredDefinition("CMAKE_COMMAND"); cmCustomCommandLine commandLine; commandLine.push_back(dsprule); @@ -229,8 +229,8 @@ void cmLocalVisualStudio6Generator::AddDSPBuildRule(cmTarget& tgt) START_OUTPUT, UNCHANGED, true); commandLine.push_back(args); args = "-B"; - args += - this->Convert(this->Makefile->GetHomeOutputDirectory(), + args += + this->Convert(this->Makefile->GetHomeOutputDirectory(), START_OUTPUT, UNCHANGED, true); commandLine.push_back(args); @@ -254,7 +254,7 @@ void cmLocalVisualStudio6Generator::AddDSPBuildRule(cmTarget& tgt) } -void cmLocalVisualStudio6Generator::WriteDSPFile(std::ostream& fout, +void cmLocalVisualStudio6Generator::WriteDSPFile(std::ostream& fout, const char *libName, cmTarget &target) { @@ -301,21 +301,21 @@ void cmLocalVisualStudio6Generator::WriteDSPFile(std::ostream& fout, this->AddUtilityCommandHack(target, count++, depends, *cr); } } - + // We may be modifying the source groups temporarily, so make a copy. std::vector<cmSourceGroup> sourceGroups = this->Makefile->GetSourceGroups(); - + // get the classes from the source lists then add them to the groups std::vector<cmSourceFile*> const & classes = target.GetSourceFiles(); // now all of the source files have been properly assigned to the target // now stick them into source groups using the reg expressions - for(std::vector<cmSourceFile*>::const_iterator i = classes.begin(); + for(std::vector<cmSourceFile*>::const_iterator i = classes.begin(); i != classes.end(); i++) { // Add the file to the list of sources. std::string source = (*i)->GetFullPath(); - cmSourceGroup& sourceGroup = + cmSourceGroup& sourceGroup = this->Makefile->FindSourceGroup(source.c_str(), sourceGroups); sourceGroup.AssignSource(*i); // while we are at it, if it is a .rule file then for visual studio 6 we @@ -326,11 +326,11 @@ void cmLocalVisualStudio6Generator::WriteDSPFile(std::ostream& fout, { cmSystemTools::ReplaceString(source, "$(IntDir)/", ""); #if defined(_WIN32) || defined(__CYGWIN__) - std::ofstream fout(source.c_str(), - std::ios::binary | std::ios::out + std::ofstream fout(source.c_str(), + std::ios::binary | std::ios::out | std::ios::trunc); #else - std::ofstream fout(source.c_str(), + std::ofstream fout(source.c_str(), std::ios::out | std::ios::trunc); #endif if(fout) @@ -345,14 +345,14 @@ void cmLocalVisualStudio6Generator::WriteDSPFile(std::ostream& fout, // Write the DSP file's header. this->WriteDSPHeader(fout, libName, target, sourceGroups); - + // Loop through every source group. for(std::vector<cmSourceGroup>::const_iterator sg = sourceGroups.begin(); sg != sourceGroups.end(); ++sg) { this->WriteGroup(&(*sg), target, fout, libName); - } + } // Write the DSP file's footer. this->WriteDSPFooter(fout); @@ -364,15 +364,15 @@ void cmLocalVisualStudio6Generator { cmGeneratorTarget* gt = this->GlobalGenerator->GetGeneratorTarget(&target); - const std::vector<const cmSourceFile *> &sourceFiles = + const std::vector<const cmSourceFile *> &sourceFiles = sg->GetSourceFiles(); // If the group is empty, don't write it at all. - + if(sourceFiles.empty() && sg->GetGroupChildren().empty()) - { - return; + { + return; } - + // If the group has a name, write the header. std::string name = sg->GetName(); if(name != "") @@ -385,7 +385,7 @@ void cmLocalVisualStudio6Generator sourceFiles.begin(); sf != sourceFiles.end(); ++sf) { std::string source = (*sf)->GetFullPath(); - const cmCustomCommand *command = + const cmCustomCommand *command = (*sf)->GetCustomCommand(); std::string compileFlags; std::vector<std::string> depends; @@ -441,7 +441,7 @@ void cmLocalVisualStudio6Generator bool excludedFromBuild = (lang && (*sf)->GetPropertyAsBool("HEADER_FILE_ONLY")); - + // Check for extra object-file dependencies. const char* dependsValue = (*sf)->GetProperty("OBJECT_DEPENDS"); if(dependsValue) @@ -453,10 +453,10 @@ void cmLocalVisualStudio6Generator target.GetType() == cmTarget::GLOBAL_TARGET) { fout << "# Begin Source File\n\n"; - + // Tell MS-Dev what the source is. If the compiler knows how to // build it, then it will. - fout << "SOURCE=" << + fout << "SOURCE=" << this->ConvertToOptionallyRelativeOutputPath(source.c_str()) << "\n\n"; if(!depends.empty()) { @@ -464,8 +464,8 @@ void cmLocalVisualStudio6Generator fout << "USERDEP__HACK="; for(std::vector<std::string>::const_iterator d = depends.begin(); d != depends.end(); ++d) - { - fout << "\\\n\t" << + { + fout << "\\\n\t" << this->ConvertToOptionallyRelativeOutputPath(d->c_str()); } fout << "\n"; @@ -479,16 +479,16 @@ void cmLocalVisualStudio6Generator excludedFromBuild || !cdmap.empty()) { for(std::vector<std::string>::iterator i - = this->Configurations.begin(); + = this->Configurations.begin(); i != this->Configurations.end(); ++i) - { + { // Strip the subdirectory name out of the configuration name. std::string config = this->GetConfigName(*i); if (i == this->Configurations.begin()) { fout << "!IF \"$(CFG)\" == " << i->c_str() << std::endl; } - else + else { fout << "!ELSEIF \"$(CFG)\" == " << i->c_str() << std::endl; } @@ -512,7 +512,7 @@ void cmLocalVisualStudio6Generator fout << "\n# PROP Intermediate_Dir \"" << config << "/" << objectNameDir << "\"\n\n"; } - } + } fout << "!ENDIF\n\n"; } fout << "# End Source File\n"; @@ -528,7 +528,7 @@ void cmLocalVisualStudio6Generator - + // If the group has a name, write the footer. if(name != "") { @@ -586,7 +586,7 @@ cmLocalVisualStudio6Generator { comment = ""; } - + // Write the rule for each configuration. std::vector<std::string>::iterator i; for(i = this->Configurations.begin(); i != this->Configurations.end(); ++i) @@ -594,12 +594,12 @@ cmLocalVisualStudio6Generator std::string config = this->GetConfigName(*i); std::string script = this->ConstructScript(command, config.c_str(), "\\\n\t"); - + if (i == this->Configurations.begin()) { fout << "!IF \"$(CFG)\" == " << i->c_str() << std::endl; } - else + else { fout << "!ELSEIF \"$(CFG)\" == " << i->c_str() << std::endl; } @@ -609,9 +609,9 @@ cmLocalVisualStudio6Generator } // Write out the dependencies for the rule. fout << "USERDEP__HACK="; - for(std::vector<std::string>::const_iterator d = + for(std::vector<std::string>::const_iterator d = command.GetDepends().begin(); - d != command.GetDepends().end(); + d != command.GetDepends().end(); ++d) { // Lookup the real name of the dependency in case it is a CMake target. @@ -633,15 +633,15 @@ cmLocalVisualStudio6Generator fout << "\n\n"; if(command.GetOutputs().empty()) { - fout << source + fout << source << "_force : \"$(SOURCE)\" \"$(INTDIR)\" \"$(OUTDIR)\"\n\t"; fout << script.c_str() << "\n\n"; } else { - for(std::vector<std::string>::const_iterator o = + for(std::vector<std::string>::const_iterator o = command.GetOutputs().begin(); - o != command.GetOutputs().end(); + o != command.GetOutputs().end(); ++o) { // Write a rule for every output generated by this command. @@ -652,12 +652,12 @@ cmLocalVisualStudio6Generator } fout << "# End Custom Build\n\n"; } - + fout << "!ENDIF\n\n"; } -void cmLocalVisualStudio6Generator::WriteDSPBeginGroup(std::ostream& fout, +void cmLocalVisualStudio6Generator::WriteDSPBeginGroup(std::ostream& fout, const char* group, const char* filter) { @@ -679,7 +679,7 @@ void cmLocalVisualStudio6Generator::SetBuildType(BuildType b, cmTarget& target) { std::string root= this->Makefile->GetRequiredDefinition("CMAKE_ROOT"); - const char *def= + const char *def= this->Makefile->GetDefinition( "MSPROJECT_TEMPLATE_DIRECTORY"); if( def) @@ -690,7 +690,7 @@ void cmLocalVisualStudio6Generator::SetBuildType(BuildType b, { root += "/Templates"; } - + switch(b) { case STATIC_LIBRARY: @@ -740,7 +740,7 @@ void cmLocalVisualStudio6Generator::SetBuildType(BuildType b, } // reset this->Configurations - this->Configurations.erase(this->Configurations.begin(), + this->Configurations.erase(this->Configurations.begin(), this->Configurations.end()); // now add all the configurations possible @@ -785,9 +785,9 @@ cmLocalVisualStudio6Generator::MaybeCreateOutputDir(cmTarget& target, } // look for custom rules on a target and collect them together -std::string -cmLocalVisualStudio6Generator::CreateTargetRules(cmTarget &target, - const char* configName, +std::string +cmLocalVisualStudio6Generator::CreateTargetRules(cmTarget &target, + const char* configName, const char * /* libName */) { if (target.GetType() >= cmTarget::UTILITY ) @@ -895,8 +895,8 @@ cmLocalVisualStudio6Generator::GetTargetIncludeOptions(cmTarget &target) #define CM_USE_OLD_VS6 void cmLocalVisualStudio6Generator -::WriteDSPHeader(std::ostream& fout, - const char *libName, cmTarget &target, +::WriteDSPHeader(std::ostream& fout, + const char *libName, cmTarget &target, std::vector<cmSourceGroup> &) { bool targetBuilds = (target.GetType() >= cmTarget::EXECUTABLE && @@ -931,7 +931,7 @@ void cmLocalVisualStudio6Generator } std::set<std::string> pathEmitted; - + // determine the link directories std::string libOptions; std::string libDebugOptions; @@ -944,14 +944,14 @@ void cmLocalVisualStudio6Generator if(libPath.size()) { - std::string lpath = + std::string lpath = this->ConvertToOptionallyRelativeOutputPath(libPath.c_str()); if(lpath.size() == 0) { lpath = "."; } std::string lpathIntDir = libPath + "$(INTDIR)"; - lpathIntDir = + lpathIntDir = this->ConvertToOptionallyRelativeOutputPath(lpathIntDir.c_str()); if(pathEmitted.insert(lpath).second) { @@ -977,7 +977,7 @@ void cmLocalVisualStudio6Generator } if(exePath.size()) { - std::string lpath = + std::string lpath = this->ConvertToOptionallyRelativeOutputPath(exePath.c_str()); if(lpath.size() == 0) { @@ -986,7 +986,7 @@ void cmLocalVisualStudio6Generator std::string lpathIntDir = exePath + "$(INTDIR)"; lpathIntDir = this->ConvertToOptionallyRelativeOutputPath(lpathIntDir.c_str()); - + if(pathEmitted.insert(lpath).second) { libOptions += " /LIBPATH:"; @@ -1018,7 +1018,7 @@ void cmLocalVisualStudio6Generator { path += "/"; } - std::string lpath = + std::string lpath = this->ConvertToOptionallyRelativeOutputPath(path.c_str()); if(lpath.size() == 0) { @@ -1035,7 +1035,7 @@ void cmLocalVisualStudio6Generator libOptions += " /LIBPATH:"; libOptions += lpath; libOptions += " "; - + libMultiLineOptions += "# ADD LINK32 /LIBPATH:"; libMultiLineOptions += lpathIntDir; libMultiLineOptions += " "; @@ -1059,8 +1059,8 @@ void cmLocalVisualStudio6Generator // a library in a library, bad recursion) // NEVER LINK STATIC LIBRARIES TO OTHER STATIC LIBRARIES if ((target.GetType() != cmTarget::SHARED_LIBRARY - && target.GetType() != cmTarget::STATIC_LIBRARY - && target.GetType() != cmTarget::MODULE_LIBRARY) || + && target.GetType() != cmTarget::STATIC_LIBRARY + && target.GetType() != cmTarget::MODULE_LIBRARY) || (target.GetType()==cmTarget::SHARED_LIBRARY && libName != GetVS6TargetName(j->first)) || (target.GetType()==cmTarget::MODULE_LIBRARY @@ -1090,7 +1090,7 @@ void cmLocalVisualStudio6Generator } } lib = this->ConvertToOptionallyRelativeOutputPath(lib.c_str()); - libDebug = + libDebug = this->ConvertToOptionallyRelativeOutputPath(libDebug.c_str()); if (j->second == cmTarget::GENERAL) @@ -1121,7 +1121,7 @@ void cmLocalVisualStudio6Generator libMultiLineOptimizedOptions += "# ADD LINK32 "; libMultiLineOptimizedOptions += lib; libMultiLineOptimizedOptions += "\n"; - } + } } } #endif @@ -1137,17 +1137,17 @@ void cmLocalVisualStudio6Generator std::string extraLinkOptionsRelWithDebInfo; if(target.GetType() == cmTarget::EXECUTABLE) { - extraLinkOptions = + extraLinkOptions = this->Makefile->GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS"); } if(target.GetType() == cmTarget::SHARED_LIBRARY) { - extraLinkOptions = + extraLinkOptions = this->Makefile->GetRequiredDefinition("CMAKE_SHARED_LINKER_FLAGS"); } if(target.GetType() == cmTarget::MODULE_LIBRARY) { - extraLinkOptions = + extraLinkOptions = this->Makefile->GetRequiredDefinition("CMAKE_MODULE_LINKER_FLAGS"); } @@ -1229,7 +1229,7 @@ void cmLocalVisualStudio6Generator } // Compute the real name of the target. - std::string outputName = + std::string outputName = "(OUTPUT_NAME is for libraries and executables only)"; std::string outputNameDebug = outputName; std::string outputNameRelease = outputName; @@ -1380,13 +1380,13 @@ void cmLocalVisualStudio6Generator // are there any custom rules on the target itself // only if the target is a lib or exe - std::string customRuleCodeRelease + std::string customRuleCodeRelease = this->CreateTargetRules(target, "RELEASE", libName); - std::string customRuleCodeDebug + std::string customRuleCodeDebug = this->CreateTargetRules(target, "DEBUG", libName); - std::string customRuleCodeMinSizeRel + std::string customRuleCodeMinSizeRel = this->CreateTargetRules(target, "MINSIZEREL", libName); - std::string customRuleCodeRelWithDebInfo + std::string customRuleCodeRelWithDebInfo = this->CreateTargetRules(target, "RELWITHDEBINFO", libName); std::ifstream fin(this->DSPHeaderTemplate.c_str()); @@ -1400,7 +1400,7 @@ void cmLocalVisualStudio6Generator std::string staticLibOptionsMinSizeRel; std::string staticLibOptionsRelWithDebInfo; if(target.GetType() == cmTarget::STATIC_LIBRARY ) - { + { if(const char* libflags = target.GetProperty("STATIC_LIBRARY_FLAGS")) { staticLibOptions = libflags; @@ -1484,7 +1484,7 @@ void cmLocalVisualStudio6Generator staticLibOptionsRelWithDebInfo.c_str()); cmSystemTools::ReplaceString(line, "CM_STATIC_LIB_ARGS", staticLibOptions.c_str()); - } + } if(this->Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE")) { cmSystemTools::ReplaceString(line, "/nologo", ""); @@ -1506,8 +1506,8 @@ void cmLocalVisualStudio6Generator cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIMIZED_LIBRARIES", libMultiLineOptimizedOptions.c_str()); #endif - - // Substitute the rules for custom command. When specifying just the + + // Substitute the rules for custom command. When specifying just the // target name for the command the command can be different for // different configs cmSystemTools::ReplaceString(line, "CMAKE_CUSTOM_RULE_CODE_RELEASE", @@ -1520,24 +1520,24 @@ void cmLocalVisualStudio6Generator customRuleCodeRelWithDebInfo.c_str()); // Substitute the real output name into the template. - cmSystemTools::ReplaceString(line, "OUTPUT_NAME_DEBUG", + cmSystemTools::ReplaceString(line, "OUTPUT_NAME_DEBUG", outputNameDebug.c_str()); - cmSystemTools::ReplaceString(line, "OUTPUT_NAME_RELEASE", + cmSystemTools::ReplaceString(line, "OUTPUT_NAME_RELEASE", outputNameRelease.c_str()); cmSystemTools::ReplaceString(line, "OUTPUT_NAME_MINSIZEREL", outputNameMinSizeRel.c_str()); - cmSystemTools::ReplaceString(line, "OUTPUT_NAME_RELWITHDEBINFO", + cmSystemTools::ReplaceString(line, "OUTPUT_NAME_RELWITHDEBINFO", outputNameRelWithDebInfo.c_str()); cmSystemTools::ReplaceString(line, "OUTPUT_NAME", outputName.c_str()); // Substitute the proper link information into the template. - cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIONS_DEBUG", + cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIONS_DEBUG", optionsDebug.c_str()); - cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIONS_RELEASE", + cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIONS_RELEASE", optionsRelease.c_str()); cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIONS_MINSIZEREL", optionsMinSizeRel.c_str()); - cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIONS_RELWITHDEBINFO", + cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIONS_RELWITHDEBINFO", optionsRelWithDebInfo.c_str()); cmSystemTools::ReplaceString(line, "BUILD_INCLUDES", @@ -1588,12 +1588,12 @@ void cmLocalVisualStudio6Generator } } - cmSystemTools::ReplaceString(line, - "EXTRA_DEFINES", + cmSystemTools::ReplaceString(line, + "EXTRA_DEFINES", this->Makefile->GetDefineFlags()); const char* debugPostfix = this->Makefile->GetDefinition("CMAKE_DEBUG_POSTFIX"); - cmSystemTools::ReplaceString(line, "DEBUG_POSTFIX", + cmSystemTools::ReplaceString(line, "DEBUG_POSTFIX", debugPostfix?debugPostfix:""); // store flags for each configuration std::string flags = " "; @@ -1601,7 +1601,7 @@ void cmLocalVisualStudio6Generator std::string flagsMinSize = " "; std::string flagsDebug = " "; std::string flagsDebugRel = " "; - if(target.GetType() >= cmTarget::EXECUTABLE && + if(target.GetType() >= cmTarget::EXECUTABLE && target.GetType() <= cmTarget::OBJECT_LIBRARY) { const char* linkLanguage = target.GetLinkerLanguage(); @@ -1617,7 +1617,7 @@ void cmLocalVisualStudio6Generator baseFlagVar += linkLanguage; baseFlagVar += "_FLAGS"; flags = this->Makefile->GetSafeDefinition(baseFlagVar.c_str()); - + std::string flagVar = baseFlagVar + "_RELEASE"; flagsRelease = this->Makefile->GetSafeDefinition(flagVar.c_str()); flagsRelease += " -DCMAKE_INTDIR=\\\"Release\\\" "; @@ -1695,28 +1695,28 @@ void cmLocalVisualStudio6Generator flagsRelease += releaseDefines; flagsMinSize += minsizeDefines; flagsDebugRel += debugrelDefines; - + // The template files have CXX FLAGS in them, that need to be replaced. // There are not separate CXX and C template files, so we use the same // variable names. The previous code sets up flags* variables to contain // the correct C or CXX flags cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS_MINSIZEREL", flagsMinSize.c_str()); - cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS_DEBUG", + cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS_DEBUG", flagsDebug.c_str()); - cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS_RELWITHDEBINFO", + cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS_RELWITHDEBINFO", flagsDebugRel.c_str()); - cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS_RELEASE", + cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS_RELEASE", flagsRelease.c_str()); cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS", flags.c_str()); cmSystemTools::ReplaceString(line, "COMPILE_DEFINITIONS_MINSIZEREL", minsizeDefines.c_str()); - cmSystemTools::ReplaceString(line, "COMPILE_DEFINITIONS_DEBUG", + cmSystemTools::ReplaceString(line, "COMPILE_DEFINITIONS_DEBUG", debugDefines.c_str()); - cmSystemTools::ReplaceString(line, "COMPILE_DEFINITIONS_RELWITHDEBINFO", + cmSystemTools::ReplaceString(line, "COMPILE_DEFINITIONS_RELWITHDEBINFO", debugrelDefines.c_str()); - cmSystemTools::ReplaceString(line, "COMPILE_DEFINITIONS_RELEASE", + cmSystemTools::ReplaceString(line, "COMPILE_DEFINITIONS_RELEASE", releaseDefines.c_str()); cmSystemTools::ReplaceString(line, "COMPILE_DEFINITIONS", defines.c_str()); @@ -1725,7 +1725,7 @@ void cmLocalVisualStudio6Generator } void cmLocalVisualStudio6Generator::WriteDSPFooter(std::ostream& fout) -{ +{ std::ifstream fin(this->DSPFooterTemplate.c_str()); if(!fin) { diff --git a/Source/cmLocalVisualStudio6Generator.h b/Source/cmLocalVisualStudio6Generator.h index 1decc35..9315d97 100644 --- a/Source/cmLocalVisualStudio6Generator.h +++ b/Source/cmLocalVisualStudio6Generator.h @@ -37,7 +37,7 @@ public: virtual void AddCMakeListsRules(); /** - * Generate the makefile for this directory. + * Generate the makefile for this directory. */ virtual void Generate(); @@ -57,9 +57,9 @@ private: std::string DSPFooterTemplate; void CreateSingleDSP(const char *lname, cmTarget &tgt); - void WriteDSPFile(std::ostream& fout, const char *libName, + void WriteDSPFile(std::ostream& fout, const char *libName, cmTarget &tgt); - void WriteDSPBeginGroup(std::ostream& fout, + void WriteDSPBeginGroup(std::ostream& fout, const char* group, const char* filter); void WriteDSPEndGroup(std::ostream& fout); @@ -82,8 +82,8 @@ private: friend class EventWriter; cmsys::auto_ptr<cmCustomCommand> MaybeCreateOutputDir(cmTarget& target, const char* config); - std::string CreateTargetRules(cmTarget &target, - const char* configName, + std::string CreateTargetRules(cmTarget &target, + const char* configName, const char *libName); void ComputeLinkOptions(cmTarget& target, const char* configName, const std::string extraOptions, diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index f2ab79d..2dfca02 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -291,7 +291,7 @@ cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule() comment += makefileIn; std::string args; args = "-H"; - args += this->Convert(this->Makefile->GetHomeDirectory(), + args += this->Convert(this->Makefile->GetHomeDirectory(), START_OUTPUT, UNCHANGED, true); commandLine.push_back(args); args = "-B"; @@ -343,8 +343,8 @@ void cmLocalVisualStudio7Generator::WriteConfigurations(std::ostream& fout, fout << "\t</Configurations>\n"; } cmVS7FlagTable cmLocalVisualStudio7GeneratorFortranFlagTable[] = -{ - {"Preprocess", "fpp", "Run Preprocessor on files", "preprocessYes", 0}, +{ + {"Preprocess", "fpp", "Run Preprocessor on files", "preprocessYes", 0}, {"SuppressStartupBanner", "nologo", "SuppressStartupBanner", "true", 0}, {"SourceFileFormat", "fixed", "Use Fixed Format", "fileFormatFixed", 0}, {"SourceFileFormat", "free", "Use Free Format", "fileFormatFree", 0}, @@ -376,15 +376,15 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorFortranFlagTable[] = {"OptimizeForProcessor", "QxO", "", "codeExclusivelyCore2StreamingSIMD", 0}, {"OptimizeForProcessor", "QxS", "", "codeExclusivelyCore2StreamingSIMD4", 0}, - {"ModulePath", "module:", "", "", + {"ModulePath", "module:", "", "", cmVS7FlagTable::UserValueRequired}, - {"LoopUnrolling", "Qunroll:", "", "", + {"LoopUnrolling", "Qunroll:", "", "", cmVS7FlagTable::UserValueRequired}, - {"AutoParallelThreshold", "Qpar-threshold:", "", "", + {"AutoParallelThreshold", "Qpar-threshold:", "", "", cmVS7FlagTable::UserValueRequired}, - {"HeapArrays", "heap-arrays:", "", "", + {"HeapArrays", "heap-arrays:", "", "", cmVS7FlagTable::UserValueRequired}, - {"ObjectText", "bintext:", "", "", + {"ObjectText", "bintext:", "", "", cmVS7FlagTable::UserValueRequired}, {"Parallelization", "Qparallel", "", "true", 0}, {"PrefetchInsertion", "Qprefetch-", "", "false", 0}, @@ -476,7 +476,7 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorFlagTable[] = // boolean flags {"BufferSecurityCheck", "GS", "Buffer security check", "TRUE", 0}, {"BufferSecurityCheck", "GS-", "Turn off Buffer security check", "FALSE", 0}, - {"Detect64BitPortabilityProblems", "Wp64", + {"Detect64BitPortabilityProblems", "Wp64", "Detect 64-bit Portability Problems", "TRUE", 0}, {"EnableFiberSafeOptimizations", "GT", "Enable Fiber-safe Optimizations", "TRUE", 0}, @@ -566,7 +566,7 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorLinkFlagTable[] = {"TurnOffAssemblyGeneration", "NOASSEMBLY", "No assembly even if CLR information is present in objects.", "true", 0}, {"ModuleDefinitionFile", "DEF:", "add an export def file", "", - cmVS7FlagTable::UserValue}, + cmVS7FlagTable::UserValue}, {"GenerateMapFile", "MAP", "enable generation of map file", "TRUE", 0}, {0,0,0,0,0} }; @@ -800,7 +800,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, if(this->FortranProject) { const char* target_mod_dir = - target.GetProperty("Fortran_MODULE_DIRECTORY"); + target.GetProperty("Fortran_MODULE_DIRECTORY"); std::string modDir; if(target_mod_dir) { @@ -812,7 +812,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, { modDir = "."; } - fout << "\t\t\t\tModulePath=\"" + fout << "\t\t\t\tModulePath=\"" << this->ConvertToXMLOutputPath(modDir.c_str()) << "\\$(ConfigurationName)\"\n"; } @@ -826,7 +826,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, // output the include path std::string ipath = this->ConvertToXMLOutputPath(i->c_str()); fout << ipath << ";"; - // if this is fortran then output the include with + // if this is fortran then output the include with // a ConfigurationName on the end of it. if(this->FortranProject) { @@ -918,7 +918,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, // Add a flag telling the manifest tool to use a workaround // for FAT32 file systems, which can cause an empty manifest // to be embedded into the resulting executable. See CMake - // bug #2617. + // bug #2617. const char* tool = "VCManifestTool"; if(this->FortranProject) { @@ -941,7 +941,7 @@ cmLocalVisualStudio7Generator ::GetBuildTypeLinkerFlags(std::string rootLinkerFlags, const char* configName) { std::string configTypeUpper = cmSystemTools::UpperCase(configName); - std::string extraLinkOptionsBuildTypeDef = + std::string extraLinkOptionsBuildTypeDef = rootLinkerFlags + "_" + configTypeUpper; std::string extraLinkOptionsBuildType = @@ -962,23 +962,23 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, std::string extraLinkOptions; if(target.GetType() == cmTarget::EXECUTABLE) { - extraLinkOptions = - this->Makefile->GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS") - + std::string(" ") + extraLinkOptions = + this->Makefile->GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS") + + std::string(" ") + GetBuildTypeLinkerFlags("CMAKE_EXE_LINKER_FLAGS", configName); } if(target.GetType() == cmTarget::SHARED_LIBRARY) { - extraLinkOptions = - this->Makefile->GetRequiredDefinition("CMAKE_SHARED_LINKER_FLAGS") - + std::string(" ") + extraLinkOptions = + this->Makefile->GetRequiredDefinition("CMAKE_SHARED_LINKER_FLAGS") + + std::string(" ") + GetBuildTypeLinkerFlags("CMAKE_SHARED_LINKER_FLAGS", configName); } if(target.GetType() == cmTarget::MODULE_LIBRARY) { - extraLinkOptions = - this->Makefile->GetRequiredDefinition("CMAKE_MODULE_LINKER_FLAGS") - + std::string(" ") + extraLinkOptions = + this->Makefile->GetRequiredDefinition("CMAKE_MODULE_LINKER_FLAGS") + + std::string(" ") + GetBuildTypeLinkerFlags("CMAKE_MODULE_LINKER_FLAGS", configName); } @@ -1203,7 +1203,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, temp = target.GetDirectory(configName); temp += "/"; temp += targetNameFull; - fout << "\t\t\t\tOutputFile=\"" + fout << "\t\t\t\tOutputFile=\"" << this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"\n"; this->WriteTargetVersionAttribute(fout, target); linkOptions.OutputFlagMap(fout, "\t\t\t\t"); @@ -1594,7 +1594,7 @@ cmLocalVisualStudio7Generator void cmLocalVisualStudio7Generator ::WriteGroup(const cmSourceGroup *sg, cmTarget& target, - std::ostream &fout, const char *libName, + std::ostream &fout, const char *libName, std::vector<std::string> *configs) { const std::vector<const cmSourceFile *> &sourceFiles = @@ -1652,7 +1652,7 @@ void cmLocalVisualStudio7Generator } if(ext == "rc") { - aCompilerTool = "VCResourceCompilerTool"; + aCompilerTool = "VCResourceCompilerTool"; lang = "RC"; if(this->FortranProject) { @@ -1744,7 +1744,7 @@ WriteCustomRule(std::ostream& fout, FCInfo& fcinfo) { std::string comment = this->ConstructComment(command); - + // Write the rule for each configuration. std::vector<std::string>::iterator i; std::vector<std::string> *configs = @@ -1780,9 +1780,9 @@ WriteCustomRule(std::ostream& fout, } fout << "\t\t\t\t\t<Tool\n" << "\t\t\t\t\tName=\"" << customTool << "\"\n" - << "\t\t\t\t\tDescription=\"" + << "\t\t\t\t\tDescription=\"" << this->EscapeForXML(comment.c_str()) << "\"\n" - << "\t\t\t\t\tCommandLine=\"" + << "\t\t\t\t\tCommandLine=\"" << this->EscapeForXML(script.c_str()) << "\"\n" << "\t\t\t\t\tAdditionalDependencies=\""; if(command.GetDepends().empty()) @@ -1799,9 +1799,9 @@ WriteCustomRule(std::ostream& fout, else { // Write out the dependencies for the rule. - for(std::vector<std::string>::const_iterator d = + for(std::vector<std::string>::const_iterator d = command.GetDepends().begin(); - d != command.GetDepends().end(); + d != command.GetDepends().end(); ++d) { // Get the real name of the dependency in case it is a CMake target. @@ -1823,9 +1823,9 @@ WriteCustomRule(std::ostream& fout, { // Write a rule for the output generated by this command. const char* sep = ""; - for(std::vector<std::string>::const_iterator o = - command.GetOutputs().begin(); - o != command.GetOutputs().end(); + for(std::vector<std::string>::const_iterator o = + command.GetOutputs().begin(); + o != command.GetOutputs().end(); ++o) { fout << sep << this->ConvertToXMLOutputPathSingle(o->c_str()); @@ -1922,7 +1922,7 @@ cmLocalVisualStudio7Generator const char *libName, cmTarget & target) { - + cmGlobalVisualStudio7Generator* gg = static_cast<cmGlobalVisualStudio7Generator *>(this->GlobalGenerator); @@ -1954,7 +1954,7 @@ cmLocalVisualStudio7Generator if(!keyword) { keyword = "Console Application"; - } + } const char* projectType = 0; switch(target.GetType()) { @@ -1990,7 +1990,7 @@ cmLocalVisualStudio7Generator fout << "\tProjectType=\"" << projectType << "\"\n"; } this->WriteProjectSCC(fout, target); - fout<< "\tKeyword=\"" << keyword << "\">\n" + fout<< "\tKeyword=\"" << keyword << "\">\n" << "\tProjectGUID=\"{" << gg->GetGUID(libName) << "}\">\n" << "\t<Platforms>\n" << "\t\t<Platform\n\t\t\tName=\"" << this->PlatformName << "\"/>\n" @@ -2110,7 +2110,7 @@ std::string cmLocalVisualStudio7Generator // This class is used to parse an existing vs 7 project -// and extract the GUID +// and extract the GUID class cmVS7XMLParser : public cmXMLParser { public: @@ -2130,7 +2130,7 @@ public: while(atts[i]) { if(strcmp(atts[i], "ProjectGUID") == 0) - { + { if(atts[i+1]) { this->GUID = atts[i+1]; @@ -2144,7 +2144,7 @@ public: } ++i; } - } + } } int InitializeParser() { @@ -2153,7 +2153,7 @@ public: { return ret; } - // visual studio projects have a strange encoding, but it is + // visual studio projects have a strange encoding, but it is // really utf-8 XML_SetEncoding(static_cast<XML_Parser>(this->Parser), "utf-8"); return 1; diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h index 9aa408e..95db2cc 100644 --- a/Source/cmLocalVisualStudio7Generator.h +++ b/Source/cmLocalVisualStudio7Generator.h @@ -42,7 +42,7 @@ public: virtual void AddHelperCommands(); /** - * Generate the makefile for this directory. + * Generate the makefile for this directory. */ virtual void Generate(); @@ -77,17 +77,17 @@ private: void WriteVCProjHeader(std::ostream& fout, const char *libName, cmTarget &tgt, std::vector<cmSourceGroup> &sgs); void WriteVCProjFooter(std::ostream& fout, cmTarget &target); - void WriteVCProjFile(std::ostream& fout, const char *libName, + void WriteVCProjFile(std::ostream& fout, const char *libName, cmTarget &tgt); void WriteConfigurations(std::ostream& fout, const char *libName, cmTarget &tgt); void WriteConfiguration(std::ostream& fout, const char* configName, - const char* libName, cmTarget &tgt); + const char* libName, cmTarget &tgt); std::string EscapeForXML(const char* s); std::string ConvertToXMLOutputPath(const char* path); std::string ConvertToXMLOutputPathSingle(const char* path); - void OutputTargetRules(std::ostream& fout, const char* configName, + void OutputTargetRules(std::ostream& fout, const char* configName, cmTarget &target, const char *libName); void OutputBuildTool(std::ostream& fout, const char* configName, cmTarget& t, bool debug); @@ -98,18 +98,18 @@ private: cmTarget &tgt, std::vector<cmSourceGroup> &sgs); void WriteProjectStartFortran(std::ostream& fout, const char *libName, cmTarget &tgt); - void WriteVCProjBeginGroup(std::ostream& fout, + void WriteVCProjBeginGroup(std::ostream& fout, const char* group, const char* filter); void WriteVCProjEndGroup(std::ostream& fout); - + void WriteCustomRule(std::ostream& fout, const char* source, const cmCustomCommand& command, FCInfo& fcinfo); void WriteTargetVersionAttribute(std::ostream& fout, cmTarget& target); - void WriteGroup(const cmSourceGroup *sg, + void WriteGroup(const cmSourceGroup *sg, cmTarget& target, std::ostream &fout, const char *libName, std::vector<std::string> *configs); @@ -122,7 +122,7 @@ private: cmVS7FlagTable const* ExtraFlagTable; std::string ModuleDefinitionFile; bool FortranProject; - std::string PlatformName; // Win32 or x64 + std::string PlatformName; // Win32 or x64 cmLocalVisualStudio7GeneratorInternals* Internal; }; diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index 2599227..bd7ec00 100644 --- a/Source/cmMacroCommand.cxx +++ b/Source/cmMacroCommand.cxx @@ -56,7 +56,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InvokeInitialPass(const std::vector<cmListFileArgument>& args, + virtual bool InvokeInitialPass(const std::vector<cmListFileArgument>& args, cmExecutionStatus &); virtual bool InitialPass(std::vector<std::string> const&, @@ -66,7 +66,7 @@ public: * The name of the command as specified in CMakeList.txt. */ virtual const char* GetName() const { return this->Args[0].c_str(); } - + /** * Succinct documentation. */ @@ -164,7 +164,7 @@ bool cmMacroHelperCommand::InvokeInitialPass { variable = "${"; variable += this->Args[j]; - variable += "}"; + variable += "}"; cmSystemTools::ReplaceString(tmps, variable.c_str(), expandedArgs[j-1].c_str()); } @@ -270,7 +270,7 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf, else if(!cmSystemTools::Strucmp(lff.Name.c_str(),"endmacro")) { // if this is the endmacro for this macro then execute - if (!this->Depth) + if (!this->Depth) { std::string name = this->Args[0]; std::vector<std::string>::size_type cc; @@ -287,7 +287,7 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf, f->Functions = this->Functions; mf.RecordPolicies(f->Policies); std::string newName = "_" + this->Args[0]; - mf.GetCMakeInstance()->RenameCommand(this->Args[0].c_str(), + mf.GetCMakeInstance()->RenameCommand(this->Args[0].c_str(), newName.c_str()); mf.AddCommand(f); @@ -341,7 +341,7 @@ bool cmMacroCommand::InitialPass(std::vector<std::string> const& args, cmMacroFunctionBlocker *f = new cmMacroFunctionBlocker(); for(std::vector<std::string>::const_iterator j = args.begin(); j != args.end(); ++j) - { + { f->Args.push_back(*j); } this->Makefile->AddFunctionBlocker(f); diff --git a/Source/cmMacroCommand.h b/Source/cmMacroCommand.h index 36e4b2f..f8c40c0 100644 --- a/Source/cmMacroCommand.h +++ b/Source/cmMacroCommand.h @@ -20,11 +20,11 @@ class cmMacroFunctionBlocker : public cmFunctionBlocker public: cmMacroFunctionBlocker() {this->Depth=0;} virtual ~cmMacroFunctionBlocker() {} - virtual bool IsFunctionBlocked(const cmListFileFunction&, + virtual bool IsFunctionBlocked(const cmListFileFunction&, cmMakefile &mf, cmExecutionStatus &); virtual bool ShouldRemove(const cmListFileFunction&, cmMakefile &mf); - + std::vector<std::string> Args; std::vector<cmListFileFunction> Functions; int Depth; diff --git a/Source/cmMakeDepend.cxx b/Source/cmMakeDepend.cxx index 6055c55..a68b57c 100644 --- a/Source/cmMakeDepend.cxx +++ b/Source/cmMakeDepend.cxx @@ -31,8 +31,8 @@ cmMakeDepend::cmMakeDepend() cmMakeDepend::~cmMakeDepend() -{ - for(DependInformationMapType::iterator i = +{ + for(DependInformationMapType::iterator i = this->DependInformationMap.begin(); i != this->DependInformationMap.end(); ++i) { @@ -162,7 +162,7 @@ void cmMakeDepend::GenerateDependInformation(cmDependInformation* info) else { //try to guess which include path to use - for(std::vector<std::string>::iterator t = + for(std::vector<std::string>::iterator t = this->IncludeDirectories.begin(); t != this->IncludeDirectories.end(); ++t) { @@ -175,7 +175,7 @@ void cmMakeDepend::GenerateDependInformation(cmDependInformation* info) if (srcFile->GetFullPath() == incpath) { // set the path to the guessed path - info->FullPath = incpath; + info->FullPath = incpath; found=true; } } @@ -243,7 +243,7 @@ void cmMakeDepend::DependWalk(cmDependInformation* info) void cmMakeDepend::AddDependency(cmDependInformation* info, const char* file) { - cmDependInformation* dependInfo = + cmDependInformation* dependInfo = this->GetDependInformation(file, info->PathOnly.c_str()); this->GenerateDependInformation(dependInfo); info->AddDependencies(dependInfo); @@ -288,7 +288,7 @@ std::string cmMakeDepend::FullPath(const char* fname, const char *extraPath) { m = this->DirectoryToFileToPathMap.find(""); } - + if(m != this->DirectoryToFileToPathMap.end()) { FileToPathMapType& map = m->second; @@ -305,7 +305,7 @@ std::string cmMakeDepend::FullPath(const char* fname, const char *extraPath) this->DirectoryToFileToPathMap[extraPath? extraPath: ""][fname] = fp; return fp; } - + for(std::vector<std::string>::iterator i = this->IncludeDirectories.begin(); i != this->IncludeDirectories.end(); ++i) { diff --git a/Source/cmMakeDepend.h b/Source/cmMakeDepend.h index 185f4e3..b6e3928 100644 --- a/Source/cmMakeDepend.h +++ b/Source/cmMakeDepend.h @@ -48,26 +48,26 @@ public: * to it. */ const cmSourceFile *SourceFile; - + /** * Full path to this file. */ std::string FullPath; - + /** * Full path not including file name. */ std::string PathOnly; - + /** * Name used to #include this file. */ std::string IncludeName; - + /** * This method adds the dependencies of another file to this one. */ - void AddDependencies(cmDependInformation*); + void AddDependencies(cmDependInformation*); }; @@ -85,11 +85,11 @@ public: * Destructor. */ virtual ~cmMakeDepend(); - - /** + + /** * Set the makefile that is used as a source of classes. */ - virtual void SetMakefile(cmMakefile* makefile); + virtual void SetMakefile(cmMakefile* makefile); /** * Add a directory to the search path for include files. @@ -107,26 +107,26 @@ protected: * Compute the depend information for this class. */ virtual void DependWalk(cmDependInformation* info); - + /** * Add a dependency. Possibly walk it for more dependencies. */ virtual void AddDependency(cmDependInformation* info, const char* file); - + /** * Fill in the given object with dependency information. If the * information is already complete, nothing is done. */ void GenerateDependInformation(cmDependInformation* info); - + /** * Get an instance of cmDependInformation corresponding to the given file * name. */ - cmDependInformation* GetDependInformation(const char* file, - const char *extraPath); - - /** + cmDependInformation* GetDependInformation(const char* file, + const char *extraPath); + + /** * Find the full path name for the given file name. * This uses the include directories. * TODO: Cache path conversions to reduce FileExists calls. @@ -139,9 +139,9 @@ protected: cmsys::RegularExpression ComplainFileRegularExpression; std::vector<std::string> IncludeDirectories; typedef std::map<cmStdString, cmStdString> FileToPathMapType; - typedef std::map<cmStdString, FileToPathMapType> + typedef std::map<cmStdString, FileToPathMapType> DirectoryToFileToPathMapType; - typedef std::map<cmStdString, cmDependInformation*> + typedef std::map<cmStdString, cmDependInformation*> DependInformationMapType; DependInformationMapType DependInformationMap; DirectoryToFileToPathMapType DirectoryToFileToPathMap; diff --git a/Source/cmMakeDirectoryCommand.h b/Source/cmMakeDirectoryCommand.h index 4e6e1d5..a0f866a 100644 --- a/Source/cmMakeDirectoryCommand.h +++ b/Source/cmMakeDirectoryCommand.h @@ -29,7 +29,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmMakeDirectoryCommand; } @@ -45,7 +45,7 @@ public: * The name of the command as specified in CMakeList.txt. */ virtual const char* GetName() const { return "make_directory";} - + /** * This determines if the command is invoked when in script mode. */ @@ -58,7 +58,7 @@ public: { return "Deprecated. Use the file(MAKE_DIRECTORY ) command instead."; } - + /** * More documentation. */ @@ -70,7 +70,7 @@ public: "parent directories that do not exist will also be created. Use with " "care."; } - + /** This command is kept for compatibility with older CMake versions. */ virtual bool IsDiscouraged() const { diff --git a/Source/cmMarkAsAdvancedCommand.cxx b/Source/cmMarkAsAdvancedCommand.cxx index a80f7ec..4236d10 100644 --- a/Source/cmMarkAsAdvancedCommand.cxx +++ b/Source/cmMarkAsAdvancedCommand.cxx @@ -37,7 +37,7 @@ bool cmMarkAsAdvancedCommand { std::string variable = args[i]; cmCacheManager* manager = this->Makefile->GetCacheManager(); - cmCacheManager::CacheIterator it = + cmCacheManager::CacheIterator it = manager->GetCacheIterator(variable.c_str()); if ( it.IsAtEnd() ) { diff --git a/Source/cmMarkAsAdvancedCommand.h b/Source/cmMarkAsAdvancedCommand.h index 3658dbb..246eb8a 100644 --- a/Source/cmMarkAsAdvancedCommand.h +++ b/Source/cmMarkAsAdvancedCommand.h @@ -25,7 +25,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmMarkAsAdvancedCommand; } @@ -41,7 +41,7 @@ public: * The name of the command as specified in CMakeList.txt. */ virtual const char* GetName() const {return "mark_as_advanced";} - + /** * Succinct documentation. */ @@ -49,7 +49,7 @@ public: { return "Mark cmake cached variables as advanced."; } - + /** * More documentation. */ diff --git a/Source/cmMathCommand.cxx b/Source/cmMathCommand.cxx index 3c1129d..9fc4265 100644 --- a/Source/cmMathCommand.cxx +++ b/Source/cmMathCommand.cxx @@ -43,7 +43,7 @@ bool cmMathCommand::HandleExprCommand(std::vector<std::string> const& args) const std::string& outputVariable = args[1]; const std::string& expression = args[2]; - + cmExprParserHelper helper; if ( !helper.ParseString(expression.c_str(), 0) ) { diff --git a/Source/cmMathCommand.h b/Source/cmMathCommand.h index d622904..27c5b6a 100644 --- a/Source/cmMathCommand.h +++ b/Source/cmMathCommand.h @@ -21,7 +21,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmMathCommand; } @@ -50,7 +50,7 @@ public: { return "Mathematical expressions."; } - + /** * More documentation. */ @@ -64,10 +64,10 @@ public: "+ - * / % | & ^ ~ << >> * / %. They have the same meaning " " as they do in c code."; } - + cmTypeMacro(cmMathCommand, cmCommand); protected: - + bool HandleExprCommand(std::vector<std::string> const& args); }; diff --git a/Source/cmMessageCommand.h b/Source/cmMessageCommand.h index 03ab94b..9f01eaf 100644 --- a/Source/cmMessageCommand.h +++ b/Source/cmMessageCommand.h @@ -24,7 +24,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmMessageCommand; } @@ -53,7 +53,7 @@ public: { return "Display a message to the user."; } - + /** * More documentation. */ @@ -83,7 +83,7 @@ public: "Indented text is considered pre-formatted." ; } - + cmTypeMacro(cmMessageCommand, cmCommand); }; diff --git a/Source/cmObject.h b/Source/cmObject.h index 1a39aa7..ca6a54f 100644 --- a/Source/cmObject.h +++ b/Source/cmObject.h @@ -27,7 +27,7 @@ public: * Need virtual destructor to destroy real command type. */ virtual ~cmObject() {} - + /** * The class name of the command. */ @@ -38,7 +38,7 @@ public: */ static bool IsTypeOf(const char *type) { return !strcmp("cmObject", type); } - + /** * Returns true if this object is an instance of the given class or * a subclass of it. diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx index af9d94b..776a3a4 100644 --- a/Source/cmOptionCommand.cxx +++ b/Source/cmOptionCommand.cxx @@ -42,11 +42,11 @@ bool cmOptionCommand this->SetError(m.c_str()); return false; } - + std::string initialValue = "Off"; // Now check and see if the value has been stored in the cache // already, if so use that value and don't look for the program - cmCacheManager::CacheIterator it = + cmCacheManager::CacheIterator it = this->Makefile->GetCacheManager()->GetCacheIterator(args[0].c_str()); if(!it.IsAtEnd()) { diff --git a/Source/cmOptionCommand.h b/Source/cmOptionCommand.h index da31332..7d02400 100644 --- a/Source/cmOptionCommand.h +++ b/Source/cmOptionCommand.h @@ -25,7 +25,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmOptionCommand; } @@ -41,7 +41,7 @@ public: * The name of the command as specified in CMakeList.txt. */ virtual const char* GetName() const {return "option";} - + /** * Succinct documentation. */ @@ -49,7 +49,7 @@ public: { return "Provides an option that the user can optionally select."; } - + /** * More documentation. */ diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx index be079c0..01fc2cf 100644 --- a/Source/cmOutputRequiredFilesCommand.cxx +++ b/Source/cmOutputRequiredFilesCommand.cxx @@ -28,7 +28,7 @@ void cmLBDepend::DependWalk(cmDependInformation* info) cmSystemTools::Error("error can not open ", info->FullPath.c_str()); return; } - + std::string line; while(cmSystemTools::GetLineFromStream(fin, line)) { @@ -45,7 +45,7 @@ void cmLBDepend::DependWalk(cmDependInformation* info) // if a < is not found then move on if(qstart == std::string::npos) { - cmSystemTools::Error("unknown include directive ", + cmSystemTools::Error("unknown include directive ", currentline.c_str() ); continue; } @@ -73,7 +73,7 @@ void cmLBDepend::DependWalk(cmDependInformation* info) } continue; } - + // Add this file and all its dependencies. this->AddDependency(info, includeFile.c_str()); /// add the cxx file if it exists @@ -89,7 +89,7 @@ void cmLBDepend::DependWalk(cmDependInformation* info) { found = true; } - for(std::vector<std::string>::iterator i = + for(std::vector<std::string>::iterator i = this->IncludeDirectories.begin(); i != this->IncludeDirectories.end(); ++i) { @@ -108,7 +108,7 @@ void cmLBDepend::DependWalk(cmDependInformation* info) { found = true; } - for(std::vector<std::string>::iterator i = + for(std::vector<std::string>::iterator i = this->IncludeDirectories.begin(); i != this->IncludeDirectories.end(); ++i) { @@ -128,7 +128,7 @@ void cmLBDepend::DependWalk(cmDependInformation* info) { found = true; } - for(std::vector<std::string>::iterator i = + for(std::vector<std::string>::iterator i = this->IncludeDirectories.begin(); i != this->IncludeDirectories.end(); ++i) { @@ -148,7 +148,7 @@ void cmLBDepend::DependWalk(cmDependInformation* info) { found = true; } - for(std::vector<std::string>::iterator i = + for(std::vector<std::string>::iterator i = this->IncludeDirectories.begin(); i != this->IncludeDirectories.end(); ++i) { @@ -183,7 +183,7 @@ bool cmOutputRequiredFilesCommand // store the arg for final pass this->File = args[0]; this->OutputFile = args[1]; - + // compute the list of files cmLBDepend md; md.SetMakefile(this->Makefile); @@ -217,7 +217,7 @@ ListDependencies(cmDependInformation const *info, // add info to the visited set visited->insert(info); // now recurse with info's dependencies - for(cmDependInformation::DependencySetType::const_iterator d = + for(cmDependInformation::DependencySetType::const_iterator d = info->DependencySet.begin(); d != info->DependencySet.end(); ++d) { diff --git a/Source/cmOutputRequiredFilesCommand.h b/Source/cmOutputRequiredFilesCommand.h index 85d9095..1d7e394 100644 --- a/Source/cmOutputRequiredFilesCommand.h +++ b/Source/cmOutputRequiredFilesCommand.h @@ -25,7 +25,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmOutputRequiredFilesCommand; } @@ -49,7 +49,7 @@ public: { return "Deprecated. Approximate C preprocessor dependency scanning."; } - + /** * More documentation. */ @@ -72,7 +72,7 @@ public: return true; } - + cmTypeMacro(cmOutputRequiredFilesCommand, cmCommand); void ListDependencies(cmDependInformation const *info, FILE *fout, diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index fcf0a49..11f9a76 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -19,14 +19,14 @@ bool cmProjectCommand { this->SetError("PROJECT called with incorrect number of arguments"); return false; - } + } this->Makefile->SetProjectName(args[0].c_str()); std::string bindir = args[0]; bindir += "_BINARY_DIR"; std::string srcdir = args[0]; srcdir += "_SOURCE_DIR"; - + this->Makefile->AddCacheDefinition (bindir.c_str(), this->Makefile->GetCurrentOutputDirectory(), @@ -35,7 +35,7 @@ bool cmProjectCommand (srcdir.c_str(), this->Makefile->GetCurrentDirectory(), "Value Computed by CMake", cmCacheManager::STATIC); - + bindir = "PROJECT_BINARY_DIR"; srcdir = "PROJECT_SOURCE_DIR"; diff --git a/Source/cmProjectCommand.h b/Source/cmProjectCommand.h index 88a1944..a53cb3f 100644 --- a/Source/cmProjectCommand.h +++ b/Source/cmProjectCommand.h @@ -28,7 +28,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmProjectCommand; } @@ -39,7 +39,7 @@ public: */ virtual bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus &status); - + /** * The name of the command as specified in CMakeList.txt. */ @@ -52,7 +52,7 @@ public: { return "Set a name for the entire project."; } - + /** * More documentation. */ @@ -73,7 +73,7 @@ public: "the file pointed to by that variable will be included as the last step " "of the project command."; } - + cmTypeMacro(cmProjectCommand, cmCommand); }; diff --git a/Source/cmProperty.h b/Source/cmProperty.h index e0fcd63..bb75bb0 100644 --- a/Source/cmProperty.h +++ b/Source/cmProperty.h @@ -14,7 +14,7 @@ #include "cmStandardIncludes.h" -class cmProperty +class cmProperty { public: enum ScopeType { TARGET, SOURCE_FILE, DIRECTORY, GLOBAL, CACHE, diff --git a/Source/cmPropertyDefinition.h b/Source/cmPropertyDefinition.h index 16bd148..296366d 100644 --- a/Source/cmPropertyDefinition.h +++ b/Source/cmPropertyDefinition.h @@ -29,7 +29,7 @@ public: /// Define this property void DefineProperty(const char *name, cmProperty::ScopeType scope, const char *ShortDescription, - const char *FullDescription, + const char *FullDescription, const char *DocumentationSection, bool chained); @@ -44,7 +44,7 @@ public: /// Get the section if any const std::string &GetDocumentationSection() const { - return this->DocumentationSection; }; + return this->DocumentationSection; }; /// Get the scope cmProperty::ScopeType GetScope() const { @@ -56,7 +56,7 @@ public: /// Get the documentation (full version) const std::string &GetFullDescription() const { - return this->FullDescription; }; + return this->FullDescription; }; protected: std::string Name; diff --git a/Source/cmPropertyDefinitionMap.cxx b/Source/cmPropertyDefinitionMap.cxx index fcdb937..20fa07c 100644 --- a/Source/cmPropertyDefinitionMap.cxx +++ b/Source/cmPropertyDefinitionMap.cxx @@ -30,7 +30,7 @@ void cmPropertyDefinitionMap if (it == this->end()) { prop = &(*this)[name]; - prop->DefineProperty(name,scope,ShortDescription, FullDescription, + prop->DefineProperty(name,scope,ShortDescription, FullDescription, DocumentationSection, chain); } } @@ -49,10 +49,10 @@ void cmPropertyDefinitionMap { switch (j->second.GetScope()) { - case cmProperty::GLOBAL: + case cmProperty::GLOBAL: secName = "Properties of Global Scope"; break; - case cmProperty::TARGET: + case cmProperty::TARGET: secName = "Properties on Targets"; break; case cmProperty::SOURCE_FILE: @@ -80,7 +80,7 @@ void cmPropertyDefinitionMap } if (!v[secName]) { - v[secName] = new + v[secName] = new cmDocumentationSection(secName.c_str(), cmSystemTools::UpperCase(secName).c_str()); } diff --git a/Source/cmPropertyDefinitionMap.h b/Source/cmPropertyDefinitionMap.h index c6f9d59..007e265 100644 --- a/Source/cmPropertyDefinitionMap.h +++ b/Source/cmPropertyDefinitionMap.h @@ -16,7 +16,7 @@ class cmDocumentationSection; -class cmPropertyDefinitionMap : +class cmPropertyDefinitionMap : public std::map<cmStdString,cmPropertyDefinition> { public: diff --git a/Source/cmPropertyMap.cxx b/Source/cmPropertyMap.cxx index a4d0bf3..78f378a 100644 --- a/Source/cmPropertyMap.cxx +++ b/Source/cmPropertyMap.cxx @@ -43,7 +43,7 @@ void cmPropertyMap::SetProperty(const char *name, const char *value, #ifdef CMAKE_STRICT if (!this->CMakeInstance) { - cmSystemTools::Error("CMakeInstance not set on a property map!"); + cmSystemTools::Error("CMakeInstance not set on a property map!"); abort(); } else @@ -85,10 +85,10 @@ void cmPropertyMap::AppendProperty(const char* name, const char* value, } const char *cmPropertyMap -::GetPropertyValue(const char *name, - cmProperty::ScopeType scope, +::GetPropertyValue(const char *name, + cmProperty::ScopeType scope, bool &chain) const -{ +{ chain = false; if (!name) { @@ -99,7 +99,7 @@ const char *cmPropertyMap #ifdef CMAKE_STRICT if (!this->CMakeInstance) { - cmSystemTools::Error("CMakeInstance not set on a property map!"); + cmSystemTools::Error("CMakeInstance not set on a property map!"); abort(); } else diff --git a/Source/cmPropertyMap.h b/Source/cmPropertyMap.h index 94275e2..0c3aad4 100644 --- a/Source/cmPropertyMap.h +++ b/Source/cmPropertyMap.h @@ -21,13 +21,13 @@ class cmPropertyMap : public std::map<cmStdString,cmProperty> public: cmProperty *GetOrCreateProperty(const char *name); - void SetProperty(const char *name, const char *value, + void SetProperty(const char *name, const char *value, cmProperty::ScopeType scope); void AppendProperty(const char* name, const char* value, cmProperty::ScopeType scope, bool asString=false); - const char *GetPropertyValue(const char *name, + const char *GetPropertyValue(const char *name, cmProperty::ScopeType scope, bool &chain) const; diff --git a/Source/cmQTWrapCPPCommand.cxx b/Source/cmQTWrapCPPCommand.cxx index 1f1aed7..0d3c994 100644 --- a/Source/cmQTWrapCPPCommand.cxx +++ b/Source/cmQTWrapCPPCommand.cxx @@ -12,7 +12,7 @@ #include "cmQTWrapCPPCommand.h" // cmQTWrapCPPCommand -bool cmQTWrapCPPCommand::InitialPass(std::vector<std::string> const& argsIn, +bool cmQTWrapCPPCommand::InitialPass(std::vector<std::string> const& argsIn, cmExecutionStatus &) { if(argsIn.size() < 3 ) diff --git a/Source/cmQTWrapCPPCommand.h b/Source/cmQTWrapCPPCommand.h index 0184927..1af0840 100644 --- a/Source/cmQTWrapCPPCommand.h +++ b/Source/cmQTWrapCPPCommand.h @@ -30,7 +30,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmQTWrapCPPCommand; } @@ -54,7 +54,7 @@ public: { return "Create Qt Wrappers."; } - + /** * More documentation. */ diff --git a/Source/cmQTWrapUICommand.cxx b/Source/cmQTWrapUICommand.cxx index bbecd8d..a6a4b51 100644 --- a/Source/cmQTWrapUICommand.cxx +++ b/Source/cmQTWrapUICommand.cxx @@ -12,7 +12,7 @@ #include "cmQTWrapUICommand.h" // cmQTWrapUICommand -bool cmQTWrapUICommand::InitialPass(std::vector<std::string> const& argsIn, +bool cmQTWrapUICommand::InitialPass(std::vector<std::string> const& argsIn, cmExecutionStatus &) { if(argsIn.size() < 4 ) diff --git a/Source/cmQTWrapUICommand.h b/Source/cmQTWrapUICommand.h index 744ae98..1fff041 100644 --- a/Source/cmQTWrapUICommand.h +++ b/Source/cmQTWrapUICommand.h @@ -28,7 +28,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmQTWrapUICommand; } @@ -52,7 +52,7 @@ public: { return "Create Qt user interfaces Wrappers."; } - + /** * More documentation. */ diff --git a/Source/cmRemoveCommand.cxx b/Source/cmRemoveCommand.cxx index d80b3fe..bcb8564 100644 --- a/Source/cmRemoveCommand.cxx +++ b/Source/cmRemoveCommand.cxx @@ -30,13 +30,13 @@ bool cmRemoveCommand { return true; } - + // expand the variable std::vector<std::string> varArgsExpanded; cmSystemTools::ExpandListArgument(cacheValue, varArgsExpanded); - + // expand the args - // check for REMOVE(VAR v1 v2 ... vn) + // check for REMOVE(VAR v1 v2 ... vn) std::vector<std::string> argsExpanded; std::vector<std::string> temp; for(unsigned int j = 1; j < args.size(); ++j) @@ -44,7 +44,7 @@ bool cmRemoveCommand temp.push_back(args[j]); } cmSystemTools::ExpandList(temp, argsExpanded); - + // now create the new value std::string value; for(unsigned int j = 0; j < varArgsExpanded.size(); ++j) @@ -67,7 +67,7 @@ bool cmRemoveCommand value += varArgsExpanded[j]; } } - + // add the definition this->Makefile->AddDefinition(variable, value.c_str()); diff --git a/Source/cmRemoveCommand.h b/Source/cmRemoveCommand.h index c62d58f..5aedc26 100644 --- a/Source/cmRemoveCommand.h +++ b/Source/cmRemoveCommand.h @@ -25,7 +25,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmRemoveCommand; } @@ -46,7 +46,7 @@ public: * The name of the command as specified in CMakeList.txt. */ virtual const char* GetName() const {return "remove";} - + /** * Succinct documentation. */ @@ -54,7 +54,7 @@ public: { return "Deprecated. Use the list(REMOVE_ITEM ) command instead."; } - + /** * More documentation. */ @@ -66,13 +66,13 @@ public: "This is typically used to remove entries from a vector " "(e.g. semicolon separated list). VALUE is expanded."; } - + /** This command is kept for compatibility with older CMake versions. */ virtual bool IsDiscouraged() const { return true; } - + cmTypeMacro(cmRemoveCommand, cmCommand); }; diff --git a/Source/cmRemoveDefinitionsCommand.h b/Source/cmRemoveDefinitionsCommand.h index f0e906d..18f6171 100644 --- a/Source/cmRemoveDefinitionsCommand.h +++ b/Source/cmRemoveDefinitionsCommand.h @@ -17,9 +17,9 @@ /** \class cmRemoveDefinitionsCommand * \brief Specify a list of compiler defines * - * cmRemoveDefinitionsCommand specifies a list of compiler defines. + * cmRemoveDefinitionsCommand specifies a list of compiler defines. * These defines will - * be removed from the compile command. + * be removed from the compile command. */ class cmRemoveDefinitionsCommand : public cmCommand { @@ -27,7 +27,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmRemoveDefinitionsCommand; } @@ -43,7 +43,7 @@ public: * The name of the command as specified in CMakeList.txt. */ virtual const char* GetName() const {return "remove_definitions";} - + /** * Succinct documentation. */ @@ -51,7 +51,7 @@ public: { return "Removes -D define flags added by add_definitions."; } - + /** * More documentation. */ @@ -62,7 +62,7 @@ public: "Removes flags (added by add_definitions) from the compiler command " "line for sources in the current directory and below."; } - + cmTypeMacro(cmRemoveDefinitionsCommand, cmCommand); }; diff --git a/Source/cmReturnCommand.h b/Source/cmReturnCommand.h index 690ab79..a6e87ef 100644 --- a/Source/cmReturnCommand.h +++ b/Source/cmReturnCommand.h @@ -25,7 +25,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmReturnCommand; } @@ -46,7 +46,7 @@ public: * The name of the command as specified in CMakeList.txt. */ virtual const char* GetName() const {return "return";} - + /** * Succinct documentation. */ @@ -54,7 +54,7 @@ public: { return "Return from a file, directory or function."; } - + /** * More documentation. */ @@ -72,7 +72,7 @@ public: "of the function. Note that a macro " "is not a function and does not handle return like a function does."; } - + cmTypeMacro(cmReturnCommand, cmCommand); }; diff --git a/Source/cmSeparateArgumentsCommand.h b/Source/cmSeparateArgumentsCommand.h index 6a51a92..d62baf7 100644 --- a/Source/cmSeparateArgumentsCommand.h +++ b/Source/cmSeparateArgumentsCommand.h @@ -25,7 +25,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmSeparateArgumentsCommand; } @@ -46,16 +46,16 @@ public: * The name of the command as specified in CMakeList.txt. */ virtual const char* GetName() const {return "separate_arguments";} - + /** * Succinct documentation. */ virtual const char* GetTerseDocumentation() const { - return + return "Parse space-separated arguments into a semicolon-separated list."; } - + /** * More documentation. */ @@ -83,7 +83,7 @@ public: "All spaces are replaced with ';'. This helps with generating " "command lines."; } - + cmTypeMacro(cmSeparateArgumentsCommand, cmCommand); }; diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index d00fc86..20f38be 100644 --- a/Source/cmSetCommand.cxx +++ b/Source/cmSetCommand.cxx @@ -20,7 +20,7 @@ bool cmSetCommand this->SetError("called with incorrect number of arguments"); return false; } - + // watch for ENV signatures const char* variable = args[0].c_str(); // VAR is always first if (!strncmp(variable,"ENV{",4) && strlen(variable) > 5) @@ -31,7 +31,7 @@ bool cmSetCommand varName[strlen(variable)-5] = '\0'; std::string putEnvArg = varName; putEnvArg += "="; - + // what is the current value if any const char *currValue = getenv(varName); delete [] varName; @@ -47,7 +47,7 @@ bool cmSetCommand } return true; } - + // if it will be cleared, then clear it if it isn;t already clear if (currValue) { @@ -55,7 +55,7 @@ bool cmSetCommand } return true; } - + // SET (VAR) // Removes the definition of VAR. if (args.size() == 1) { @@ -63,7 +63,7 @@ bool cmSetCommand return true; } - // here are the remaining options + // here are the remaining options // SET (VAR value ) // SET (VAR CACHE TYPE "doc String" [FORCE]) // SET (VAR value CACHE TYPE "doc string" [FORCE]) @@ -71,10 +71,10 @@ bool cmSetCommand bool cache = false; // optional bool force = false; // optional bool parentScope = false; - cmCacheManager::CacheEntryType type + cmCacheManager::CacheEntryType type = cmCacheManager::STRING; // required if cache const char* docstring = 0; // required if cache - + unsigned int ignoreLastArgs = 0; // look for PARENT_SCOPE argument if (args.size() > 1 && args[args.size()-1] == "PARENT_SCOPE") @@ -136,7 +136,7 @@ bool cmSetCommand this->SetError("given invalid arguments for CACHE mode."); return false; } - + if(cache) { std::string::size_type cacheStart = args.size() - 3 - (force ? 1 : 0); @@ -145,7 +145,7 @@ bool cmSetCommand } // see if this is already in the cache - cmCacheManager::CacheIterator it = + cmCacheManager::CacheIterator it = this->Makefile->GetCacheManager()->GetCacheIterator(variable); if(!it.IsAtEnd() && (it.GetType() != cmCacheManager::UNINITIALIZED)) { @@ -158,7 +158,7 @@ bool cmSetCommand return true; } } - + // if it is meant to be in the cache then define it in the cache if(cache) { diff --git a/Source/cmSetCommand.h b/Source/cmSetCommand.h index 2dd80e3..fe1d58d 100644 --- a/Source/cmSetCommand.h +++ b/Source/cmSetCommand.h @@ -17,7 +17,7 @@ /** \class cmSetCommand * \brief Set a CMAKE variable * - * cmSetCommand sets a variable to a value with expansion. + * cmSetCommand sets a variable to a value with expansion. */ class cmSetCommand : public cmCommand { @@ -25,7 +25,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmSetCommand; } @@ -46,7 +46,7 @@ public: * The name of the command as specified in CMakeList.txt. */ virtual const char* GetName() const {return "set";} - + /** * Succinct documentation. */ @@ -54,7 +54,7 @@ public: { return "Set a CMake, cache or environment variable to a given value."; } - + /** * More documentation. */ @@ -154,7 +154,7 @@ public: "variable will use the value from the normal variable, which hides the " "cache variable."; } - + cmTypeMacro(cmSetCommand, cmCommand); }; diff --git a/Source/cmSetDirectoryPropertiesCommand.cxx b/Source/cmSetDirectoryPropertiesCommand.cxx index b956313..62c9b87 100644 --- a/Source/cmSetDirectoryPropertiesCommand.cxx +++ b/Source/cmSetDirectoryPropertiesCommand.cxx @@ -22,11 +22,11 @@ bool cmSetDirectoryPropertiesCommand this->SetError("called with incorrect number of arguments"); return false; } - + std::string errors; - bool ret = - cmSetDirectoryPropertiesCommand::RunCommand(this->Makefile, - args.begin() + 1, + bool ret = + cmSetDirectoryPropertiesCommand::RunCommand(this->Makefile, + args.begin() + 1, args.end(), errors); if (!ret) { @@ -52,19 +52,19 @@ bool cmSetDirectoryPropertiesCommand const std::string& value = *(ait+1); if ( prop == "VARIABLES" ) { - errors = + errors = "Variables and cache variables should be set using SET command"; return false; } else if ( prop == "MACROS" ) { - errors = + errors = "Commands and macros cannot be set using SET_CMAKE_PROPERTIES"; return false; } mf->SetProperty(prop.c_str(), value.c_str()); } - + return true; } diff --git a/Source/cmSetDirectoryPropertiesCommand.h b/Source/cmSetDirectoryPropertiesCommand.h index ee40158..8a50c60 100644 --- a/Source/cmSetDirectoryPropertiesCommand.h +++ b/Source/cmSetDirectoryPropertiesCommand.h @@ -17,7 +17,7 @@ class cmSetDirectoryPropertiesCommand : public cmCommand { public: - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmSetDirectoryPropertiesCommand; } @@ -46,7 +46,7 @@ public: { return "Set a property of the directory."; } - + /** * Static entry point for use by other commands */ @@ -69,7 +69,7 @@ public: "ADDITIONAL_MAKE_CLEAN_FILES is a list of files that will be cleaned " "as a part of \"make clean\" stage."; } - + cmTypeMacro(cmSetDirectoryPropertiesCommand, cmCommand); }; diff --git a/Source/cmSetSourceFilesPropertiesCommand.cxx b/Source/cmSetSourceFilesPropertiesCommand.cxx index 89ff4b1..619dfc5 100644 --- a/Source/cmSetSourceFilesPropertiesCommand.cxx +++ b/Source/cmSetSourceFilesPropertiesCommand.cxx @@ -40,14 +40,14 @@ bool cmSetSourceFilesPropertiesCommand ++j; } - // now call the worker function + // now call the worker function std::string errors; - bool ret = + bool ret = cmSetSourceFilesPropertiesCommand - ::RunCommand(this->Makefile, + ::RunCommand(this->Makefile, args.begin(), args.begin() + numFiles, - args.begin() + numFiles, + args.begin() + numFiles, args.end(), errors); if (!ret) { diff --git a/Source/cmSetSourceFilesPropertiesCommand.h b/Source/cmSetSourceFilesPropertiesCommand.h index 2a67bc0..f7009e7 100644 --- a/Source/cmSetSourceFilesPropertiesCommand.h +++ b/Source/cmSetSourceFilesPropertiesCommand.h @@ -17,7 +17,7 @@ class cmSetSourceFilesPropertiesCommand : public cmCommand { public: - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmSetSourceFilesPropertiesCommand; } @@ -41,7 +41,7 @@ public: { return "Source files can have properties that affect how they are built."; } - + /** * Longer documentation. */ @@ -58,7 +58,7 @@ public: "Source file properties are visible only to targets " "added in the same directory (CMakeLists.txt)."; } - + cmTypeMacro(cmSetSourceFilesPropertiesCommand, cmCommand); static bool RunCommand(cmMakefile *mf, diff --git a/Source/cmSetTargetPropertiesCommand.cxx b/Source/cmSetTargetPropertiesCommand.cxx index 45a305e..a2b50a8 100644 --- a/Source/cmSetTargetPropertiesCommand.cxx +++ b/Source/cmSetTargetPropertiesCommand.cxx @@ -67,11 +67,11 @@ bool cmSetTargetPropertiesCommand "a PROPERTIES specifier?"); return false; } - + // now loop over all the targets int i; for(i = 0; i < numFiles; ++i) - { + { bool ret = cmSetTargetPropertiesCommand::SetOneTarget (args[i].c_str(),propertyPairs,this->Makefile); if (!ret) @@ -86,7 +86,7 @@ bool cmSetTargetPropertiesCommand } bool cmSetTargetPropertiesCommand -::SetOneTarget(const char *tname, +::SetOneTarget(const char *tname, std::vector<std::string> &propertyPairs, cmMakefile *mf) { @@ -103,7 +103,7 @@ bool cmSetTargetPropertiesCommand } // if file is not already in the makefile, then add it else - { + { return false; } return true; diff --git a/Source/cmSetTargetPropertiesCommand.h b/Source/cmSetTargetPropertiesCommand.h index 1bc429c..e04f7eb 100644 --- a/Source/cmSetTargetPropertiesCommand.h +++ b/Source/cmSetTargetPropertiesCommand.h @@ -17,7 +17,7 @@ class cmSetTargetPropertiesCommand : public cmCommand { public: - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmSetTargetPropertiesCommand; } @@ -41,12 +41,12 @@ public: { return "Targets can have properties that affect how they are built."; } - + /** * Used by this command and cmSetPropertiesCommand */ - static bool SetOneTarget(const char *tname, - std::vector<std::string> &propertyPairs, + static bool SetOneTarget(const char *tname, + std::vector<std::string> &propertyPairs, cmMakefile *mf); /** @@ -159,7 +159,7 @@ public: "part of the default build when you select \"Build Solution\"." ; } - + cmTypeMacro(cmSetTargetPropertiesCommand, cmCommand); }; diff --git a/Source/cmSetTestsPropertiesCommand.cxx b/Source/cmSetTestsPropertiesCommand.cxx index e4fee18..3d52cf2 100644 --- a/Source/cmSetTestsPropertiesCommand.cxx +++ b/Source/cmSetTestsPropertiesCommand.cxx @@ -73,10 +73,10 @@ bool cmSetTestsPropertiesCommand // now loop over all the targets int i; for(i = 0; i < numFiles; ++i) - { + { std::string errors; - bool ret = - cmSetTestsPropertiesCommand::SetOneTest(args[i].c_str(), + bool ret = + cmSetTestsPropertiesCommand::SetOneTest(args[i].c_str(), propertyPairs, this->Makefile, errors); if (!ret) @@ -91,7 +91,7 @@ bool cmSetTestsPropertiesCommand bool cmSetTestsPropertiesCommand -::SetOneTest(const char *tname, +::SetOneTest(const char *tname, std::vector<std::string> &propertyPairs, cmMakefile *mf, std::string &errors) { @@ -106,11 +106,11 @@ bool cmSetTestsPropertiesCommand } } else - { + { errors = "Can not find test to add properties to: "; errors += tname; return false; - } + } return true; } diff --git a/Source/cmSetTestsPropertiesCommand.h b/Source/cmSetTestsPropertiesCommand.h index 10df17d..3a59218 100644 --- a/Source/cmSetTestsPropertiesCommand.h +++ b/Source/cmSetTestsPropertiesCommand.h @@ -17,7 +17,7 @@ class cmSetTestsPropertiesCommand : public cmCommand { public: - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmSetTestsPropertiesCommand; } @@ -70,7 +70,7 @@ public: cmTypeMacro(cmSetTestsPropertiesCommand, cmCommand); - static bool SetOneTest(const char *tname, + static bool SetOneTest(const char *tname, std::vector<std::string> &propertyPairs, cmMakefile *mf, std::string &errors); diff --git a/Source/cmSiteNameCommand.cxx b/Source/cmSiteNameCommand.cxx index 04e357c..2bdd1ad 100644 --- a/Source/cmSiteNameCommand.cxx +++ b/Source/cmSiteNameCommand.cxx @@ -29,25 +29,25 @@ bool cmSiteNameCommand paths.push_back("/bin"); paths.push_back("/sbin"); paths.push_back("/usr/local/bin"); - + const char* cacheValue = this->Makefile->GetDefinition(args[0].c_str()); if(cacheValue) { return true; } - + const char *temp = this->Makefile->GetDefinition("HOSTNAME"); std::string hostname_cmd; if(temp) { hostname_cmd = temp; } - else + else { hostname_cmd = cmSystemTools::FindProgram("hostname", paths); } - + std::string siteName = "unknown"; #if defined(_WIN32) && !defined(__CYGWIN__) std::string host; @@ -64,7 +64,7 @@ bool cmSiteNameCommand std::string host; cmSystemTools::RunSingleCommand(hostname_cmd.c_str(), &host, 0, 0, cmSystemTools::OUTPUT_NONE); - + // got the hostname if (host.length()) { diff --git a/Source/cmSiteNameCommand.h b/Source/cmSiteNameCommand.h index 532710c..52a63bc 100644 --- a/Source/cmSiteNameCommand.h +++ b/Source/cmSiteNameCommand.h @@ -25,7 +25,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmSiteNameCommand; } @@ -46,7 +46,7 @@ public: * The name of the command as specified in CMakeList.txt. */ virtual const char* GetName() const {return "site_name";} - + /** * Succinct documentation. */ @@ -54,7 +54,7 @@ public: { return "Set the given variable to the name of the computer."; } - + /** * More documentation. */ @@ -63,7 +63,7 @@ public: return " site_name(variable)\n"; } - + cmTypeMacro(cmSiteNameCommand, cmCommand); }; diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index cd94753..cc3b6d6 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -346,7 +346,7 @@ const char* cmSourceFile::GetProperty(const char* prop) const } bool chain = false; - const char *retVal = + const char *retVal = this->Properties.GetPropertyValue(prop, cmProperty::SOURCE_FILE, chain); if (chain) { @@ -354,7 +354,7 @@ const char* cmSourceFile::GetProperty(const char* prop) const return mf->GetProperty(prop,cmProperty::SOURCE_FILE); } - return retVal; + return retVal; } //---------------------------------------------------------------------------- @@ -388,7 +388,7 @@ void cmSourceFile::DefineProperties(cmake *cm) { // define properties cm->DefineProperty - ("ABSTRACT", cmProperty::SOURCE_FILE, + ("ABSTRACT", cmProperty::SOURCE_FILE, "Is this source file an abstract class.", "A property on a source file that indicates if the source file " "represents a class that is abstract. This only makes sense for " @@ -396,7 +396,7 @@ void cmSourceFile::DefineProperties(cmake *cm) "only used by some tools that wrap classes into other languages."); cm->DefineProperty - ("COMPILE_FLAGS", cmProperty::SOURCE_FILE, + ("COMPILE_FLAGS", cmProperty::SOURCE_FILE, "Additional flags to be added when compiling this source file.", "These flags will be added to the list of compile flags when " "this source file builds. Use COMPILE_DEFINITIONS to pass additional " @@ -430,7 +430,7 @@ void cmSourceFile::DefineProperties(cmake *cm) "be ignored by the Xcode generator."); cm->DefineProperty - ("EXTERNAL_OBJECT", cmProperty::SOURCE_FILE, + ("EXTERNAL_OBJECT", cmProperty::SOURCE_FILE, "If set to true then this is an object file.", "If this property is set to true then the source file " "is really an object file and should not be compiled. " @@ -446,14 +446,14 @@ void cmSourceFile::DefineProperties(cmake *cm) "source files in a target share the same format."); cm->DefineProperty - ("GENERATED", cmProperty::SOURCE_FILE, + ("GENERATED", cmProperty::SOURCE_FILE, "Is this source file generated as part of the build process.", "If a source file is generated by the build process CMake will " "handle it differently in terms of dependency checking etc. " "Otherwise having a non-existent source file could create problems."); cm->DefineProperty - ("HEADER_FILE_ONLY", cmProperty::SOURCE_FILE, + ("HEADER_FILE_ONLY", cmProperty::SOURCE_FILE, "Is this source file only a header file.", "A property on a source file that indicates if the source file " "is a header file with no associated implementation. This is " @@ -462,7 +462,7 @@ void cmSourceFile::DefineProperties(cmake *cm) "computed."); cm->DefineProperty - ("KEEP_EXTENSION", cmProperty::SOURCE_FILE, + ("KEEP_EXTENSION", cmProperty::SOURCE_FILE, "Make the output file have the same extension as the source file.", "If this property is set then the file extension of the output " "file will be the same as that of the source file. Normally " @@ -477,7 +477,7 @@ void cmSourceFile::DefineProperties(cmake *cm) "No other semantics are currently specified."); cm->DefineProperty - ("LANGUAGE", cmProperty::SOURCE_FILE, + ("LANGUAGE", cmProperty::SOURCE_FILE, "What programming language is the file.", "A property that can be set to indicate what programming language " "the source file is. If it is not set the language is determined " @@ -486,13 +486,13 @@ void cmSourceFile::DefineProperties(cmake *cm) "Do not set this for header or files that should not be compiled."); cm->DefineProperty - ("LOCATION", cmProperty::SOURCE_FILE, + ("LOCATION", cmProperty::SOURCE_FILE, "The full path to a source file.", "A read only property on a SOURCE FILE that contains the full path " "to the source file."); cm->DefineProperty - ("MACOSX_PACKAGE_LOCATION", cmProperty::SOURCE_FILE, + ("MACOSX_PACKAGE_LOCATION", cmProperty::SOURCE_FILE, "Place a source file inside a Mac OS X bundle, CFBundle, or framework.", "Executable targets with the MACOSX_BUNDLE property set are built " "as Mac OS X application bundles on Apple platforms. " @@ -531,7 +531,7 @@ void cmSourceFile::DefineProperties(cmake *cm) "command (if one does not already exist due to linking relationships)."); cm->DefineProperty - ("OBJECT_OUTPUTS", cmProperty::SOURCE_FILE, + ("OBJECT_OUTPUTS", cmProperty::SOURCE_FILE, "Additional outputs for a Makefile rule.", "Additional outputs created by compilation of this source file. " "If any of these outputs is missing the object will be recompiled. " @@ -539,14 +539,14 @@ void cmSourceFile::DefineProperties(cmake *cm) "on other generators."); cm->DefineProperty - ("SYMBOLIC", cmProperty::SOURCE_FILE, + ("SYMBOLIC", cmProperty::SOURCE_FILE, "Is this just a name for a rule.", "If SYMBOLIC (boolean) is set to true the build system will be " "informed that the source file is not actually created on disk but " "instead used as a symbolic name for a build rule."); - + cm->DefineProperty - ("WRAP_EXCLUDE", cmProperty::SOURCE_FILE, + ("WRAP_EXCLUDE", cmProperty::SOURCE_FILE, "Exclude this source file from any code wrapping techniques.", "Some packages can wrap source files into alternate languages " "to provide additional functionality. For example, C++ code " diff --git a/Source/cmSourceFile.h b/Source/cmSourceFile.h index ae01274..6c68b87 100644 --- a/Source/cmSourceFile.h +++ b/Source/cmSourceFile.h @@ -21,7 +21,7 @@ class cmake; /** \class cmSourceFile * \brief Represent a class loaded from a makefile. * - * cmSourceFile is represents a class loaded from + * cmSourceFile is represents a class loaded from * a makefile. */ class cmSourceFile diff --git a/Source/cmSourceGroup.cxx b/Source/cmSourceGroup.cxx index 2b34f2b..4fd9851 100644 --- a/Source/cmSourceGroup.cxx +++ b/Source/cmSourceGroup.cxx @@ -71,13 +71,13 @@ void cmSourceGroup::SetGroupRegex(const char* regex) this->GroupRegex.compile("^$"); } } - + //---------------------------------------------------------------------------- void cmSourceGroup::AddGroupFile(const char* name) { this->GroupFiles.insert(name); } - + //---------------------------------------------------------------------------- const char* cmSourceGroup::GetName() const { @@ -89,7 +89,7 @@ const char* cmSourceGroup::GetFullName() const { return this->FullName.c_str(); } - + //---------------------------------------------------------------------------- bool cmSourceGroup::MatchesRegex(const char* name) { @@ -137,12 +137,12 @@ cmSourceGroup *cmSourceGroup::lookupChild(const char* name) // st for(;iter!=end; ++iter) { - std::string sgName = iter->GetName(); + std::string sgName = iter->GetName(); // look if descenened is the one were looking for if(sgName == name) { - return &(*iter); // if it so return it + return &(*iter); // if it so return it } } diff --git a/Source/cmSourceGroup.h b/Source/cmSourceGroup.h index 641dcbd..11a0c74 100644 --- a/Source/cmSourceGroup.h +++ b/Source/cmSourceGroup.h @@ -37,12 +37,12 @@ public: cmSourceGroup(cmSourceGroup const& r); ~cmSourceGroup(); cmSourceGroup& operator=(cmSourceGroup const&); - + /** * Set the regular expression for this group. */ void SetGroupRegex(const char* regex); - + /** * Add a file name to the explicit list of files for this group. */ @@ -57,7 +57,7 @@ public: * Looks up child and returns it */ cmSourceGroup *lookupChild(const char *name); - + /** * Get the name of this group. */ @@ -67,12 +67,12 @@ public: * Get the full path name for group. */ const char* GetFullName() const; - + /** * Check if the given name matches this group's regex. */ bool MatchesRegex(const char* name); - + /** * Check if the given name matches this group's explicit file list. */ @@ -88,8 +88,8 @@ public: * Check if the given name matches this group's regex in children. */ cmSourceGroup *MatchChildrenRegex(const char *name); - - /** + + /** * Assign the given source file to this group. Used only by * generators. */ @@ -100,7 +100,7 @@ public: * source group. */ const std::vector<const cmSourceFile*>& GetSourceFiles() const; - + std::vector<cmSourceGroup> const& GetGroupChildren() const; private: /** @@ -109,17 +109,17 @@ private: std::string Name; // Full path to group std::string FullName; - + /** * The regular expression matching the files in the group. */ cmsys::RegularExpression GroupRegex; - + /** * Set of file names explicitly added to this group. */ std::set<cmStdString> GroupFiles; - + /** * Vector of all source files that have been assigned to * this group. diff --git a/Source/cmSourceGroupCommand.cxx b/Source/cmSourceGroupCommand.cxx index 8e61d0a..9cb80f6 100644 --- a/Source/cmSourceGroupCommand.cxx +++ b/Source/cmSourceGroupCommand.cxx @@ -19,7 +19,7 @@ bool cmSourceGroupCommand { this->SetError("called with incorrect number of arguments"); return false; - } + } std::string delimiter = "\\"; if(this->Makefile->GetDefinition("SOURCE_GROUP_DELIMITER")) @@ -29,7 +29,7 @@ bool cmSourceGroupCommand std::vector<std::string> folders = cmSystemTools::tokenize(args[0], delimiter); - + cmSourceGroup* sg = 0; sg = this->Makefile->GetSourceGroup(folders); if(!sg) @@ -50,7 +50,7 @@ bool cmSourceGroupCommand sg->SetGroupRegex(args[1].c_str()); return true; } - + // Process arguments. bool doingFiles = false; for(unsigned int i=1; i < args.size(); ++i) @@ -97,6 +97,6 @@ bool cmSourceGroupCommand return false; } } - + return true; } diff --git a/Source/cmSourceGroupCommand.h b/Source/cmSourceGroupCommand.h index 6a29fc8..6c87b71 100644 --- a/Source/cmSourceGroupCommand.h +++ b/Source/cmSourceGroupCommand.h @@ -26,7 +26,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmSourceGroupCommand; } @@ -37,7 +37,7 @@ public: */ virtual bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus &status); - + /** * The name of the command as specified in CMakeList.txt. */ @@ -50,7 +50,7 @@ public: { return "Define a grouping for sources in the makefile."; } - + /** * More documentation. */ @@ -72,7 +72,7 @@ public: "format:\n" " source_group(name regex)"; } - + cmTypeMacro(cmSourceGroupCommand, cmCommand); }; diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index ea299ca..a4aec2e 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -152,10 +152,10 @@ extern int putenv (char *__string) __THROW; // if std:: is not supported, then just #define it away #ifdef CMAKE_NO_STD_NAMESPACE -#define std +#define std #endif -// if the compiler does not support ansi for scoping of vars use a +// if the compiler does not support ansi for scoping of vars use a // #define hack #ifdef CMAKE_NO_ANSI_FOR_SCOPE #define for if(false) {} else for @@ -178,7 +178,7 @@ namespace std { typedef ios ios_base; } #endif #ifdef __DECCXX_VER -# if __DECCXX_VER <= 60390008 +# if __DECCXX_VER <= 60390008 # define CM_HAS_STD_BUT_NOT_FOR_IOSTREAM # endif #endif @@ -200,7 +200,7 @@ using ::cerr; using ::cin; using ::ifstream; using ::ofstream; - + #if !defined(CMAKE_NO_ANSI_STRING_STREAM) using ::ostringstream; using ::istringstream; @@ -208,7 +208,7 @@ using ::ofstream; using ::ostrstream; using ::istrstream; #endif - + using ::endl; using ::ends; using ::flush; @@ -324,8 +324,8 @@ struct cmDocumentationEntry std::string Full; cmDocumentationEntry(){}; cmDocumentationEntry(const char *doc[3]) - { if (doc[0]) this->Name = doc[0]; - if (doc[1]) this->Brief = doc[1]; + { if (doc[0]) this->Name = doc[0]; + if (doc[1]) this->Brief = doc[1]; if (doc[2]) this->Full = doc[2]; }; cmDocumentationEntry(const char *n, const char *b, const char *f) { if (n) this->Name = n; if (b) this->Brief = b; if (f) this->Full = f; }; @@ -353,7 +353,7 @@ public: # pragma reset woff 1375 /* base class destructor not virtual */ #endif -// All subclasses of cmCommand or cmCTestGenericHandler should +// All subclasses of cmCommand or cmCTestGenericHandler should // invoke this macro. #define cmTypeMacro(thisClass,superclass) \ virtual const char* GetNameOfClass() { return #thisClass; } \ diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index ec10d57..0193dc9 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -28,7 +28,7 @@ bool cmStringCommand this->SetError("must be called with at least one argument."); return false; } - + const std::string &subCommand = args[0]; if(subCommand == "REGEX") { @@ -134,11 +134,11 @@ bool cmStringCommand::HandleToUpperLowerCommand( std::string outvar = args[2]; std::string output; - if (toUpper) + if (toUpper) { output = cmSystemTools::UpperCase(args[1]); - } - else + } + else { output = cmSystemTools::LowerCase(args[1]); } @@ -266,7 +266,7 @@ bool cmStringCommand::HandleRegexCommand(std::vector<std::string> const& args) } return this->RegexReplace(args); } - + std::string e = "sub-command REGEX does not recognize mode "+mode; this->SetError(e.c_str()); return false; @@ -279,25 +279,25 @@ bool cmStringCommand::RegexMatch(std::vector<std::string> const& args) // <input> [<input>...])\n"; std::string regex = args[2]; std::string outvar = args[3]; - + // Concatenate all the last arguments together. std::string input = args[4]; for(unsigned int i=5; i < args.size(); ++i) { input += args[i]; } - + this->ClearMatches(this->Makefile); // Compile the regular expression. cmsys::RegularExpression re; if(!re.compile(regex.c_str())) { - std::string e = + std::string e = "sub-command REGEX, mode MATCH failed to compile regex \""+regex+"\"."; this->SetError(e.c_str()); return false; } - + // Scan through the input for all matches. std::string output; if(re.find(input.c_str())) @@ -307,7 +307,7 @@ bool cmStringCommand::RegexMatch(std::vector<std::string> const& args) std::string::size_type r = re.end(); if(r-l == 0) { - std::string e = + std::string e = "sub-command REGEX, mode MATCH regex \""+regex+ "\" matched an empty string."; this->SetError(e.c_str()); @@ -315,7 +315,7 @@ bool cmStringCommand::RegexMatch(std::vector<std::string> const& args) } output = input.substr(l, r-l); } - + // Store the output in the provided variable. this->Makefile->AddDefinition(outvar.c_str(), output.c_str()); return true; @@ -324,18 +324,18 @@ bool cmStringCommand::RegexMatch(std::vector<std::string> const& args) //---------------------------------------------------------------------------- bool cmStringCommand::RegexMatchAll(std::vector<std::string> const& args) { - //"STRING(REGEX MATCHALL <regular_expression> <output variable> <input> + //"STRING(REGEX MATCHALL <regular_expression> <output variable> <input> // [<input>...])\n"; std::string regex = args[2]; std::string outvar = args[3]; - + // Concatenate all the last arguments together. std::string input = args[4]; for(unsigned int i=5; i < args.size(); ++i) { input += args[i]; } - + this->ClearMatches(this->Makefile); // Compile the regular expression. cmsys::RegularExpression re; @@ -347,7 +347,7 @@ bool cmStringCommand::RegexMatchAll(std::vector<std::string> const& args) this->SetError(e.c_str()); return false; } - + // Scan through the input for all matches. std::string output; const char* p = input.c_str(); @@ -370,7 +370,7 @@ bool cmStringCommand::RegexMatchAll(std::vector<std::string> const& args) output += std::string(p+l, r-l); p += r; } - + // Store the output in the provided variable. this->Makefile->AddDefinition(outvar.c_str(), output.c_str()); return true; @@ -379,12 +379,12 @@ bool cmStringCommand::RegexMatchAll(std::vector<std::string> const& args) //---------------------------------------------------------------------------- bool cmStringCommand::RegexReplace(std::vector<std::string> const& args) { - //"STRING(REGEX REPLACE <regular_expression> <replace_expression> + //"STRING(REGEX REPLACE <regular_expression> <replace_expression> // <output variable> <input> [<input>...])\n" std::string regex = args[2]; - std::string replace = args[3]; + std::string replace = args[3]; std::string outvar = args[4]; - + // Pull apart the replace expression to find the escaped [0-9] values. std::vector<RegexReplacement> replacement; std::string::size_type l = 0; @@ -432,26 +432,26 @@ bool cmStringCommand::RegexReplace(std::vector<std::string> const& args) } l = r; } - + // Concatenate all the last arguments together. std::string input = args[5]; for(unsigned int i=6; i < args.size(); ++i) { input += args[i]; } - + this->ClearMatches(this->Makefile); // Compile the regular expression. cmsys::RegularExpression re; if(!re.compile(regex.c_str())) { - std::string e = + std::string e = "sub-command REGEX, mode REPLACE failed to compile regex \""+ regex+"\"."; this->SetError(e.c_str()); return false; } - + // Scan through the input for all matches. std::string output; std::string::size_type base = 0; @@ -460,10 +460,10 @@ bool cmStringCommand::RegexReplace(std::vector<std::string> const& args) this->StoreMatches(this->Makefile, re); std::string::size_type l2 = re.start(); std::string::size_type r = re.end(); - + // Concatenate the part of the input that was not matched. output += input.substr(base, l2); - + // Make sure the match had some text. if(r-l2 == 0) { @@ -472,7 +472,7 @@ bool cmStringCommand::RegexReplace(std::vector<std::string> const& args) this->SetError(e.c_str()); return false; } - + // Concatenate the replacement for the match. for(unsigned int i=0; i < replacement.size(); ++i) { @@ -504,14 +504,14 @@ bool cmStringCommand::RegexReplace(std::vector<std::string> const& args) } } } - + // Move past the match. base += r; } - + // Concatenate the text after the last match. output += input.substr(base, input.length()-base); - + // Store the output in the provided variable. this->Makefile->AddDefinition(outvar.c_str(), output.c_str()); return true; @@ -624,9 +624,9 @@ bool cmStringCommand::HandleCompareCommand(std::vector<std::string> const& this->SetError(e.c_str()); return false; } - + const std::string& left = args[2]; - const std::string& right = args[3]; + const std::string& right = args[3]; const std::string& outvar = args[4]; bool result; if(mode == "LESS") @@ -654,7 +654,7 @@ bool cmStringCommand::HandleCompareCommand(std::vector<std::string> const& this->Makefile->AddDefinition(outvar.c_str(), "0"); } return true; - } + } std::string e = "sub-command COMPARE does not recognize mode "+mode; this->SetError(e.c_str()); return false; @@ -680,7 +680,7 @@ bool cmStringCommand::HandleReplaceCommand(std::vector<std::string> const& input += args[i]; } - cmsys::SystemTools::ReplaceString(input, matchExpression.c_str(), + cmsys::SystemTools::ReplaceString(input, matchExpression.c_str(), replaceExpression.c_str()); this->Makefile->AddDefinition(variableName.c_str(), input.c_str()); @@ -688,7 +688,7 @@ bool cmStringCommand::HandleReplaceCommand(std::vector<std::string> const& } //---------------------------------------------------------------------------- -bool cmStringCommand::HandleSubstringCommand(std::vector<std::string> const& +bool cmStringCommand::HandleSubstringCommand(std::vector<std::string> const& args) { if(args.size() != 5) @@ -722,7 +722,7 @@ bool cmStringCommand::HandleSubstringCommand(std::vector<std::string> const& return false; } - this->Makefile->AddDefinition(variableName.c_str(), + this->Makefile->AddDefinition(variableName.c_str(), stringValue.substr(begin, end).c_str()); return true; } @@ -780,7 +780,7 @@ bool cmStringCommand::HandleStripCommand( size_t outLength = 0; - // if the input string didn't contain any non-space characters, return + // if the input string didn't contain any non-space characters, return // an empty string if (startPos > inStringLength) { diff --git a/Source/cmStringCommand.h b/Source/cmStringCommand.h index 3e585a5..43a0dbe 100644 --- a/Source/cmStringCommand.h +++ b/Source/cmStringCommand.h @@ -30,7 +30,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmStringCommand; } @@ -59,7 +59,7 @@ public: { return "String operations."; } - + /** * More documentation. */ @@ -143,7 +143,7 @@ public: " by all regular expression-related commands, including \n" " e.g. if( MATCHES ), in the variables CMAKE_MATCH_(0..9)."; } - + cmTypeMacro(cmStringCommand, cmCommand); static void ClearMatches(cmMakefile* mf); static void StoreMatches(cmMakefile* mf, cmsys::RegularExpression& re); diff --git a/Source/cmSubdirCommand.cxx b/Source/cmSubdirCommand.cxx index 9fcbe77..0cfe772 100644 --- a/Source/cmSubdirCommand.cxx +++ b/Source/cmSubdirCommand.cxx @@ -39,13 +39,13 @@ bool cmSubdirCommand } // if they specified a relative path then compute the full - std::string srcPath = - std::string(this->Makefile->GetCurrentDirectory()) + + std::string srcPath = + std::string(this->Makefile->GetCurrentDirectory()) + "/" + i->c_str(); if (cmSystemTools::FileIsDirectory(srcPath.c_str())) { - std::string binPath = - std::string(this->Makefile->GetCurrentOutputDirectory()) + + std::string binPath = + std::string(this->Makefile->GetCurrentOutputDirectory()) + "/" + i->c_str(); this->Makefile->AddSubDirectory(srcPath.c_str(), binPath.c_str(), excludeFromAll, preorder, false); @@ -55,8 +55,8 @@ bool cmSubdirCommand { // we must compute the binPath from the srcPath, we just take the last // element from the source path and use that - std::string binPath = - std::string(this->Makefile->GetCurrentOutputDirectory()) + + std::string binPath = + std::string(this->Makefile->GetCurrentOutputDirectory()) + "/" + cmSystemTools::GetFilenameName(i->c_str()); this->Makefile->AddSubDirectory(i->c_str(), binPath.c_str(), excludeFromAll, preorder, false); @@ -65,7 +65,7 @@ bool cmSubdirCommand { std::string error = "Incorrect SUBDIRS command. Directory: "; error += *i + " does not exists."; - this->SetError(error.c_str()); + this->SetError(error.c_str()); res = false; } } diff --git a/Source/cmSubdirCommand.h b/Source/cmSubdirCommand.h index eedbfff..618d5ff 100644 --- a/Source/cmSubdirCommand.h +++ b/Source/cmSubdirCommand.h @@ -27,7 +27,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmSubdirCommand; } @@ -51,7 +51,7 @@ public: { return "Deprecated. Use the add_subdirectory() command instead."; } - + /** * More documentation. */ @@ -68,7 +68,7 @@ public: "This will cause any CMakeLists.txt files in the sub directories " "to be processed by CMake. Any directories after the PREORDER flag " "are traversed first by makefile builds, the PREORDER flag has no " - "effect on IDE projects. " + "effect on IDE projects. " " Any directories after the EXCLUDE_FROM_ALL marker " "will not be included in the top level makefile or project file. " "This is useful for having CMake create makefiles or projects for " @@ -77,7 +77,7 @@ public: "the same time, but you would not want them to show up in the " "top level project or be built each time make is run from the top."; } - + /** This command is kept for compatibility with older CMake versions. */ virtual bool IsDiscouraged() const { diff --git a/Source/cmSubdirDependsCommand.h b/Source/cmSubdirDependsCommand.h index daf97cd..b274d01 100644 --- a/Source/cmSubdirDependsCommand.h +++ b/Source/cmSubdirDependsCommand.h @@ -27,7 +27,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmSubdirDependsCommand; } @@ -51,7 +51,7 @@ public: { return "Deprecated. Does nothing."; } - + /** * More documentation. */ @@ -62,7 +62,7 @@ public: "Does not do anything. This command used to help projects order " "parallel builds correctly. This functionality is now automatic."; } - + /** This command is kept for compatibility with older CMake versions. */ virtual bool IsDiscouraged() const { diff --git a/Source/cmTest.cxx b/Source/cmTest.cxx index 502c174..912ec76 100644 --- a/Source/cmTest.cxx +++ b/Source/cmTest.cxx @@ -57,7 +57,7 @@ void cmTest::SetCommand(std::vector<std::string> const& command) const char *cmTest::GetProperty(const char* prop) const { bool chain = false; - const char *retVal = + const char *retVal = this->Properties.GetPropertyValue(prop, cmProperty::TEST, chain); if (chain) { @@ -149,14 +149,14 @@ void cmTest::DefineProperties(cmake *cm) "not to run concurrently."); cm->DefineProperty - ("MEASUREMENT", cmProperty::TEST, + ("MEASUREMENT", cmProperty::TEST, "Specify a CDASH measurement and value to be reported for a test.", "If set to a name then that name will be reported to CDASH as a " "named measurement with a value of 1. You may also specify a value " "by setting MEASUREMENT to \"measurement=value\"."); cm->DefineProperty - ("PASS_REGULAR_EXPRESSION", cmProperty::TEST, + ("PASS_REGULAR_EXPRESSION", cmProperty::TEST, "The output must match this regular expression for the test to pass.", "If set, the test output will be checked " "against the specified regular expressions and at least one of the" @@ -183,7 +183,7 @@ void cmTest::DefineProperties(cmake *cm) "any other tests."); cm->DefineProperty - ("TIMEOUT", cmProperty::TEST, + ("TIMEOUT", cmProperty::TEST, "How many seconds to allow for this test.", "This property if set will limit a test to not take more than " "the specified number of seconds to run. If it exceeds that the " @@ -192,7 +192,7 @@ void cmTest::DefineProperties(cmake *cm) "CTEST_TESTING_TIMEOUT."); cm->DefineProperty - ("WILL_FAIL", cmProperty::TEST, + ("WILL_FAIL", cmProperty::TEST, "If set to true, this will invert the pass/fail flag of the test.", "This property can be used for tests that are expected to fail and " "return a non zero return code."); diff --git a/Source/cmTest.h b/Source/cmTest.h index 6223a01..73ac133 100644 --- a/Source/cmTest.h +++ b/Source/cmTest.h @@ -51,7 +51,7 @@ public: const char *GetProperty(const char *prop) const; bool GetPropertyAsBool(const char *prop) const; cmPropertyMap &GetProperties() { return this->Properties; }; - + // Define the properties static void DefineProperties(cmake *cm); diff --git a/Source/cmTryRunCommand.h b/Source/cmTryRunCommand.h index 06a9118..7878729 100644 --- a/Source/cmTryRunCommand.h +++ b/Source/cmTryRunCommand.h @@ -25,7 +25,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmTryRunCommand; } @@ -49,7 +49,7 @@ public: { return "Try compiling and then running some code."; } - + /** * More documentation. */ @@ -101,10 +101,10 @@ public: cmTypeMacro(cmTryRunCommand, cmCoreTryCompile); private: - void RunExecutable(const std::string& runArgs, + void RunExecutable(const std::string& runArgs, std::string* runOutputContents); - void DoNotRunExecutable(const std::string& runArgs, - const std::string& srcFile, + void DoNotRunExecutable(const std::string& runArgs, + const std::string& srcFile, std::string* runOutputContents); std::string CompileResultVariable; diff --git a/Source/cmUseMangledMesaCommand.cxx b/Source/cmUseMangledMesaCommand.cxx index 0e6f28a..4c189e6 100644 --- a/Source/cmUseMangledMesaCommand.cxx +++ b/Source/cmUseMangledMesaCommand.cxx @@ -17,7 +17,7 @@ // cmUseMangledMesaCommand bool cmUseMangledMesaCommand ::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &) -{ +{ // expected two arguments: // arguement one: the full path to gl_mangle.h // arguement two : directory for output of edited headers @@ -55,11 +55,11 @@ bool cmUseMangledMesaCommand path += *i; this->CopyAndFullPathMesaHeader(path.c_str(), destDir); } - + return true; } -void +void cmUseMangledMesaCommand:: CopyAndFullPathMesaHeader(const char* source, const char* outdir) @@ -74,7 +74,7 @@ CopyAndFullPathMesaHeader(const char* source, std::ofstream fout(tempOutputFile.c_str()); if(!fout) { - cmSystemTools::Error("Could not open file for write in copy operation: ", + cmSystemTools::Error("Could not open file for write in copy operation: ", tempOutputFile.c_str(), outdir); cmSystemTools::ReportLastSystemError(""); return; @@ -88,7 +88,7 @@ CopyAndFullPathMesaHeader(const char* source, } // now copy input to output and expand variables in the // input file at the same time - std::string inLine; + std::string inLine; // regular expression for any #include line cmsys::RegularExpression includeLine( "^[ \t]*#[ \t]*include[ \t]*[<\"]([^\">]+)[\">]"); @@ -108,7 +108,7 @@ CopyAndFullPathMesaHeader(const char* source, } else if(glLine.find(includeFile.c_str())) { - fout << "#include \"" << outdir << "/" << + fout << "#include \"" << outdir << "/" << includeLine.match(1).c_str() << "\"\n"; } else diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx index 41c82c2..6ea3dfa 100644 --- a/Source/cmUtilitySourceCommand.cxx +++ b/Source/cmUtilitySourceCommand.cxx @@ -22,7 +22,7 @@ bool cmUtilitySourceCommand } std::vector<std::string>::const_iterator arg = args.begin(); - + // The first argument is the cache entry name. std::string cacheEntry = *arg++; const char* cacheValue = @@ -30,7 +30,7 @@ bool cmUtilitySourceCommand // If it exists already and appears up to date then we are done. If // the string contains "(IntDir)" but that is not the // CMAKE_CFG_INTDIR setting then the value is out of date. - const char* intDir = + const char* intDir = this->Makefile->GetRequiredDefinition("CMAKE_CFG_INTDIR"); bool haveCacheValue = false; @@ -60,21 +60,21 @@ bool cmUtilitySourceCommand { return true; } - + // The second argument is the utility's executable name, which will be // needed later. std::string utilityName = *arg++; - + // The third argument specifies the relative directory of the source // of the utility. std::string relativeSource = *arg++; std::string utilitySource = this->Makefile->GetCurrentDirectory(); utilitySource = utilitySource+"/"+relativeSource; - + // If the directory doesn't exist, the source has not been included. if(!cmSystemTools::FileExists(utilitySource.c_str())) { return true; } - + // Make sure all the files exist in the source directory. while(arg != args.end()) { @@ -82,9 +82,9 @@ bool cmUtilitySourceCommand if(!cmSystemTools::FileExists(file.c_str())) { return true; } } - + // The source exists. - std::string cmakeCFGout = + std::string cmakeCFGout = this->Makefile->GetRequiredDefinition("CMAKE_CFG_INTDIR"); std::string utilityDirectory = this->Makefile->GetCurrentOutputDirectory(); std::string exePath; @@ -100,7 +100,7 @@ bool cmUtilitySourceCommand { utilityDirectory += "/"+relativeSource; } - + // Construct the cache entry for the executable's location. std::string utilityExecutable = utilityDirectory+"/"+cmakeCFGout+"/" @@ -108,7 +108,7 @@ bool cmUtilitySourceCommand // make sure we remove any /./ in the name cmSystemTools::ReplaceString(utilityExecutable, "/./", "/"); - + // Enter the value into the cache. this->Makefile->AddCacheDefinition(cacheEntry.c_str(), utilityExecutable.c_str(), @@ -121,7 +121,7 @@ bool cmUtilitySourceCommand utilityName.c_str(), "Executable to project name.", cmCacheManager::INTERNAL); - + return true; } diff --git a/Source/cmUtilitySourceCommand.h b/Source/cmUtilitySourceCommand.h index 32afdda..195f605 100644 --- a/Source/cmUtilitySourceCommand.h +++ b/Source/cmUtilitySourceCommand.h @@ -29,7 +29,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmUtilitySourceCommand; } @@ -53,7 +53,7 @@ public: { return "Specify the source tree of a third-party utility."; } - + /** * More documentation. */ diff --git a/Source/cmVariableRequiresCommand.cxx b/Source/cmVariableRequiresCommand.cxx index 0e97a83..747e9be 100644 --- a/Source/cmVariableRequiresCommand.cxx +++ b/Source/cmVariableRequiresCommand.cxx @@ -22,7 +22,7 @@ bool cmVariableRequiresCommand return false; } - std::string testVariable = args[0]; + std::string testVariable = args[0]; if(!this->Makefile->IsOn(testVariable.c_str())) { return true; @@ -38,7 +38,7 @@ bool cmVariableRequiresCommand requirementsMet = false; notSet += args[i]; notSet += "\n"; - cmCacheManager::CacheIterator it = + cmCacheManager::CacheIterator it = this->Makefile->GetCacheManager()->GetCacheIterator(args[i].c_str()); if(!it.IsAtEnd() && it.GetPropertyAsBool("ADVANCED")) { @@ -47,7 +47,7 @@ bool cmVariableRequiresCommand } } const char* reqVar = this->Makefile->GetDefinition(resultVariable.c_str()); - // if reqVar is unset, then set it to requirementsMet + // if reqVar is unset, then set it to requirementsMet // if reqVar is set to true, but requirementsMet is false , then // set reqVar to false. if(!reqVar || (!requirementsMet && this->Makefile->IsOn(reqVar))) @@ -58,14 +58,14 @@ bool cmVariableRequiresCommand if(!requirementsMet) { std::string message = "Variable assertion failed:\n"; - message += testVariable + + message += testVariable + " Requires that the following unset variables are set:\n"; message += notSet; message += "\nPlease set them, or set "; message += testVariable + " to false, and re-configure.\n"; if(hasAdvanced) { - message += + message += "One or more of the required variables is advanced." " To set the variable, you must turn on advanced mode in cmake."; } diff --git a/Source/cmVariableRequiresCommand.h b/Source/cmVariableRequiresCommand.h index 91c351e..c86f43d 100644 --- a/Source/cmVariableRequiresCommand.h +++ b/Source/cmVariableRequiresCommand.h @@ -24,7 +24,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmVariableRequiresCommand; } @@ -35,7 +35,7 @@ public: */ virtual bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus &status); - + /** * The name of the command as specified in CMakeList.txt. */ @@ -48,7 +48,7 @@ public: { return "Deprecated. Use the if() command instead."; } - + /** * More documentation. */ @@ -63,12 +63,12 @@ public: "tested, if that variable is false nothing else is done. If " "TEST_VARIABLE is true, then " "the next argument (RESULT_VARIABLE) is a variable that is set to true " - "if all the required variables are set. " + "if all the required variables are set. " "The rest of the arguments are variables that must be true or not " "set to NOTFOUND to avoid an error. If any are not true, an error " "is reported."; } - + /** This command is kept for compatibility with older CMake versions. */ virtual bool IsDiscouraged() const { diff --git a/Source/cmVariableWatch.cxx b/Source/cmVariableWatch.cxx index 47bab15..f5fdca4 100644 --- a/Source/cmVariableWatch.cxx +++ b/Source/cmVariableWatch.cxx @@ -38,7 +38,7 @@ cmVariableWatch::~cmVariableWatch() { } -void cmVariableWatch::AddWatch(const std::string& variable, +void cmVariableWatch::AddWatch(const std::string& variable, WatchMethod method, void* client_data /*=0*/) { cmVariableWatch::Pair p; @@ -58,7 +58,7 @@ void cmVariableWatch::AddWatch(const std::string& variable, vp->push_back(p); } -void cmVariableWatch::RemoveWatch(const std::string& variable, +void cmVariableWatch::RemoveWatch(const std::string& variable, WatchMethod method) { cmVariableWatch::VectorOfPairs* vp = &this->WatchMap[variable]; @@ -73,12 +73,12 @@ void cmVariableWatch::RemoveWatch(const std::string& variable, } } -void cmVariableWatch::VariableAccessed(const std::string& variable, +void cmVariableWatch::VariableAccessed(const std::string& variable, int access_type, const char* newValue, const cmMakefile* mf) const { - cmVariableWatch::StringToVectorOfPairs::const_iterator mit = + cmVariableWatch::StringToVectorOfPairs::const_iterator mit = this->WatchMap.find(variable); if ( mit != this->WatchMap.end() ) { diff --git a/Source/cmVariableWatch.h b/Source/cmVariableWatch.h index 83e9e97..7dd4ac5 100644 --- a/Source/cmVariableWatch.h +++ b/Source/cmVariableWatch.h @@ -36,7 +36,7 @@ public: void AddWatch(const std::string& variable, WatchMethod method, void* client_data=0); void RemoveWatch(const std::string& variable, WatchMethod method); - + /** * This method is called when variable is accessed */ @@ -61,7 +61,7 @@ public: * Return the access as string */ static const char* GetAccessAsString(int access_type); - + protected: struct Pair { diff --git a/Source/cmVariableWatchCommand.cxx b/Source/cmVariableWatchCommand.cxx index 93c05af..a432943 100644 --- a/Source/cmVariableWatchCommand.cxx +++ b/Source/cmVariableWatchCommand.cxx @@ -95,7 +95,7 @@ void cmVariableWatchCommand::VariableAccessed(const std::string& variable, cmListFileArgument(currentListFile, true, "unknown", 9999)); newLFF.Arguments.push_back( cmListFileArgument(stack, true, "unknown", 9999)); - newLFF.Name = command; + newLFF.Name = command; newLFF.FilePath = "Some weird path"; newLFF.Line = 9999; cmExecutionStatus status; diff --git a/Source/cmVariableWatchCommand.h b/Source/cmVariableWatchCommand.h index cb80736..3abc088 100644 --- a/Source/cmVariableWatchCommand.h +++ b/Source/cmVariableWatchCommand.h @@ -31,7 +31,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmVariableWatchCommand; } @@ -67,7 +67,7 @@ public: { return "Watch the CMake variable for change."; } - + /** * More documentation. */ @@ -80,7 +80,7 @@ public: "will be executed. The command will receive the following arguments:" " COMMAND(<variable> <access> <value> <current list file> <stack>)"; } - + cmTypeMacro(cmVariableWatchCommand, cmCommand); void VariableAccessed(const std::string& variable, int access_type, diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 9a97ab0..53b6a9b 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -65,7 +65,7 @@ cmVisualStudio10TargetGenerator(cmTarget* target, this->Target = target; this->GeneratorTarget = gg->GetGeneratorTarget(target); this->Makefile = target->GetMakefile(); - this->LocalGenerator = + this->LocalGenerator = (cmLocalVisualStudio7Generator*) this->Makefile->GetLocalGenerator(); this->Name = this->Target->GetName(); @@ -108,9 +108,9 @@ void cmVisualStudio10TargetGenerator::WritePlatformConfigTag( stream = this->BuildFileStream; } stream->fill(' '); - stream->width(indentLevel*2 ); + stream->width(indentLevel*2 ); (*stream ) << ""; - (*stream ) << "<" << tag + (*stream ) << "<" << tag << " Condition=\"'$(Configuration)|$(Platform)'=='"; (*stream ) << config << "|" << this->Platform << "'\""; if(attribute) @@ -164,7 +164,7 @@ void cmVisualStudio10TargetGenerator::Generate() new cmGeneratedFileStream(path.c_str()); this->PathToVcxproj = path; this->BuildFileStream->SetCopyIfDifferent(true); - + // Write the encoding header into the file char magic[] = {0xEF,0xBB, 0xBF}; this->BuildFileStream->write(magic, 3); @@ -370,9 +370,9 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues() break; } configType += "</ConfigurationType>\n"; - this->WriteString(configType.c_str(), 2); + this->WriteString(configType.c_str(), 2); - const char* mfcFlag = + const char* mfcFlag = this->Target->GetMakefile()->GetDefinition("CMAKE_MFC_FLAG"); std::string mfcFlagValue = mfcFlag ? mfcFlag : "0"; @@ -453,9 +453,9 @@ void cmVisualStudio10TargetGenerator::WriteCustomCommand(cmSourceFile* sf) } } -void +void cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile* source, - cmCustomCommand const & + cmCustomCommand const & command) { std::string sourcePath = source->GetFullPath(); @@ -490,7 +490,7 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile* source, comment = cmVS10EscapeComment(comment); std::vector<std::string> *configs = static_cast<cmGlobalVisualStudio7Generator *> - (this->GlobalGenerator)->GetConfigurations(); + (this->GlobalGenerator)->GetConfigurations(); this->WriteSource("CustomBuild", source, ">\n"); @@ -504,11 +504,11 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile* source, this->WritePlatformConfigTag("Command", i->c_str(), 3); (*this->BuildFileStream ) << script << "</Command>\n"; this->WritePlatformConfigTag("AdditionalInputs", i->c_str(), 3); - + (*this->BuildFileStream ) << source->GetFullPath(); - for(std::vector<std::string>::const_iterator d = + for(std::vector<std::string>::const_iterator d = command.GetDepends().begin(); - d != command.GetDepends().end(); + d != command.GetDepends().end(); ++d) { std::string dep; @@ -521,9 +521,9 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile* source, (*this->BuildFileStream ) << ";%(AdditionalInputs)</AdditionalInputs>\n"; this->WritePlatformConfigTag("Outputs", i->c_str(), 3); const char* sep = ""; - for(std::vector<std::string>::const_iterator o = + for(std::vector<std::string>::const_iterator o = command.GetOutputs().begin(); - o != command.GetOutputs().end(); + o != command.GetOutputs().end(); ++o) { std::string out = *o; @@ -559,19 +559,19 @@ void cmVisualStudio10TargetGenerator::ConvertToWindowsSlash(std::string& s) } } void cmVisualStudio10TargetGenerator::WriteGroups() -{ +{ // collect up group information - std::vector<cmSourceGroup> sourceGroups = + std::vector<cmSourceGroup> sourceGroups = this->Makefile->GetSourceGroups(); std::vector<cmSourceFile*> classes = this->Target->GetSourceFiles(); - + std::set<cmSourceGroup*> groupsUsed; - for(std::vector<cmSourceFile*>::const_iterator s = classes.begin(); + for(std::vector<cmSourceFile*>::const_iterator s = classes.begin(); s != classes.end(); s++) { - cmSourceFile* sf = *s; + cmSourceFile* sf = *s; std::string const& source = sf->GetFullPath(); - cmSourceGroup& sourceGroup = + cmSourceGroup& sourceGroup = this->Makefile->FindSourceGroup(source.c_str(), sourceGroups); groupsUsed.insert(&sourceGroup); } @@ -634,9 +634,9 @@ void cmVisualStudio10TargetGenerator::WriteGroups() guidName += name; this->GlobalGenerator->CreateGUID(guidName.c_str()); this->WriteString("<UniqueIdentifier>", 3); - std::string guid + std::string guid = this->GlobalGenerator->GetGUID(guidName.c_str()); - (*this->BuildFileStream) + (*this->BuildFileStream) << "{" << guid << "}" << "</UniqueIdentifier>\n"; @@ -724,10 +724,10 @@ WriteGroupSources(const char* name, { cmSourceFile* sf = s->SourceFile; std::string const& source = sf->GetFullPath(); - cmSourceGroup& sourceGroup = + cmSourceGroup& sourceGroup = this->Makefile->FindSourceGroup(source.c_str(), sourceGroups); const char* filter = sourceGroup.GetFullName(); - this->WriteString("<", 2); + this->WriteString("<", 2); std::string path = this->ConvertPath(source, s->RelativePath); this->ConvertToWindowsSlash(path); (*this->BuildFileStream) << name << " Include=\"" @@ -868,7 +868,7 @@ void cmVisualStudio10TargetGenerator::WriteAllSources() bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( cmSourceFile* source) -{ +{ cmSourceFile& sf = *source; cmLocalVisualStudio7Generator* lg = this->LocalGenerator; @@ -883,7 +883,7 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( if(const char* cflags = sf.GetProperty("COMPILE_FLAGS")) { flags += cflags; - } + } if(const char* cdefs = sf.GetProperty("COMPILE_DEFINITIONS")) { defines += cdefs; @@ -899,7 +899,7 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( { needForceLang = true; lang = sourceLang; - } + } // if the source file does not match the linker language // then force c or c++ if(needForceLang || (linkLanguage && lang @@ -923,7 +923,7 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( if(objectName.size()) { (*this->BuildFileStream ) << firstString; - firstString = ""; + firstString = ""; hasFlags = true; this->WriteString("<ObjectFileName>", 3); (*this->BuildFileStream ) @@ -934,7 +934,7 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( (this->GlobalGenerator)->GetConfigurations(); for( std::vector<std::string>::iterator config = configs->begin(); config != configs->end(); ++config) - { + { std::string configUpper = cmSystemTools::UpperCase(*config); std::string configDefines = defines; std::string defPropName = "COMPILE_DEFINITIONS_"; @@ -947,14 +947,14 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( } configDefines += ccdefs; } - // if we have flags or defines for this config then + // if we have flags or defines for this config then // use them if(flags.size() || configDefines.size()) { (*this->BuildFileStream ) << firstString; firstString = ""; // only do firstString once hasFlags = true; - cmVisualStudioGeneratorOptions + cmVisualStudioGeneratorOptions clOptions(this->LocalGenerator, cmVisualStudioGeneratorOptions::Compiler, cmVS10CLFlagTable, 0, this); @@ -962,7 +962,7 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( clOptions.AddDefines(configDefines.c_str()); clOptions.SetConfiguration((*config).c_str()); clOptions.OutputAdditionalOptions(*this->BuildFileStream, " ", ""); - clOptions.OutputFlagMap(*this->BuildFileStream, " "); + clOptions.OutputFlagMap(*this->BuildFileStream, " "); clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream, " ", "\n", lang); } @@ -1045,10 +1045,10 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions() -void +void cmVisualStudio10TargetGenerator:: OutputLinkIncremental(std::string const& configName) -{ +{ std::string CONFIG = cmSystemTools::UpperCase(configName); // static libraries and things greater than modules do not need // to set this option @@ -1062,7 +1062,7 @@ OutputLinkIncremental(std::string const& configName) { linkType = "EXE"; } - + // assume incremental linking const char* incremental = "true"; const char* linkLanguage = @@ -1091,9 +1091,9 @@ OutputLinkIncremental(std::string const& configName) flags += this-> Target->GetMakefile()->GetRequiredDefinition(baseFlagVar.c_str()); std::string flagVar = baseFlagVar + std::string("_") + CONFIG; - flags += + flags += Target->GetMakefile()->GetRequiredDefinition(flagVar.c_str()); - } + } const char* targetLinkFlags = this->Target->GetProperty("LINK_FLAGS"); if(targetLinkFlags) { @@ -1113,7 +1113,7 @@ OutputLinkIncremental(std::string const& configName) } this->WritePlatformConfigTag("LinkIncremental", configName.c_str(), 3); *this->BuildFileStream << incremental - << "</LinkIncremental>\n"; + << "</LinkIncremental>\n"; const char* manifest = "true"; if(flags.find("MANIFEST:NO") != flags.npos) @@ -1155,7 +1155,7 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions( Options& clOptions = *pOptions; std::string flags; - // collect up flags for + // collect up flags for if(this->Target->GetType() < cmTarget::UTILITY) { const char* linkLanguage = @@ -1247,10 +1247,10 @@ void cmVisualStudio10TargetGenerator::WriteClOptions( "</DebugInformationFormat>\n", 3); } - clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream, " ", + clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream, " ", "\n", "CXX"); this->WriteString("<AssemblerListingLocation>", 3); - *this->BuildFileStream << configName + *this->BuildFileStream << configName << "</AssemblerListingLocation>\n"; this->WriteString("<ObjectFileName>$(IntDir)</ObjectFileName>\n", 3); if(this->Target->GetType() != cmTarget::OBJECT_LIBRARY) @@ -1277,7 +1277,7 @@ OutputIncludes(std::vector<std::string> const & includes) this->WriteString("%(AdditionalIncludeDirectories)" "</AdditionalIncludeDirectories>\n", 0); } - + void cmVisualStudio10TargetGenerator:: @@ -1315,7 +1315,7 @@ cmVisualStudio10TargetGenerator::WriteLibOptions(std::string const& config) libOptions.Parse(libflags?libflags:""); libOptions.Parse(libflagsConfig?libflagsConfig:""); libOptions.OutputAdditionalOptions(*this->BuildFileStream, " ", ""); - libOptions.OutputFlagMap(*this->BuildFileStream, " "); + libOptions.OutputFlagMap(*this->BuildFileStream, " "); this->WriteString("</Lib>\n", 2); } } @@ -1324,7 +1324,7 @@ cmVisualStudio10TargetGenerator::WriteLibOptions(std::string const& config) void cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const& config) { - + // static libraries and things greater than modules do not need // to set this option if(this->Target->GetType() == cmTarget::STATIC_LIBRARY @@ -1344,7 +1344,7 @@ void cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const& this->WriteString("<Link>\n", 2); std::string CONFIG = cmSystemTools::UpperCase(config); - + const char* linkType = "SHARED"; if(this->Target->GetType() == cmTarget::MODULE_LIBRARY) { @@ -1405,7 +1405,7 @@ void cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const& std::string standardLibsVar = "CMAKE_"; standardLibsVar += linkLanguage; standardLibsVar += "_STANDARD_LIBRARIES"; - std::string + std::string libs = this->Makefile->GetSafeDefinition(standardLibsVar.c_str()); // Remove trailing spaces from libs std::string::size_type pos = libs.size()-1; @@ -1463,7 +1463,7 @@ void cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const& else { linkOptions.AddFlag("GenerateDebugInformation", "false"); - } + } std::string targetName; std::string targetNameSO; std::string targetNameFull; @@ -1472,13 +1472,13 @@ void cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const& if(this->Target->GetType() == cmTarget::EXECUTABLE) { this->Target->GetExecutableNames(targetName, targetNameFull, - targetNameImport, targetNamePDB, + targetNameImport, targetNamePDB, config.c_str()); } else { this->Target->GetLibraryNames(targetName, targetNameSO, targetNameFull, - targetNameImport, targetNamePDB, + targetNameImport, targetNamePDB, config.c_str()); } @@ -1502,7 +1502,7 @@ void cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const& linkOptions.RemoveFlag("GenerateManifest"); linkOptions.OutputAdditionalOptions(*this->BuildFileStream, " ", ""); linkOptions.OutputFlagMap(*this->BuildFileStream, " "); - + this->WriteString("</Link>\n", 2); if(!this->GlobalGenerator->NeedLinkLibraryDependencies(*this->Target)) { @@ -1516,7 +1516,7 @@ void cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const& void cmVisualStudio10TargetGenerator::AddLibraries( cmComputeLinkInformation& cli, std::string& libstring) -{ +{ typedef cmComputeLinkInformation::ItemVector ItemVector; ItemVector libs = cli.GetItems(); const char* sep = ";"; @@ -1582,15 +1582,15 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups() this->WriteMidlOptions(*i, includes); // write events this->WriteEvents(*i); - // output link flags <Link></Link> + // output link flags <Link></Link> this->WriteLinkOptions(*i); - // output lib flags <Lib></Lib> + // output lib flags <Lib></Lib> this->WriteLibOptions(*i); this->WriteString("</ItemDefinitionGroup>\n", 1); } } -void +void cmVisualStudio10TargetGenerator::WriteEvents(std::string const& configName) { this->WriteEvent("PreLinkEvent", @@ -1618,7 +1618,7 @@ void cmVisualStudio10TargetGenerator::WriteEvent( std::string comment; for(std::vector<cmCustomCommand>::iterator i = commands.begin(); i != commands.end(); ++i) - { + { cmCustomCommand& command = *i; comment += pre; comment += lg->ConstructComment(command); @@ -1675,7 +1675,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences() } (*this->BuildFileStream) << path << "\">\n"; this->WriteString("<Project>", 3); - (*this->BuildFileStream) + (*this->BuildFileStream) << this->GlobalGenerator->GetGUID(name.c_str()) << "</Project>\n"; this->WriteString("</ProjectReference>\n", 2); diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h index 2d5ec2a..308b9bd 100644 --- a/Source/cmVisualStudio10TargetGenerator.h +++ b/Source/cmVisualStudio10TargetGenerator.h @@ -28,20 +28,20 @@ class cmVisualStudioGeneratorOptions; class cmVisualStudio10TargetGenerator { public: - cmVisualStudio10TargetGenerator(cmTarget* target, + cmVisualStudio10TargetGenerator(cmTarget* target, cmGlobalVisualStudio10Generator* gg); ~cmVisualStudio10TargetGenerator(); void Generate(); - // used by cmVisualStudioGeneratorOptions - void WritePlatformConfigTag( + // used by cmVisualStudioGeneratorOptions + void WritePlatformConfigTag( const char* tag, - const char* config, + const char* config, int indentLevel, const char* attribute = 0, const char* end = 0, std::ostream* strm = 0 ); - + private: struct ToolSource { diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx index 9369af6..1df0d9e 100644 --- a/Source/cmVisualStudioGeneratorOptions.cxx +++ b/Source/cmVisualStudioGeneratorOptions.cxx @@ -342,10 +342,10 @@ cmVisualStudioGeneratorOptions if(!this->FlagString.empty()) { if(this->Version >= cmLocalVisualStudioGenerator::VS10) - { + { fout << prefix; if(this->Configuration.size()) - { + { this->TargetGenerator->WritePlatformConfigTag( "AdditionalOptions", this->Configuration.c_str(), diff --git a/Source/cmWhileCommand.h b/Source/cmWhileCommand.h index e111ae4..1bdf27a 100644 --- a/Source/cmWhileCommand.h +++ b/Source/cmWhileCommand.h @@ -25,7 +25,7 @@ public: cmMakefile &mf, cmExecutionStatus &); virtual bool ShouldRemove(const cmListFileFunction& lff, cmMakefile &mf); - + std::vector<cmListFileArgument> Args; std::vector<cmListFileFunction> Functions; private: @@ -39,7 +39,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmWhileCommand; } @@ -50,7 +50,7 @@ public: */ virtual bool InvokeInitialPass(const std::vector<cmListFileArgument>& args, cmExecutionStatus &); - + /** * This is called when the command is first encountered in * the CMakeLists.txt file. @@ -75,7 +75,7 @@ public: { return "Evaluate a group of commands while a condition is true"; } - + /** * More documentation. */ @@ -93,7 +93,7 @@ public: "is true. The condition is evaluated using the same logic as the " "if command."; } - + cmTypeMacro(cmWhileCommand, cmCommand); }; diff --git a/Source/cmWin32ProcessExecution.cxx b/Source/cmWin32ProcessExecution.cxx index f37e0ff..9a536c1 100644 --- a/Source/cmWin32ProcessExecution.cxx +++ b/Source/cmWin32ProcessExecution.cxx @@ -11,7 +11,7 @@ ============================================================================*/ #include "cmWin32ProcessExecution.h" -#include "cmSystemTools.h" +#include "cmSystemTools.h" #include <malloc.h> #include <io.h> @@ -48,26 +48,26 @@ void DisplayErrorMessage() { LPVOID lpMsgBuf; - FormatMessage( - FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | + FormatMessage( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language (LPTSTR) &lpMsgBuf, 0, - NULL + NULL ); // Process any inserts in lpMsgBuf. - // ... + // ... // Display the string. MessageBox( NULL, (LPCTSTR)lpMsgBuf, "Error", MB_OK | MB_ICONINFORMATION ); // Free the buffer. LocalFree( lpMsgBuf ); } - -// Code from a Borland web site with the following explaination : + +// Code from a Borland web site with the following explaination : /* In this article, I will explain how to spawn a console application * and redirect its standard input/output using anonymous pipes. An * anonymous pipe is a pipe that goes only in one direction (read @@ -93,74 +93,74 @@ void DisplayErrorMessage() * monitor the read end of the stdout pipe to check for display on our * child process. Every time there is something availabe for reading, * we will display it in our app. Consequently, we check for input in - * our app and send it off to the write end of the stdin pipe. */ + * our app and send it off to the write end of the stdin pipe. */ -inline bool IsWinNT() -//check if we're running NT +inline bool IsWinNT() +//check if we're running NT { OSVERSIONINFO osv; osv.dwOSVersionInfoSize = sizeof(osv); GetVersionEx(&osv); - return (osv.dwPlatformId == VER_PLATFORM_WIN32_NT); + return (osv.dwPlatformId == VER_PLATFORM_WIN32_NT); } -//--------------------------------------------------------------------------- +//--------------------------------------------------------------------------- bool cmWin32ProcessExecution::BorlandRunCommand( - const char* command, const char* dir, - std::string& output, int& retVal, bool verbose, int /* timeout */, - bool hideWindows) + const char* command, const char* dir, + std::string& output, int& retVal, bool verbose, int /* timeout */, + bool hideWindows) { //verbose = true; - //std::cerr << std::endl - // << "WindowsRunCommand(" << command << ")" << std::endl + //std::cerr << std::endl + // << "WindowsRunCommand(" << command << ")" << std::endl // << std::flush; const int BUFFER_SIZE = 4096; char buf[BUFFER_SIZE]; - -//i/o buffer + +//i/o buffer STARTUPINFO si; SECURITY_ATTRIBUTES sa; SECURITY_DESCRIPTOR sd; - -//security information for pipes + +//security information for pipes PROCESS_INFORMATION pi; HANDLE newstdin,newstdout,read_stdout,write_stdin; - -//pipe handles - if (IsWinNT()) -//initialize security descriptor (Windows NT) + +//pipe handles + if (IsWinNT()) +//initialize security descriptor (Windows NT) { InitializeSecurityDescriptor(&sd,SECURITY_DESCRIPTOR_REVISION); SetSecurityDescriptorDacl(&sd, true, NULL, false); sa.lpSecurityDescriptor = &sd; - + } else sa.lpSecurityDescriptor = NULL; sa.nLength = sizeof(SECURITY_ATTRIBUTES); sa.bInheritHandle = true; - -//allow inheritable handles - if (!CreatePipe(&newstdin,&write_stdin,&sa,0)) -//create stdin pipe + +//allow inheritable handles + if (!CreatePipe(&newstdin,&write_stdin,&sa,0)) +//create stdin pipe { return false; } - if (!CreatePipe(&read_stdout,&newstdout,&sa,0)) -//create stdout pipe + if (!CreatePipe(&read_stdout,&newstdout,&sa,0)) +//create stdout pipe { CloseHandle(newstdin); CloseHandle(write_stdin); return false; - + } GetStartupInfo(&si); - -//set startupinfo for the spawned process + +//set startupinfo for the spawned process /* The dwFlags member tells CreateProcess how to make the * process. STARTF_USESTDHANDLES validates the hStd* * members. STARTF_USESHOWWINDOW validates the wShowWindow - * member. */ - + * member. */ + si.cb = sizeof(STARTUPINFO); si.dwFlags = STARTF_USESTDHANDLES|STARTF_USESHOWWINDOW; si.hStdOutput = newstdout; @@ -170,12 +170,12 @@ bool cmWin32ProcessExecution::BorlandRunCommand( { si.wShowWindow = SW_HIDE; } - + //set the new handles for the child process si.hStdInput = newstdin; char* commandAndArgs = strcpy(new char[strlen(command)+1], command); if (!CreateProcess(NULL,commandAndArgs,NULL,NULL,TRUE, - 0, // CREATE_NEW_CONSOLE, - NULL,dir,&si,&pi)) + 0, // CREATE_NEW_CONSOLE, + NULL,dir,&si,&pi)) { std::cerr << "CreateProcess failed " << commandAndArgs << std::endl; CloseHandle(newstdin); @@ -184,37 +184,37 @@ bool cmWin32ProcessExecution::BorlandRunCommand( CloseHandle(write_stdin); delete [] commandAndArgs; return false; - + } delete [] commandAndArgs; unsigned long exit=0; - -//process exit code unsigned + +//process exit code unsigned unsigned long bread; - -//bytes read unsigned + +//bytes read unsigned unsigned long avail; - -//bytes available + +//bytes available memset(buf, 0, sizeof(buf)); - for(;;) -//main program loop + for(;;) +//main program loop { Sleep(10); -//check to see if there is any data to read from stdout +//check to see if there is any data to read from stdout //std::cout << "Peek for data..." << std::endl; PeekNamedPipe(read_stdout,buf,1023,&bread,&avail,NULL); - if (bread != 0) + if (bread != 0) { memset(buf, 0, sizeof(buf)); - if (avail > 1023) + if (avail > 1023) { - while (bread >= 1023) + while (bread >= 1023) { //std::cout << "Read data..." << std::endl; ReadFile(read_stdout,buf,1023,&bread,NULL); - - //read the stdout pipe + + //read the stdout pipe memset(buf, 0, sizeof(buf)); output += buf; if (verbose) @@ -223,39 +223,39 @@ bool cmWin32ProcessExecution::BorlandRunCommand( } } } - else + else { ReadFile(read_stdout,buf,1023,&bread,NULL); output += buf; - if(verbose) + if(verbose) { cmSystemTools::Stdout(buf); } - + } - + } - + //std::cout << "Check for process..." << std::endl; GetExitCodeProcess(pi.hProcess,&exit); - -//while the process is running + +//while the process is running if (exit != STILL_ACTIVE) break; - + } WaitForSingleObject(pi.hProcess, INFINITE); GetExitCodeProcess(pi.hProcess,&exit); CloseHandle(pi.hThread); CloseHandle(pi.hProcess); CloseHandle(newstdin); - -//clean stuff up + +//clean stuff up CloseHandle(newstdout); CloseHandle(read_stdout); CloseHandle(write_stdin); retVal = exit; return true; - + } bool cmWin32ProcessExecution::StartProcess( @@ -279,7 +279,7 @@ bool cmWin32ProcessExecution::Wait(int timeout) static void *_PyPopenProcs = NULL; static BOOL RealPopenCreateProcess(const char *cmdstring, - const char *path, + const char *path, const char *szConsoleSpawn, HANDLE hStdin, HANDLE hStdout, @@ -314,7 +314,7 @@ static BOOL RealPopenCreateProcess(const char *cmdstring, ++comshell; if (GetVersion() < 0x80000000 && - STRICMP(comshell, "command.com") != 0) + STRICMP(comshell, "command.com") != 0) { /* NT/2000 and not using command.com. */ x = i + (int)strlen(s3) + (int)strlen(cmdstring) + 1; @@ -323,7 +323,7 @@ static BOOL RealPopenCreateProcess(const char *cmdstring, //sprintf(s2, "%s%s%s", s1, s3, cmdstring); sprintf(s2, "%s", cmdstring); } - else + else { /* * Oh gag, we're on Win9x or using COMMAND.COM. Use @@ -337,22 +337,22 @@ static BOOL RealPopenCreateProcess(const char *cmdstring, x = i+1; modulepath[x] = '\0'; /* Create the full-name to w9xpopen, so we can test it exists */ - strncat(modulepath, - szConsoleSpawn, + strncat(modulepath, + szConsoleSpawn, (sizeof(modulepath)/sizeof(modulepath[0])) -strlen(modulepath)); - if (stat(modulepath, &statinfo) != 0) + if (stat(modulepath, &statinfo) != 0) { - /* Eeek - file-not-found - possibly an embedding - situation - see if we can locate it in sys.prefix + /* Eeek - file-not-found - possibly an embedding + situation - see if we can locate it in sys.prefix */ - strncpy(modulepath, - ".", + strncpy(modulepath, + ".", sizeof(modulepath)/sizeof(modulepath[0])); if (modulepath[strlen(modulepath)-1] != '\\') strcat(modulepath, "\\"); - strncat(modulepath, - szConsoleSpawn, + strncat(modulepath, + szConsoleSpawn, (sizeof(modulepath)/sizeof(modulepath[0])) -strlen(modulepath)); /* No where else to look - raise an easily identifiable @@ -361,20 +361,20 @@ static BOOL RealPopenCreateProcess(const char *cmdstring, unaware this shim EXE is used, and it will confuse them. (well, it confused me for a while ;-) */ - if (stat(modulepath, &statinfo) != 0) + if (stat(modulepath, &statinfo) != 0) { - std::cout + std::cout << "Can not locate '" << modulepath << "' which is needed " "for popen to work with your shell " - "or platform." << std::endl; + "or platform." << std::endl; free(s1); free(s2); return FALSE; } } x = i + (int)strlen(s3) + (int)strlen(cmdstring) + 1 + - (int)strlen(modulepath) + + (int)strlen(modulepath) + (int)strlen(szConsoleSpawn) + 1; if(s2) { @@ -399,22 +399,22 @@ static BOOL RealPopenCreateProcess(const char *cmdstring, /* Could be an else here to try cmd.exe / command.com in the path Now we'll just error out.. */ - else + else { std::cout << "Cannot locate a COMSPEC environment variable to " - << "use as the shell" << std::endl; + << "use as the shell" << std::endl; free(s2); free(s1); return FALSE; } - + ZeroMemory(&siStartInfo, sizeof(STARTUPINFO)); siStartInfo.cb = sizeof(STARTUPINFO); siStartInfo.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW; siStartInfo.hStdInput = hStdin; siStartInfo.hStdOutput = hStdout; siStartInfo.hStdError = hStderr; - siStartInfo.wShowWindow = SW_SHOWDEFAULT; + siStartInfo.wShowWindow = SW_SHOWDEFAULT; if(hideWindows) { siStartInfo.wShowWindow = SW_HIDE; @@ -430,7 +430,7 @@ static BOOL RealPopenCreateProcess(const char *cmdstring, NULL, path, &siStartInfo, - &piProcInfo) ) + &piProcInfo) ) { /* Close the handles now so anyone waiting is woken. */ CloseHandle(piProcInfo.hThread); @@ -477,9 +477,9 @@ static BOOL RealPopenCreateProcess(const char *cmdstring, /* The following code is based off of KB: Q190351 */ -bool cmWin32ProcessExecution::PrivateOpen(const char *cmdstring, +bool cmWin32ProcessExecution::PrivateOpen(const char *cmdstring, const char* path, - int mode, + int mode, int n) { HANDLE hProcess; @@ -496,11 +496,11 @@ bool cmWin32ProcessExecution::PrivateOpen(const char *cmdstring, this->hChildStdinWrDup = 0; this->hChildStdoutRdDup = 0; this->hChildStderrRdDup = 0; - + saAttr.nLength = sizeof(SECURITY_ATTRIBUTES); saAttr.bInheritHandle = TRUE; saAttr.lpSecurityDescriptor = NULL; - + fd1 = 0; fd2 = 0; fd3 = 0; @@ -510,7 +510,7 @@ bool cmWin32ProcessExecution::PrivateOpen(const char *cmdstring, this->Output += "CreatePipeError\n"; return false; } - + /* Create new output read handle and the input write handle. Set * the inheritance properties to FALSE. Otherwise, the child inherits * the these handles; resulting in non-closeable handles to the pipes @@ -549,7 +549,7 @@ bool cmWin32ProcessExecution::PrivateOpen(const char *cmdstring, that we're using. */ CloseHandle(hChildStdoutRd); - if (n != POPEN_4) + if (n != POPEN_4) { if (!CreatePipe(&this->hChildStderrRd, &this->hChildStderrWr, &saAttr, 0)) { @@ -570,11 +570,11 @@ bool cmWin32ProcessExecution::PrivateOpen(const char *cmdstring, CloseHandle(hChildStderrRd); } - - switch (n) + + switch (n) { case POPEN_1: - switch (mode & (_O_RDONLY | _O_TEXT | _O_BINARY | _O_WRONLY)) + switch (mode & (_O_RDONLY | _O_TEXT | _O_BINARY | _O_WRONLY)) { case _O_WRONLY | _O_TEXT: /* Case for writing to child Stdin in text mode. */ @@ -606,18 +606,18 @@ bool cmWin32ProcessExecution::PrivateOpen(const char *cmdstring, break; } break; - + case POPEN_2: - case POPEN_4: - //if ( 1 ) + case POPEN_4: + //if ( 1 ) { fd1 = _open_osfhandle(TO_INTPTR(this->hChildStdinWrDup), mode); fd2 = _open_osfhandle(TO_INTPTR(this->hChildStdoutRdDup), mode); break; } - + case POPEN_3: - //if ( 1) + //if ( 1) { fd1 = _open_osfhandle(TO_INTPTR(this->hChildStdinWrDup), mode); fd2 = _open_osfhandle(TO_INTPTR(this->hChildStdoutRdDup), mode); @@ -626,7 +626,7 @@ bool cmWin32ProcessExecution::PrivateOpen(const char *cmdstring, } } - if (n == POPEN_4) + if (n == POPEN_4) { if (!RealPopenCreateProcess(cmdstring, path, @@ -652,7 +652,7 @@ bool cmWin32ProcessExecution::PrivateOpen(const char *cmdstring, return 0; } } - else + else { if (!RealPopenCreateProcess(cmdstring, path, @@ -852,15 +852,15 @@ bool cmWin32ProcessExecution::PrivateClose(int /* timeout */) break; } } - } + } + - if (WaitForSingleObject(hProcess, INFINITE) != WAIT_FAILED && - GetExitCodeProcess(hProcess, &exit_code)) + GetExitCodeProcess(hProcess, &exit_code)) { result = exit_code; - } - else + } + else { /* Indicate failure - this will cause the file object * to raise an I/O error and translate the last Win32 @@ -868,7 +868,7 @@ bool cmWin32ProcessExecution::PrivateClose(int /* timeout */) * last errors that overlap the normal errno table, * but that's a consistent problem with the file object. */ - if (result != EOF) + if (result != EOF) { /* If the error wasn't from the fclose(), then * set errno for the file object error handling. @@ -897,7 +897,7 @@ int cmWin32ProcessExecution::Windows9xHack(const char* command) PROCESS_INFORMATION pi; DWORD exit_code=0; - if (!command) + if (!command) { cmSystemTools::Error("Windows9xHack: Command not specified"); return 1; @@ -911,7 +911,7 @@ int cmWin32ProcessExecution::Windows9xHack(const char* command) si.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE); si.hStdError = GetStdHandle(STD_ERROR_HANDLE); - + char * app = 0; char* cmd = new char[ strlen(command) + 1 ]; strcpy(cmd, command); @@ -925,9 +925,9 @@ int cmWin32ProcessExecution::Windows9xHack(const char* command) ); delete [] cmd; - if (bRet) + if (bRet) { - if (WaitForSingleObject(pi.hProcess, INFINITE) != WAIT_FAILED) + if (WaitForSingleObject(pi.hProcess, INFINITE) != WAIT_FAILED) { GetExitCodeProcess(pi.hProcess, &exit_code); } diff --git a/Source/cmWin32ProcessExecution.h b/Source/cmWin32ProcessExecution.h index def69a8..98b6bda 100644 --- a/Source/cmWin32ProcessExecution.h +++ b/Source/cmWin32ProcessExecution.h @@ -47,12 +47,12 @@ public: ~cmWin32ProcessExecution(); ///! If true windows will be created hidden. void SetHideWindows(bool v) { this->HideWindows = v; } - + /** * Initialize the process execution datastructure. Do not call while * running the process. */ - void Initialize() + void Initialize() { this->ProcessHandle = 0; this->ExitValue = -1; @@ -65,7 +65,7 @@ public: this->pStdOut = -1; this->pStdErr = -1; } - + /** * Start the process in the directory path. Make sure that the * executable is either in the path or specify the full path. The @@ -129,10 +129,10 @@ public: * process. Every time there is something availabe for reading, we * will display it in our app. Consequently, we check for input in * our app and send it off to the write end of the stdin pipe. - */ - static bool BorlandRunCommand(const char* command, - const char* dir, - std::string& output, int& retVal, + */ + static bool BorlandRunCommand(const char* command, + const char* dir, + std::string& output, int& retVal, bool verbose, int timeout, bool hideWindows); @@ -151,8 +151,8 @@ private: HANDLE hChildStdinWrDup; HANDLE hChildStdoutRdDup; HANDLE hChildStderrRdDup; - - + + int pStdIn; int pStdOut; int pStdErr; diff --git a/Source/cmWriteFileCommand.cxx b/Source/cmWriteFileCommand.cxx index b2acb2b..3642c6f 100644 --- a/Source/cmWriteFileCommand.cxx +++ b/Source/cmWriteFileCommand.cxx @@ -71,7 +71,7 @@ bool cmWriteFileCommand } // If GetPermissions fails, pretend like it is ok. File open will fail if // the file is not writable - std::ofstream file(fileName.c_str(), + std::ofstream file(fileName.c_str(), overwrite?std::ios::out : std::ios::app); if ( !file ) { diff --git a/Source/cmWriteFileCommand.h b/Source/cmWriteFileCommand.h index 8808d32..771ef5a 100644 --- a/Source/cmWriteFileCommand.h +++ b/Source/cmWriteFileCommand.h @@ -24,7 +24,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + virtual cmCommand* Clone() { return new cmWriteFileCommand; } @@ -53,7 +53,7 @@ public: { return "Deprecated. Use the file(WRITE ) command instead."; } - + /** * More documentation. */ @@ -71,7 +71,7 @@ public: "lead to an infinite loop. Use configure_file if you want to generate " "input files to CMake."; } - + /** This command is kept for compatibility with older CMake versions. */ virtual bool IsDiscouraged() const { diff --git a/Source/cmXCode21Object.cxx b/Source/cmXCode21Object.cxx index c679cd8..855e1ad 100644 --- a/Source/cmXCode21Object.cxx +++ b/Source/cmXCode21Object.cxx @@ -79,20 +79,20 @@ void cmXCode21Object::PrintList(std::vector<cmXCodeObject*> const& v, cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXBuildStyle); cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXContainerItemProxy); cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXFileReference); - cmXCode21Object::PrintList(v, out, + cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXFrameworksBuildPhase); cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXGroup); cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXHeadersBuildPhase); cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXNativeTarget); cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXProject); - cmXCode21Object::PrintList(v, out, + cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXShellScriptBuildPhase); cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXResourcesBuildPhase); cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXSourcesBuildPhase); cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXCopyFilesBuildPhase); - cmXCode21Object::PrintList(v, out, + cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXApplicationReference); - cmXCode21Object::PrintList(v, out, + cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXExecutableFileReference); cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXLibraryReference); cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXToolTarget); diff --git a/Source/cmXCodeObject.cxx b/Source/cmXCodeObject.cxx index 30ade96..de150ee 100644 --- a/Source/cmXCodeObject.cxx +++ b/Source/cmXCodeObject.cxx @@ -16,13 +16,13 @@ //---------------------------------------------------------------------------- const char* cmXCodeObject::PBXTypeNames[] = { - "PBXGroup", "PBXBuildStyle", "PBXProject", "PBXHeadersBuildPhase", + "PBXGroup", "PBXBuildStyle", "PBXProject", "PBXHeadersBuildPhase", "PBXSourcesBuildPhase", "PBXFrameworksBuildPhase", "PBXNativeTarget", - "PBXFileReference", "PBXBuildFile", "PBXContainerItemProxy", - "PBXTargetDependency", "PBXShellScriptBuildPhase", + "PBXFileReference", "PBXBuildFile", "PBXContainerItemProxy", + "PBXTargetDependency", "PBXShellScriptBuildPhase", "PBXResourcesBuildPhase", "PBXApplicationReference", "PBXExecutableFileReference", "PBXLibraryReference", "PBXToolTarget", - "PBXLibraryTarget", "PBXAggregateTarget", "XCBuildConfiguration", + "PBXLibraryTarget", "PBXAggregateTarget", "XCBuildConfiguration", "XCConfigurationList", "PBXCopyFilesBuildPhase", "None" @@ -92,7 +92,7 @@ void cmXCodeObject::Print(std::ostream& out) { std::string separator = "\n"; int indentFactor = 1; - if(this->Version > 15 + if(this->Version > 15 && (this->IsA == PBXFileReference || this->IsA == PBXBuildFile)) { separator = " "; @@ -112,12 +112,12 @@ void cmXCodeObject::Print(std::ostream& out) std::map<cmStdString, cmXCodeObject*>::iterator i; cmXCodeObject::Indent(3*indentFactor, out); out << "isa = " << PBXTypeNames[this->IsA] << ";" << separator; - for(i = this->ObjectAttributes.begin(); + for(i = this->ObjectAttributes.begin(); i != this->ObjectAttributes.end(); ++i) - { + { cmXCodeObject* object = i->second; if(i->first != "isa") - { + { cmXCodeObject::Indent(3*indentFactor, out); } else @@ -133,7 +133,7 @@ void cmXCodeObject::Print(std::ostream& out) out << i->second->List[k]->Id << " "; i->second->List[k]->PrintComment(out); out << "," << separator; - } + } cmXCodeObject::Indent(3*indentFactor, out); out << ");" << separator; } @@ -141,7 +141,7 @@ void cmXCodeObject::Print(std::ostream& out) { std::map<cmStdString, cmXCodeObject*>::iterator j; out << i->first << " = {" << separator; - for(j = object->ObjectAttributes.begin(); j != + for(j = object->ObjectAttributes.begin(); j != object->ObjectAttributes.end(); ++j) { cmXCodeObject::Indent(4 *indentFactor, out); @@ -209,11 +209,11 @@ void cmXCodeObject::Print(std::ostream& out) cmXCodeObject::Indent(2*indentFactor, out); out << "};\n"; } - + //---------------------------------------------------------------------------- void cmXCodeObject::PrintList(std::vector<cmXCodeObject*> const& objs, std::ostream& out) -{ +{ cmXCodeObject::Indent(1, out); out << "objects = {\n"; for(unsigned int i = 0; i < objs.size(); ++i) diff --git a/Source/cmXCodeObject.h b/Source/cmXCodeObject.h index 2fb96f3..bb2d5b2 100644 --- a/Source/cmXCodeObject.h +++ b/Source/cmXCodeObject.h @@ -19,13 +19,13 @@ class cmXCodeObject { public: enum Type { OBJECT_LIST, STRING, ATTRIBUTE_GROUP, OBJECT_REF, OBJECT }; - enum PBXType { PBXGroup, PBXBuildStyle, PBXProject, PBXHeadersBuildPhase, - PBXSourcesBuildPhase, PBXFrameworksBuildPhase, - PBXNativeTarget, PBXFileReference, PBXBuildFile, + enum PBXType { PBXGroup, PBXBuildStyle, PBXProject, PBXHeadersBuildPhase, + PBXSourcesBuildPhase, PBXFrameworksBuildPhase, + PBXNativeTarget, PBXFileReference, PBXBuildFile, PBXContainerItemProxy, PBXTargetDependency, PBXShellScriptBuildPhase, PBXResourcesBuildPhase, - PBXApplicationReference, PBXExecutableFileReference, - PBXLibraryReference, PBXToolTarget, PBXLibraryTarget, + PBXApplicationReference, PBXExecutableFileReference, + PBXLibraryReference, PBXToolTarget, PBXLibraryTarget, PBXAggregateTarget,XCBuildConfiguration,XCConfigurationList, PBXCopyFilesBuildPhase, None @@ -38,16 +38,16 @@ public: PBXType GetIsA() { return this->IsA;} void SetString(const char* s); - const char* GetString() + const char* GetString() { return this->String.c_str(); } - + void AddAttribute(const char* name, cmXCodeObject* value) { this->ObjectAttributes[name] = value; } - + void SetObject(cmXCodeObject* value) { this->Object = value; @@ -60,14 +60,14 @@ public: { this->List.push_back(value); } - bool HasObject(cmXCodeObject* o) + bool HasObject(cmXCodeObject* o) { - return !(std::find(this->List.begin(), this->List.end(), o) + return !(std::find(this->List.begin(), this->List.end(), o) == this->List.end()); } void AddUniqueObject(cmXCodeObject* value) { - if(std::find(this->List.begin(), this->List.end(), value) + if(std::find(this->List.begin(), this->List.end(), value) == this->List.end()) { this->List.push_back(value); @@ -77,7 +77,7 @@ public: void Print(std::ostream& out); virtual void PrintComment(std::ostream&) {}; - static void PrintList(std::vector<cmXCodeObject*> const&, + static void PrintList(std::vector<cmXCodeObject*> const&, std::ostream& out); const char* GetId() { @@ -119,7 +119,7 @@ public: } return 0; } - + cmXCodeObject* GetPBXTargetDependency() { return this->PBXTargetDependencyValue; @@ -129,7 +129,7 @@ public: this->PBXTargetDependencyValue = d; } void CopyAttributes(cmXCodeObject* ); - + void AddDependLibrary(const char* configName, const char* l) { diff --git a/Source/cmXMLParser.cxx b/Source/cmXMLParser.cxx index 46a1ca4..882fc17 100644 --- a/Source/cmXMLParser.cxx +++ b/Source/cmXMLParser.cxx @@ -34,7 +34,7 @@ cmXMLParser::~cmXMLParser() int cmXMLParser::Parse(const char* string) { return (int)this->InitializeParser() && - this->ParseChunk(string, strlen(string)) && + this->ParseChunk(string, strlen(string)) && this->CleanupParser(); } @@ -79,7 +79,7 @@ int cmXMLParser::InitializeParser() } //---------------------------------------------------------------------------- -int cmXMLParser::ParseChunk(const char* inputString, +int cmXMLParser::ParseChunk(const char* inputString, std::string::size_type length) { if ( !this->Parser ) @@ -116,11 +116,11 @@ int cmXMLParser::CleanupParser() result = 0; } } - + // Clean up the parser. XML_ParserFree(static_cast<XML_Parser>(this->Parser)); this->Parser = 0; - + return result; } @@ -128,7 +128,7 @@ int cmXMLParser::CleanupParser() int cmXMLParser::ParseBuffer(const char* buffer, std::string::size_type count) { // Pass the buffer to the expat XML parser. - if(!XML_Parse(static_cast<XML_Parser>(this->Parser), buffer, + if(!XML_Parse(static_cast<XML_Parser>(this->Parser), buffer, static_cast<int>(count), 0)) { this->ReportXmlParseError(); diff --git a/Source/cmXMLParser.h b/Source/cmXMLParser.h index c72be57..d916075 100644 --- a/Source/cmXMLParser.h +++ b/Source/cmXMLParser.h @@ -18,7 +18,7 @@ extern "C" { void cmXMLParserStartElement(void*, const char*, const char**); void cmXMLParserEndElement(void*, const char*); - void cmXMLParserCharacterDataHandler(void*, const char*, int); + void cmXMLParserCharacterDataHandler(void*, const char*, int); } /** \class cmXMLParser @@ -37,7 +37,7 @@ public: //! Parse given XML file virtual int ParseFile(const char* file); - + /** * When parsing fragments of XML or streaming XML, use the following * three methods. InitializeParser method initialize parser but does @@ -47,7 +47,7 @@ public: * them. */ virtual int InitializeParser(); - virtual int ParseChunk(const char* inputString, + virtual int ParseChunk(const char* inputString, std::string::size_type length); virtual int CleanupParser(); @@ -65,7 +65,7 @@ protected: * terminating condition for parsing. Parsing always stops when the end of * file is reached in the stream. */ - + virtual int ParsingComplete(); /** @@ -75,28 +75,28 @@ protected: * Even indices are attribute names, and odd indices are values. */ virtual void StartElement(const char* name, const char** atts); - + //! Called at the end of an element in the XML source opened when //StartElement was called. virtual void EndElement(const char* name); - + //! Called when there is character data to handle. - virtual void CharacterDataHandler(const char* data, int length); + virtual void CharacterDataHandler(const char* data, int length); //! Called by Parse to report an XML syntax error. - virtual void ReportXmlParseError(); + virtual void ReportXmlParseError(); /** Called by ReportXmlParseError with basic error info. */ virtual void ReportError(int line, int column, const char* msg); //! Utility for convenience of subclasses. Wraps isspace C library // routine. - static int IsSpace(char c); - + static int IsSpace(char c); + //! Send the given buffer to the XML parser. - virtual int ParseBuffer(const char* buffer, + virtual int ParseBuffer(const char* buffer, std::string::size_type length); - + //! Send the given c-style string to the XML parser. int ParseBuffer(const char* buffer); diff --git a/Source/cmakewizard.cxx b/Source/cmakewizard.cxx index cd427cb..749f669 100644 --- a/Source/cmakewizard.cxx +++ b/Source/cmakewizard.cxx @@ -137,7 +137,7 @@ int cmakewizard::RunWizard(std::vector<std::string> const& args) } } else - { + { if(this->ShowAdvanced || !i.GetPropertyAsBool("ADVANCED")) { this->AskUser(key.c_str(), i); diff --git a/Source/cmakewizard.h b/Source/cmakewizard.h index fcb2c7a..0c8dba9 100644 --- a/Source/cmakewizard.h +++ b/Source/cmakewizard.h @@ -18,24 +18,24 @@ class cmakewizard public: cmakewizard(); virtual ~cmakewizard() {} - /** + /** * Prompt the user to see if they want to see advanced entries. */ virtual bool AskAdvanced(); - + /** * Prompt the User for a new value for key, the answer is put in entry. */ virtual void AskUser(const char* key, cmCacheManager::CacheIterator& iter); ///! Show a message to wait for cmake to run. virtual void ShowMessage(const char*); - - /** - * Run cmake in wizard mode. This will coninue to ask the user questions + + /** + * Run cmake in wizard mode. This will coninue to ask the user questions * until there are no more entries in the cache. */ int RunWizard(std::vector<std::string>const& args); - + private: bool ShowAdvanced; }; diff --git a/Source/cmakexbuild.cxx b/Source/cmakexbuild.cxx index 8eaae47..9aaeeaa 100644 --- a/Source/cmakexbuild.cxx +++ b/Source/cmakexbuild.cxx @@ -33,7 +33,7 @@ int RunXCode(std::vector<const char*>& argv, bool& hitbug) int pipe = cmSystemTools::WaitForLine(cp, line, 100.0, out, err); while(pipe != cmsysProcess_Pipe_None) { - if(line.find("/bin/sh: bad interpreter: Text file busy") + if(line.find("/bin/sh: bad interpreter: Text file busy") != line.npos) { hitbug = true; @@ -69,7 +69,7 @@ int RunXCode(std::vector<const char*>& argv, bool& hitbug) } int main(int ac, char*av[]) -{ +{ std::vector<const char*> argv; argv.push_back("xcodebuild"); for(int i =1; i < ac; i++) diff --git a/Source/cmparseMSBuildXML.py b/Source/cmparseMSBuildXML.py index 4877e59..a0c7ec4 100755 --- a/Source/cmparseMSBuildXML.py +++ b/Source/cmparseMSBuildXML.py @@ -9,7 +9,7 @@ # # BoolProperty <Name>true|false</Name> # simple example: -# <BoolProperty ReverseSwitch="Oy-" Name="OmitFramePointers" +# <BoolProperty ReverseSwitch="Oy-" Name="OmitFramePointers" # Category="Optimization" Switch="Oy"> # <BoolProperty.DisplayName> <BoolProperty.Description> # <CLCompile> @@ -67,7 +67,7 @@ # <Optimization>MaxSpeed</Optimization> # example for O1 would be this: # <Optimization>MinSpace</Optimization> -# +# # StringListProperty # <StringListProperty Name="PreprocessorDefinitions" Category="Preprocessor" Switch="D "> # <StringListProperty.DisplayName> @@ -130,7 +130,7 @@ class Property: if document is not None: self.populate(document) pass - + #document = the dom file that's root node is the Property node (ex. if you were parsing a BoolProperty the root node should be something like <BoolProperty Name="RegisterOutput" Category="General" IncludeInCommandLine="false"> #spaces = do not use def populate(self,document, spaces = ""): @@ -155,9 +155,9 @@ class Property: self.populate(child,spaces+"----") pass - #toString function + #toString function def __str__(self): - toReturn = self.prefix_type+self.suffix_type+":" + toReturn = self.prefix_type+self.suffix_type+":" for i in self.attributeNames: toReturn += "\n "+i+": "+self.attributes[i] if self.argumentProperty != "": @@ -191,7 +191,7 @@ class MSBuildToCMake: # self.<Name>Properties.append(Property("<Name>",[<List of attributes>],child)) # #Replace <Name> with the name of the new property (ex. if property is StringProperty replace <Name> with String) - #Replace <List of attributes> with a list of attributes in your property's root node + #Replace <List of attributes> with a list of attributes in your property's root node #in the __init__ function add the line self.<Name>Properties = [] # #That is all that is required to add new properties @@ -236,7 +236,7 @@ class MSBuildToCMake: for j in lastProp.values: toReturn+=" {\""+lastProp.attributes["Name"]+"\", \""+j.attributes["Switch"]+"\",\n \""+j.DisplayName+"\", \""+j.attributes["Name"]+"\", 0},\n" toReturn += "\n" - + toReturn += "\n //Bool Properties\n" for i in self.boolProperties: if i.argumentProperty == "": @@ -254,7 +254,7 @@ class MSBuildToCMake: if i.attributes["Switch"] != "": toReturn += " {\""+i.attributes["Name"]+"\", \""+i.attributes["Switch"]+"\", \"\", \"true\",\n cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue},\n" toReturn += " {\""+i.argumentProperty+"\", \""+i.attributes["Switch"]+"\", \""+i.DisplayName+"\", \"\",\n cmVS7FlagTable::UserValueRequired},\n" - + toReturn += "\n //String List Properties\n" for i in self.stringListProperties: if i.attributes["Switch"] == "": @@ -289,7 +289,7 @@ class MSBuildToCMake: for p in allList: for i in p: toReturn += "==================================================\n"+str(i).replace("\n","\n ")+"\n==================================================\n" - + return toReturn ########################################################################################### @@ -305,8 +305,8 @@ def main(argv): for i in range(0,len(argv)): if argv[i] == "-x": xml_file = argv[i+1] - if argv[i] == "-h": - print help + if argv[i] == "-h": + print help sys.exit(0) pass if xml_file == None: diff --git a/Source/cmw9xcom.cxx b/Source/cmw9xcom.cxx index 4ba2749..e6014b3 100644 --- a/Source/cmw9xcom.cxx +++ b/Source/cmw9xcom.cxx @@ -22,7 +22,7 @@ int main (int argc, char *argv[]) return 1; } std::string arg = argv[1]; - if ( (arg.find_first_of(" ") != arg.npos) && + if ( (arg.find_first_of(" ") != arg.npos) && (arg.find_first_of("\"") == arg.npos) ) { arg = "\"" + arg + "\""; @@ -32,7 +32,7 @@ int main (int argc, char *argv[]) for ( cc = 2; cc < argc; cc ++ ) { std::string arg = argv[cc]; - if ( (arg.find_first_of(" ") != arg.npos) && + if ( (arg.find_first_of(" ") != arg.npos) && (arg.find_first_of("\"") == arg.npos) ) { arg = "\"" + arg + "\""; |