diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CPack/cmCPackArchiveGenerator.cxx | 49 | ||||
-rw-r--r-- | Source/CPack/cmCPackArchiveGenerator.h | 2 | ||||
-rw-r--r-- | Source/CPack/cmCPackDebGenerator.cxx | 193 | ||||
-rw-r--r-- | Source/CPack/cmCPackDebGenerator.h | 6 | ||||
-rw-r--r-- | Source/CPack/cmCPackGenerator.cxx | 27 | ||||
-rw-r--r-- | Source/CPack/cmCPackGenerator.h | 5 | ||||
-rw-r--r-- | Source/CPack/cmCPackRPMGenerator.cxx | 144 | ||||
-rw-r--r-- | Source/CPack/cmCPackRPMGenerator.h | 6 | ||||
-rw-r--r-- | Source/cmGeneratorExpression.cxx | 2 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmIncludeDirectoryCommand.h | 2 | ||||
-rw-r--r-- | Source/cmake.cxx | 47 | ||||
-rw-r--r-- | Source/cmake.h | 4 | ||||
-rw-r--r-- | Source/kwsys/Terminal.c | 1 | ||||
-rw-r--r-- | Source/kwsys/kwsysDateStamp.cmake | 2 |
15 files changed, 204 insertions, 288 deletions
diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx index b629c63..55d9890 100644 --- a/Source/CPack/cmCPackArchiveGenerator.cxx +++ b/Source/CPack/cmCPackArchiveGenerator.cxx @@ -207,7 +207,7 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup) } //---------------------------------------------------------------------- -int cmCPackArchiveGenerator::PackageComponentsAllInOne(bool allComponent) +int cmCPackArchiveGenerator::PackageComponentsAllInOne() { // reset the package file names packageFileNames.clear(); @@ -221,38 +221,15 @@ int cmCPackArchiveGenerator::PackageComponentsAllInOne(bool allComponent) << std::endl); DECLARE_AND_OPEN_ARCHIVE(packageFileNames[0],archive); - // The ALL GROUP in ONE package case - if (! allComponent) { - // iterate over the component groups - std::map<std::string, cmCPackComponentGroup>::iterator compGIt; - for (compGIt=this->ComponentGroups.begin(); - compGIt!=this->ComponentGroups.end(); ++compGIt) - { - cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Packaging component group: " - << compGIt->first - << std::endl); - // now iterate over the component of this group - std::vector<cmCPackComponent*>::iterator compIt; - for (compIt=(compGIt->second).Components.begin(); - compIt!=(compGIt->second).Components.end(); - ++compIt) - { - // Add the files of this component to the archive - addOneComponentToArchive(archive,*compIt); - } - } - } - // The ALL COMPONENT in ONE package case - else + // The ALL COMPONENTS in ONE package case + std::map<std::string, cmCPackComponent>::iterator compIt; + for (compIt=this->Components.begin();compIt!=this->Components.end(); + ++compIt ) { - std::map<std::string, cmCPackComponent>::iterator compIt; - for (compIt=this->Components.begin();compIt!=this->Components.end(); - ++compIt ) - { - // Add the files of this component to the archive - addOneComponentToArchive(archive,&(compIt->second)); - } + // Add the files of this component to the archive + addOneComponentToArchive(archive,&(compIt->second)); } + // archive goes out of scope so it will finalized and closed. return 1; } @@ -265,19 +242,17 @@ int cmCPackArchiveGenerator::PackageFiles() if (SupportsComponentInstallation()) { // CASE 1 : COMPONENT ALL-IN-ONE package - // If ALL GROUPS or ALL COMPONENTS in ONE package has been requested + // If ALL COMPONENTS in ONE package has been requested // then the package file is unique and should be open here. - if (allComponentInOne || - (allGroupInOne && (!this->ComponentGroups.empty())) - ) + if (allComponentInOne) { - return PackageComponentsAllInOne(allComponentInOne); + return PackageComponentsAllInOne(); } // CASE 2 : COMPONENT CLASSICAL package(s) (i.e. not all-in-one) // There will be 1 package for each component group // however one may require to ignore component group and // in this case you'll get 1 package for each component. - else if ((!this->ComponentGroups.empty()) || (ignoreComponentGroup)) + else { return PackageComponents(ignoreComponentGroup); } diff --git a/Source/CPack/cmCPackArchiveGenerator.h b/Source/CPack/cmCPackArchiveGenerator.h index dc17257..b1bbb83 100644 --- a/Source/CPack/cmCPackArchiveGenerator.h +++ b/Source/CPack/cmCPackArchiveGenerator.h @@ -65,7 +65,7 @@ protected: * Special case of component install where all * components will be put in a single installer. */ - int PackageComponentsAllInOne(bool allComponent); + int PackageComponentsAllInOne(); virtual const char* GetOutputExtension() = 0; cmArchiveWrite::Compress Compress; cmArchiveWrite::Type Archive; diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index ca2185c..82038e9 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -51,6 +51,62 @@ int cmCPackDebGenerator::InitializeInternal() } //---------------------------------------------------------------------- +int cmCPackDebGenerator::PackageOnePack(std::string initialTopLevel, + std::string packageName) + { + int retval = 1; + // Begin the archive for this pack + std::string localToplevel(initialTopLevel); + std::string packageFileName( + cmSystemTools::GetParentDirectory(toplevel.c_str()) + ); + std::string outputFileName( + std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME")) + +"-"+packageName + this->GetOutputExtension() + ); + + localToplevel += "/"+ packageName; + /* replace the TEMP DIRECTORY with the component one */ + this->SetOption("CPACK_TEMPORARY_DIRECTORY",localToplevel.c_str()); + packageFileName += "/"+ outputFileName; + /* replace proposed CPACK_OUTPUT_FILE_NAME */ + this->SetOption("CPACK_OUTPUT_FILE_NAME",outputFileName.c_str()); + /* replace the TEMPORARY package file name */ + this->SetOption("CPACK_TEMPORARY_PACKAGE_FILE_NAME", + packageFileName.c_str()); + // Tell CPackDeb.cmake the name of the component GROUP. + this->SetOption("CPACK_DEB_PACKAGE_COMPONENT",packageName.c_str()); + if (!this->ReadListFile("CPackDeb.cmake")) + { + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Error while execution CPackDeb.cmake" << std::endl); + retval = 0; + return retval; + } + + cmsys::Glob gl; + std::string findExpr(this->GetOption("WDIR")); + findExpr += "/*"; + gl.RecurseOn(); + if ( !gl.FindFiles(findExpr) ) + { + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Cannot find any files in the installed directory" << std::endl); + return 0; + } + packageFiles = gl.GetFiles(); + + int res = createDeb(); + if (res != 1) + { + retval = 0; + } + // add the generated package to package file names list + packageFileNames.push_back(packageFileName); + return retval; +} + +//---------------------------------------------------------------------- int cmCPackDebGenerator::PackageComponents(bool ignoreGroup) { int retval = 1; @@ -71,53 +127,24 @@ int cmCPackDebGenerator::PackageComponents(bool ignoreGroup) << compGIt->first << std::endl); // Begin the archive for this group - std::string localToplevel(initialTopLevel); - std::string packageFileName( - cmSystemTools::GetParentDirectory(toplevel.c_str()) - ); - std::string outputFileName( - std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME")) - +"-"+compGIt->first + this->GetOutputExtension() - ); - - localToplevel += "/"+ compGIt->first; - /* replace the TEMP DIRECTORY with the component one */ - this->SetOption("CPACK_TEMPORARY_DIRECTORY",localToplevel.c_str()); - packageFileName += "/"+ outputFileName; - /* replace proposed CPACK_OUTPUT_FILE_NAME */ - this->SetOption("CPACK_OUTPUT_FILE_NAME",outputFileName.c_str()); - /* replace the TEMPORARY package file name */ - this->SetOption("CPACK_TEMPORARY_PACKAGE_FILE_NAME", - packageFileName.c_str()); - // Tell CPackDeb.cmake the name of the component GROUP. - this->SetOption("CPACK_DEB_PACKAGE_COMPONENT",compGIt->first.c_str()); - if (!this->ReadListFile("CPackDeb.cmake")) - { - cmCPackLogger(cmCPackLog::LOG_ERROR, - "Error while execution CPackDeb.cmake" << std::endl); - retval = 0; - return retval; - } - - cmsys::Glob gl; - std::string findExpr(this->GetOption("WDIR")); - findExpr += "/*"; - gl.RecurseOn(); - if ( !gl.FindFiles(findExpr) ) - { - cmCPackLogger(cmCPackLog::LOG_ERROR, - "Cannot find any files in the installed directory" << std::endl); - return 0; - } - packageFiles = gl.GetFiles(); - - int res = createDeb(); - if (res != 1) + retval &= PackageOnePack(initialTopLevel,compGIt->first); + } + // Handle Orphan components (components not belonging to any groups) + std::map<std::string, cmCPackComponent>::iterator compIt; + for (compIt=this->Components.begin(); + compIt!=this->Components.end(); ++compIt ) + { + // Does the component belong to a group? + if (compIt->second.Group==NULL) { - retval = 0; + cmCPackLogger(cmCPackLog::LOG_VERBOSE, + "Component <" + << compIt->second.Name + << "> does not belong to any group, package it separately." + << std::endl); + // Begin the archive for this orphan component + retval &= PackageOnePack(initialTopLevel,compIt->first); } - // add the generated package to package file names list - packageFileNames.push_back(packageFileName); } } // CPACK_COMPONENTS_IGNORE_GROUPS is set @@ -128,59 +155,14 @@ int cmCPackDebGenerator::PackageComponents(bool ignoreGroup) for (compIt=this->Components.begin(); compIt!=this->Components.end(); ++compIt ) { - std::string localToplevel(initialTopLevel); - std::string packageFileName( - cmSystemTools::GetParentDirectory(toplevel.c_str()) - ); - std::string outputFileName( - std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME") - ) - +"-"+compIt->first + this->GetOutputExtension()); - - localToplevel += "/"+ compIt->first; - /* replace the TEMP DIRECTORY with the component one */ - this->SetOption("CPACK_TEMPORARY_DIRECTORY",localToplevel.c_str()); - packageFileName += "/"+ outputFileName; - /* replace proposed CPACK_OUTPUT_FILE_NAME */ - this->SetOption("CPACK_OUTPUT_FILE_NAME",outputFileName.c_str()); - /* replace the TEMPORARY package file name */ - this->SetOption("CPACK_TEMPORARY_PACKAGE_FILE_NAME", - packageFileName.c_str()); - - this->SetOption("CPACK_DEB_PACKAGE_COMPONENT",compIt->first.c_str()); - if (!this->ReadListFile("CPackDeb.cmake")) - { - cmCPackLogger(cmCPackLog::LOG_ERROR, - "Error while execution CPackDeb.cmake" << std::endl); - retval = 0; - return retval; - } - cmsys::Glob gl; - std::string findExpr(this->GetOption("WDIR")); - findExpr += "/*"; - gl.RecurseOn(); - if ( !gl.FindFiles(findExpr) ) - { - cmCPackLogger(cmCPackLog::LOG_ERROR, - "Cannot find any files in the installed directory" << std::endl); - return 0; - } - packageFiles = gl.GetFiles(); - - int res = createDeb(); - if (res != 1) - { - retval = 0; - } - // add the generated package to package file names list - packageFileNames.push_back(packageFileName); + retval &= PackageOnePack(initialTopLevel,compIt->first); } } return retval; } //---------------------------------------------------------------------- -int cmCPackDebGenerator::PackageComponentsAllInOne(bool allComponent) +int cmCPackDebGenerator::PackageComponentsAllInOne() { int retval = 1; std::string compInstDirName; @@ -189,15 +171,7 @@ int cmCPackDebGenerator::PackageComponentsAllInOne(bool allComponent) packageFileNames.clear(); std::string initialTopLevel(this->GetOption("CPACK_TEMPORARY_DIRECTORY")); - // all GROUP in one vs all COMPONENT in one - if (allComponent) - { - compInstDirName = "ALL_COMPONENTS_IN_ONE"; - } - else - { - compInstDirName = "ALL_GROUPS_IN_ONE"; - } + compInstDirName = "ALL_COMPONENTS_IN_ONE"; cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Packaging all groups in one package..." @@ -266,17 +240,15 @@ int cmCPackDebGenerator::PackageFiles() // CASE 1 : COMPONENT ALL-IN-ONE package // If ALL GROUPS or ALL COMPONENTS in ONE package has been requested // then the package file is unique and should be open here. - if (allComponentInOne || - (allGroupInOne && (!this->ComponentGroups.empty())) - ) + if (allComponentInOne) { - return PackageComponentsAllInOne(allComponentInOne); + return PackageComponentsAllInOne(); } // CASE 2 : COMPONENT CLASSICAL package(s) (i.e. not all-in-one) // There will be 1 package for each component group // however one may require to ignore component group and // in this case you'll get 1 package for each component. - else if ((!this->ComponentGroups.empty()) || (ignoreComponentGroup)) + else { return PackageComponents(ignoreComponentGroup); } @@ -601,14 +573,7 @@ std::string cmCPackDebGenerator::GetComponentInstallDirNameSuffix( cmSystemTools::UpperCase(componentName) + "_GROUP"; if (NULL != GetOption(groupVar.c_str())) { - if (allGroupInOne) - { - return std::string("ALL_GROUPS_IN_ONE"); - } - else - { - return std::string(GetOption(groupVar.c_str())); - } + return std::string(GetOption(groupVar.c_str())); } else { diff --git a/Source/CPack/cmCPackDebGenerator.h b/Source/CPack/cmCPackDebGenerator.h index de1ea77..f536c47 100644 --- a/Source/CPack/cmCPackDebGenerator.h +++ b/Source/CPack/cmCPackDebGenerator.h @@ -34,6 +34,10 @@ public: protected: virtual int InitializeInternal(); /** + * This method factors out the work done in component packaging case. + */ + int PackageOnePack(std::string initialToplevel, std::string packageName); + /** * The method used to package files when component * install is used. This will create one * archive for each component group. @@ -43,7 +47,7 @@ protected: * Special case of component install where all * components will be put in a single installer. */ - int PackageComponentsAllInOne(bool allComponent); + int PackageComponentsAllInOne(); virtual int PackageFiles(); virtual const char* GetOutputExtension() { return ".deb"; } virtual bool SupportsComponentInstallation() const; diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index c343acf..691092f 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -36,7 +36,6 @@ cmCPackGenerator::cmCPackGenerator() this->GeneratorVerbose = false; this->MakefileMap = 0; this->Logger = 0; - this->allGroupInOne = false; this->allComponentInOne = false; this->ignoreComponentGroup = false; } @@ -1266,15 +1265,12 @@ int cmCPackGenerator::PrepareGroupingKind() { // The default behavior is to create 1 package by component group // unless the user asked to put all COMPONENTS in a single package - allGroupInOne = (NULL != - (this->GetOption( - "CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE"))); - allComponentInOne = (NULL != - (this->GetOption( - "CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE"))); - ignoreComponentGroup = (NULL != - (this->GetOption( - "CPACK_COMPONENTS_IGNORE_GROUPS"))); + allComponentInOne = (NULL != (this->GetOption( + "CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE")) + ); + ignoreComponentGroup = (NULL != (this->GetOption( + "CPACK_COMPONENTS_IGNORE_GROUPS")) + ); std::string groupingType; @@ -1288,11 +1284,7 @@ int cmCPackGenerator::PrepareGroupingKind() cmCPackLogger(cmCPackLog::LOG_VERBOSE, "[" << this->Name << "]" << " requested component grouping = "<< groupingType <<std::endl); - if (groupingType == "ALL_GROUPS_IN_ONE") - { - allGroupInOne = true; - } - else if (groupingType == "ALL_COMPONENTS_IN_ONE") + if (groupingType == "ALL_COMPONENTS_IN_ONE") { allComponentInOne = true; } @@ -1305,15 +1297,14 @@ int cmCPackGenerator::PrepareGroupingKind() cmCPackLogger(cmCPackLog::LOG_WARNING, "[" << this->Name << "]" << " requested component grouping type <"<< groupingType - << "> UNKNOWN not in (ALL_GROUPS_IN_ONE," - "ALL_COMPONENTS_IN_ONE,IGNORE)" <<std::endl); + << "> UNKNOWN not in (ALL_COMPONENTS_IN_ONE,IGNORE)" + << std::endl); } } cmCPackLogger(cmCPackLog::LOG_VERBOSE, "[" << this->Name << "]" << " requested component grouping = (" - << "ALL_GROUPS_IN_ONE=" << allGroupInOne << ", ALL_COMPONENTS_IN_ONE=" << allComponentInOne << ", IGNORE_GROUPS=" << ignoreComponentGroup << ")" diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h index 0497d1c..9549d0b 100644 --- a/Source/CPack/cmCPackGenerator.h +++ b/Source/CPack/cmCPackGenerator.h @@ -122,7 +122,6 @@ protected: /** * Prepare requested grouping kind from CPACK_xxx vars - * CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE * CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE * CPACK_COMPONENTS_IGNORE_GROUPS * or @@ -239,10 +238,6 @@ protected: std::map<std::string, cmCPackComponent> Components; std::map<std::string, cmCPackComponentGroup> ComponentGroups; /** - * If true All component groups will be put in a single package. - */ - bool allGroupInOne; - /** * If true All component will be put in a single package. */ bool allComponentInOne; diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx index 0b0c6b1..c926be6 100644 --- a/Source/CPack/cmCPackRPMGenerator.cxx +++ b/Source/CPack/cmCPackRPMGenerator.cxx @@ -50,6 +50,45 @@ int cmCPackRPMGenerator::InitializeInternal() } //---------------------------------------------------------------------- +int cmCPackRPMGenerator::PackageOnePack(std::string initialToplevel, + std::string packageName) +{ + int retval = 1; + // Begin the archive for this pack + std::string localToplevel(initialToplevel); + std::string packageFileName( + cmSystemTools::GetParentDirectory(toplevel.c_str()) + ); + std::string outputFileName( + GetComponentPackageFileName(this->GetOption("CPACK_PACKAGE_FILE_NAME"), + packageName, + true) + + this->GetOutputExtension() + ); + + localToplevel += "/"+ packageName; + /* replace the TEMP DIRECTORY with the component one */ + this->SetOption("CPACK_TEMPORARY_DIRECTORY",localToplevel.c_str()); + packageFileName += "/"+ outputFileName; + /* replace proposed CPACK_OUTPUT_FILE_NAME */ + this->SetOption("CPACK_OUTPUT_FILE_NAME",outputFileName.c_str()); + /* replace the TEMPORARY package file name */ + this->SetOption("CPACK_TEMPORARY_PACKAGE_FILE_NAME", + packageFileName.c_str()); + // Tell CPackRPM.cmake the name of the component NAME. + this->SetOption("CPACK_RPM_PACKAGE_COMPONENT",packageName.c_str()); + if (!this->ReadListFile("CPackRPM.cmake")) + { + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Error while execution CPackRPM.cmake" << std::endl); + retval = 0; + } + // add the generated package to package file names list + packageFileNames.push_back(packageFileName); + return retval; +} + +//---------------------------------------------------------------------- int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup) { int retval = 1; @@ -69,37 +108,23 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup) cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Packaging component group: " << compGIt->first << std::endl); - // Begin the archive for this group - std::string localToplevel(initialTopLevel); - std::string packageFileName( - cmSystemTools::GetParentDirectory(toplevel.c_str()) - ); - std::string outputFileName( - GetComponentPackageFileName(this->GetOption("CPACK_PACKAGE_FILE_NAME"), - compGIt->first, - true) - + this->GetOutputExtension() - ); - - localToplevel += "/"+ compGIt->first; - /* replace the TEMP DIRECTORY with the component one */ - this->SetOption("CPACK_TEMPORARY_DIRECTORY",localToplevel.c_str()); - packageFileName += "/"+ outputFileName; - /* replace proposed CPACK_OUTPUT_FILE_NAME */ - this->SetOption("CPACK_OUTPUT_FILE_NAME",outputFileName.c_str()); - /* replace the TEMPORARY package file name */ - this->SetOption("CPACK_TEMPORARY_PACKAGE_FILE_NAME", - packageFileName.c_str()); - // Tell CPackRPM.cmake the name of the component GROUP. - this->SetOption("CPACK_RPM_PACKAGE_COMPONENT",compGIt->first.c_str()); - if (!this->ReadListFile("CPackRPM.cmake")) + retval &= PackageOnePack(initialTopLevel,compGIt->first); + } + // Handle Orphan components (components not belonging to any groups) + std::map<std::string, cmCPackComponent>::iterator compIt; + for (compIt=this->Components.begin(); + compIt!=this->Components.end(); ++compIt ) + { + // Does the component belong to a group? + if (compIt->second.Group==NULL) { - cmCPackLogger(cmCPackLog::LOG_ERROR, - "Error while execution CPackRPM.cmake" << std::endl); - retval = 0; + cmCPackLogger(cmCPackLog::LOG_VERBOSE, + "Component <" + << compIt->second.Name + << "> does not belong to any group, package it separately." + << std::endl); + retval &= PackageOnePack(initialTopLevel,compIt->first); } - // add the generated package to package file names list - packageFileNames.push_back(packageFileName); } } // CPACK_COMPONENTS_IGNORE_GROUPS is set @@ -110,42 +135,14 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup) for (compIt=this->Components.begin(); compIt!=this->Components.end(); ++compIt ) { - std::string localToplevel(initialTopLevel); - std::string packageFileName( - cmSystemTools::GetParentDirectory(toplevel.c_str()) - ); - std::string outputFileName( - GetComponentPackageFileName(this->GetOption("CPACK_PACKAGE_FILE_NAME"), - compIt->first, - false) - + this->GetOutputExtension()); - - localToplevel += "/"+ compIt->first; - /* replace the TEMP DIRECTORY with the component one */ - this->SetOption("CPACK_TEMPORARY_DIRECTORY",localToplevel.c_str()); - packageFileName += "/"+ outputFileName; - /* replace proposed CPACK_OUTPUT_FILE_NAME */ - this->SetOption("CPACK_OUTPUT_FILE_NAME",outputFileName.c_str()); - /* replace the TEMPORARY package file name */ - this->SetOption("CPACK_TEMPORARY_PACKAGE_FILE_NAME", - packageFileName.c_str()); - - this->SetOption("CPACK_RPM_PACKAGE_COMPONENT",compIt->first.c_str()); - if (!this->ReadListFile("CPackRPM.cmake")) - { - cmCPackLogger(cmCPackLog::LOG_ERROR, - "Error while execution CPackRPM.cmake" << std::endl); - retval = 0; - } - // add the generated package to package file names list - packageFileNames.push_back(packageFileName); + retval &= PackageOnePack(initialTopLevel,compIt->first); } } return retval; } //---------------------------------------------------------------------- -int cmCPackRPMGenerator::PackageComponentsAllInOne(bool allComponent) +int cmCPackRPMGenerator::PackageComponentsAllInOne() { int retval = 1; std::string compInstDirName; @@ -154,15 +151,7 @@ int cmCPackRPMGenerator::PackageComponentsAllInOne(bool allComponent) packageFileNames.clear(); std::string initialTopLevel(this->GetOption("CPACK_TEMPORARY_DIRECTORY")); - // all GROUP in one vs all COMPONENT in one - if (allComponent) - { - compInstDirName = "ALL_COMPONENTS_IN_ONE"; - } - else - { - compInstDirName = "ALL_GROUPS_IN_ONE"; - } + compInstDirName = "ALL_COMPONENTS_IN_ONE"; cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Packaging all groups in one package..." @@ -214,19 +203,17 @@ int cmCPackRPMGenerator::PackageFiles() /* Are we in the component packaging case */ if (SupportsComponentInstallation()) { // CASE 1 : COMPONENT ALL-IN-ONE package - // If ALL GROUPS or ALL COMPONENTS in ONE package has been requested + // If ALL COMPONENTS in ONE package has been requested // then the package file is unique and should be open here. - if (allComponentInOne || - (allGroupInOne && (!this->ComponentGroups.empty())) - ) + if (allComponentInOne) { - return PackageComponentsAllInOne(allComponentInOne); + return PackageComponentsAllInOne(); } // CASE 2 : COMPONENT CLASSICAL package(s) (i.e. not all-in-one) // There will be 1 package for each component group // however one may require to ignore component group and // in this case you'll get 1 package for each component. - else if ((!this->ComponentGroups.empty()) || (ignoreComponentGroup)) + else { return PackageComponents(ignoreComponentGroup); } @@ -278,14 +265,7 @@ std::string cmCPackRPMGenerator::GetComponentInstallDirNameSuffix( cmSystemTools::UpperCase(componentName) + "_GROUP"; if (NULL != GetOption(groupVar.c_str())) { - if (allGroupInOne) - { - return std::string("ALL_GROUPS_IN_ONE"); - } - else - { - return std::string(GetOption(groupVar.c_str())); - } + return std::string(GetOption(groupVar.c_str())); } else { diff --git a/Source/CPack/cmCPackRPMGenerator.h b/Source/CPack/cmCPackRPMGenerator.h index 7c2e434..4883a0d 100644 --- a/Source/CPack/cmCPackRPMGenerator.h +++ b/Source/CPack/cmCPackRPMGenerator.h @@ -39,6 +39,10 @@ protected: virtual int InitializeInternal(); virtual int PackageFiles(); /** + * This method factors out the work done in component packaging case. + */ + int PackageOnePack(std::string initialToplevel, std::string packageName); + /** * The method used to package files when component * install is used. This will create one * archive for each component group. @@ -48,7 +52,7 @@ protected: * Special case of component install where all * components will be put in a single installer. */ - int PackageComponentsAllInOne(bool allComponent); + int PackageComponentsAllInOne(); virtual const char* GetOutputExtension() { return ".rpm"; } virtual bool SupportsComponentInstallation() const; virtual std::string GetComponentInstallDirNameSuffix( diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index 8710dfc..f88ab0b 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -23,7 +23,7 @@ cmGeneratorExpression::cmGeneratorExpression( this->TargetInfo.compile("^\\$<TARGET" "(|_SONAME|_LINKER)" // File with what purpose? "_FILE(|_NAME|_DIR):" // Filename component. - "([A-Za-z0-9_-]+)" // Target name. + "([A-Za-z0-9_.-]+)" // Target name. ">$"); } diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index d47fb6f..6c8938e 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -903,8 +903,6 @@ void cmGlobalGenerator::Generate() } this->CMakeInstance->UpdateProgress("Generating done", -1); - - this->CMakeInstance->RunCheckForUnusedVariables("generation"); } //---------------------------------------------------------------------------- diff --git a/Source/cmIncludeDirectoryCommand.h b/Source/cmIncludeDirectoryCommand.h index d00f843..3b35d55 100644 --- a/Source/cmIncludeDirectoryCommand.h +++ b/Source/cmIncludeDirectoryCommand.h @@ -61,7 +61,7 @@ public: "Add the given directories to those searched by the compiler for " "include files. By default the directories are appended onto " "the current list of directories. This default behavior can be " - "changed by setting CMAKE_include_directories_BEFORE to ON. " + "changed by setting CMAKE_INCLUDE_DIRECTORIES_BEFORE to ON. " "By using BEFORE or AFTER you can select between appending and " "prepending, independent from the default. " "If the SYSTEM option is given the compiler will be told that the " diff --git a/Source/cmake.cxx b/Source/cmake.cxx index ea8cdfd..4eef7dd 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -2346,11 +2346,6 @@ int cmake::Run(const std::vector<std::string>& args, bool noconfigure) std::string oldstartoutputdir = this->GetStartOutputDirectory(); this->SetStartDirectory(this->GetHomeDirectory()); this->SetStartOutputDirectory(this->GetHomeOutputDirectory()); - const bool warncli = this->WarnUnusedCli; - if (!this->ScriptMode) - { - this->WarnUnusedCli = false; - } int ret = this->Configure(); if (ret || this->ScriptMode) { @@ -2372,7 +2367,6 @@ int cmake::Run(const std::vector<std::string>& args, bool noconfigure) #endif return ret; } - this->WarnUnusedCli = warncli; ret = this->Generate(); std::string message = "Build files have been written to: "; message += this->GetHomeOutputDirectory(); @@ -2394,6 +2388,10 @@ int cmake::Generate() return -1; } this->GlobalGenerator->Generate(); + if(this->WarnUnusedCli) + { + this->RunCheckForUnusedVariables(); + } if(cmSystemTools::GetErrorOccuredFlag()) { return -1; @@ -4347,7 +4345,10 @@ void cmake::WatchUnusedCli(const char* var) { #ifdef CMAKE_BUILD_WITH_CMAKE this->VariableWatch->AddWatch(var, cmWarnUnusedCliWarning, this); - this->UsedCliVariables[var] = false; + if(this->UsedCliVariables.find(var) == this->UsedCliVariables.end()) + { + this->UsedCliVariables[var] = false; + } #endif } @@ -4355,27 +4356,29 @@ void cmake::UnwatchUnusedCli(const char* var) { #ifdef CMAKE_BUILD_WITH_CMAKE this->VariableWatch->RemoveWatch(var, cmWarnUnusedCliWarning); - this->UsedCliVariables[var] = true; + this->UsedCliVariables.erase(var); #endif } -void cmake::RunCheckForUnusedVariables(const std::string& reason) const +void cmake::RunCheckForUnusedVariables() { #ifdef CMAKE_BUILD_WITH_CMAKE - if(this->WarnUnusedCli) + bool haveUnused = false; + cmOStringStream msg; + msg << "Manually-specified variables were not used by the project:"; + for(std::map<cmStdString, bool>::const_iterator + it = this->UsedCliVariables.begin(); + it != this->UsedCliVariables.end(); ++it) + { + if(!it->second) { - std::map<std::string, bool>::const_iterator it; - for(it = this->UsedCliVariables.begin(); - it != this->UsedCliVariables.end(); ++it) - { - if(!it->second) - { - std::string message = "CMake Warning: The variable, '" + it->first + - "', specified manually, was not used during the " + reason + - "."; - cmSystemTools::Message(message.c_str()); - } - } + haveUnused = true; + msg << "\n " << it->first; } + } + if(haveUnused) + { + this->IssueMessage(cmake::WARNING, msg.str(), cmListFileBacktrace()); + } #endif } diff --git a/Source/cmake.h b/Source/cmake.h index 132a86d..fac86c1 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -368,8 +368,8 @@ class cmake void UnwatchUnusedCli(const char* var); void WatchUnusedCli(const char* var); - void RunCheckForUnusedVariables(const std::string& reason) const; protected: + void RunCheckForUnusedVariables(); void InitializeProperties(); int HandleDeleteCacheVariables(const char* var); cmPropertyMap Properties; @@ -467,7 +467,7 @@ private: bool WarnUnused; bool WarnUnusedCli; bool CheckSystemVars; - std::map<std::string, bool> UsedCliVariables; + std::map<cmStdString, bool> UsedCliVariables; std::string CMakeEditCommand; std::string CMakeCommand; std::string CXXEnvironment; diff --git a/Source/kwsys/Terminal.c b/Source/kwsys/Terminal.c index 3bf2579..7a3266f 100644 --- a/Source/kwsys/Terminal.c +++ b/Source/kwsys/Terminal.c @@ -160,6 +160,7 @@ static const char* kwsysTerminalVT100Names[] = "rxvt-cygwin", "rxvt-cygwin-native", "rxvt-unicode", + "rxvt-unicode-256color", "screen", "screen-256color", "screen-bce", diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 78ba3c1..e2e7d02 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 03) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 24) +SET(KWSYS_DATE_STAMP_DAY 31) |