From 01ddef87e650a7b0efb8cf81d1500e5bb9fd6eb8 Mon Sep 17 00:00:00 2001 From: "Yury G. Kudryashov" Date: Tue, 17 Jan 2012 18:53:48 +0400 Subject: [PATCH 1/3] cmInstallCommand: Fix indentation error A large block of code was indented 2 spaces less than it should. --- Source/cmInstallCommand.cxx | 200 ++++++++++++++++++------------------ 1 file changed, 100 insertions(+), 100 deletions(-) diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index 14deb24d4..ddc2a94c1 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -350,33 +350,33 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) targetIt!=targetList.GetVector().end(); ++targetIt) { - // Lookup this target in the current directory. - if(cmTarget* target=this->Makefile->FindTarget(targetIt->c_str())) + // Lookup this target in the current directory. + if(cmTarget* target=this->Makefile->FindTarget(targetIt->c_str())) + { + // Found the target. Check its type. + if(target->GetType() != cmTarget::EXECUTABLE && + target->GetType() != cmTarget::STATIC_LIBRARY && + target->GetType() != cmTarget::SHARED_LIBRARY && + target->GetType() != cmTarget::MODULE_LIBRARY) { - // Found the target. Check its type. - if(target->GetType() != cmTarget::EXECUTABLE && - target->GetType() != cmTarget::STATIC_LIBRARY && - target->GetType() != cmTarget::SHARED_LIBRARY && - target->GetType() != cmTarget::MODULE_LIBRARY) - { - cmOStringStream e; - e << "TARGETS given target \"" << (*targetIt) - << "\" which is not an executable, library, or module."; - this->SetError(e.str().c_str()); - return false; - } - // Store the target in the list to be installed. - targets.push_back(target); - } - else - { - // Did not find the target. cmOStringStream e; e << "TARGETS given target \"" << (*targetIt) - << "\" which does not exist in this directory."; + << "\" which is not an executable, library, or module."; this->SetError(e.str().c_str()); return false; } + // Store the target in the list to be installed. + targets.push_back(target); + } + else + { + // Did not find the target. + cmOStringStream e; + e << "TARGETS given target \"" << (*targetIt) + << "\" which does not exist in this directory."; + this->SetError(e.str().c_str()); + return false; + } } // Keep track of whether we will be performing an installation of @@ -602,99 +602,99 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) break; } - // These well-known sets of files are installed *automatically* for FRAMEWORK - // SHARED library targets on the Mac as part of installing the FRAMEWORK. - // For other target types or on other platforms, they are not installed - // automatically and so we need to create install files generators for them. - // - bool createInstallGeneratorsForTargetFileSets = true; + // These well-known sets of files are installed *automatically* for FRAMEWORK + // SHARED library targets on the Mac as part of installing the FRAMEWORK. + // For other target types or on other platforms, they are not installed + // automatically and so we need to create install files generators for them. + // + bool createInstallGeneratorsForTargetFileSets = true; - if(target.IsFrameworkOnApple()) - { - createInstallGeneratorsForTargetFileSets = false; - } - - if(createInstallGeneratorsForTargetFileSets && !namelinkOnly) - { - const char* files = target.GetProperty("PRIVATE_HEADER"); - if ((files) && (*files)) + if(target.IsFrameworkOnApple()) { - std::vector relFiles; - cmSystemTools::ExpandListArgument(files, relFiles); - std::vector absFiles; - if (!this->MakeFilesFullPath("PRIVATE_HEADER", relFiles, absFiles)) - { - return false; - } - - // Create the files install generator. - if (!privateHeaderArgs.GetDestination().empty()) - { - privateHeaderGenerator = CreateInstallFilesGenerator(absFiles, - privateHeaderArgs, false); - } - else - { - cmOStringStream e; - e << "INSTALL TARGETS - target " << target.GetName() << " has " - << "PRIVATE_HEADER files but no PRIVATE_HEADER DESTINATION."; - cmSystemTools::Message(e.str().c_str(), "Warning"); - } + createInstallGeneratorsForTargetFileSets = false; } - files = target.GetProperty("PUBLIC_HEADER"); - if ((files) && (*files)) + if(createInstallGeneratorsForTargetFileSets && !namelinkOnly) { - std::vector relFiles; - cmSystemTools::ExpandListArgument(files, relFiles); - std::vector absFiles; - if (!this->MakeFilesFullPath("PUBLIC_HEADER", relFiles, absFiles)) + const char* files = target.GetProperty("PRIVATE_HEADER"); + if ((files) && (*files)) { - return false; + std::vector relFiles; + cmSystemTools::ExpandListArgument(files, relFiles); + std::vector absFiles; + if (!this->MakeFilesFullPath("PRIVATE_HEADER", relFiles, absFiles)) + { + return false; + } + + // Create the files install generator. + if (!privateHeaderArgs.GetDestination().empty()) + { + privateHeaderGenerator = CreateInstallFilesGenerator(absFiles, + privateHeaderArgs, false); + } + else + { + cmOStringStream e; + e << "INSTALL TARGETS - target " << target.GetName() << " has " + << "PRIVATE_HEADER files but no PRIVATE_HEADER DESTINATION."; + cmSystemTools::Message(e.str().c_str(), "Warning"); + } } - // Create the files install generator. - if (!publicHeaderArgs.GetDestination().empty()) + files = target.GetProperty("PUBLIC_HEADER"); + if ((files) && (*files)) { - publicHeaderGenerator = CreateInstallFilesGenerator(absFiles, - publicHeaderArgs, false); + std::vector relFiles; + cmSystemTools::ExpandListArgument(files, relFiles); + std::vector absFiles; + if (!this->MakeFilesFullPath("PUBLIC_HEADER", relFiles, absFiles)) + { + return false; + } + + // Create the files install generator. + if (!publicHeaderArgs.GetDestination().empty()) + { + publicHeaderGenerator = CreateInstallFilesGenerator(absFiles, + publicHeaderArgs, false); + } + else + { + cmOStringStream e; + e << "INSTALL TARGETS - target " << target.GetName() << " has " + << "PUBLIC_HEADER files but no PUBLIC_HEADER DESTINATION."; + cmSystemTools::Message(e.str().c_str(), "Warning"); + } } - else + + files = target.GetProperty("RESOURCE"); + if ((files) && (*files)) { - cmOStringStream e; - e << "INSTALL TARGETS - target " << target.GetName() << " has " - << "PUBLIC_HEADER files but no PUBLIC_HEADER DESTINATION."; - cmSystemTools::Message(e.str().c_str(), "Warning"); + std::vector relFiles; + cmSystemTools::ExpandListArgument(files, relFiles); + std::vector absFiles; + if (!this->MakeFilesFullPath("RESOURCE", relFiles, absFiles)) + { + return false; + } + + // Create the files install generator. + if (!resourceArgs.GetDestination().empty()) + { + resourceGenerator = CreateInstallFilesGenerator(absFiles, + resourceArgs, false); + } + else + { + cmOStringStream e; + e << "INSTALL TARGETS - target " << target.GetName() << " has " + << "RESOURCE files but no RESOURCE DESTINATION."; + cmSystemTools::Message(e.str().c_str(), "Warning"); + } } } - files = target.GetProperty("RESOURCE"); - if ((files) && (*files)) - { - std::vector relFiles; - cmSystemTools::ExpandListArgument(files, relFiles); - std::vector absFiles; - if (!this->MakeFilesFullPath("RESOURCE", relFiles, absFiles)) - { - return false; - } - - // Create the files install generator. - if (!resourceArgs.GetDestination().empty()) - { - resourceGenerator = CreateInstallFilesGenerator(absFiles, - resourceArgs, false); - } - else - { - cmOStringStream e; - e << "INSTALL TARGETS - target " << target.GetName() << " has " - << "RESOURCE files but no RESOURCE DESTINATION."; - cmSystemTools::Message(e.str().c_str(), "Warning"); - } - } - } - // Keep track of whether we're installing anything in each category installsArchive = installsArchive || archiveGenerator != 0; installsLibrary = installsLibrary || libraryGenerator != 0; From a64b6185de82ec3c4f686748d2244810890cddd1 Mon Sep 17 00:00:00 2001 From: "Yury G. Kudryashov" Date: Tue, 17 Jan 2012 18:54:49 +0400 Subject: [PATCH 2/3] cmInstallCommand: Remove duplicated sentence from docs install(TARGETS ...) documentation described twice what happens on non-DLL systems. --- Source/cmInstallCommand.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Source/cmInstallCommand.h b/Source/cmInstallCommand.h index 8f6232272..377b43af8 100644 --- a/Source/cmInstallCommand.h +++ b/Source/cmInstallCommand.h @@ -168,9 +168,7 @@ public: "On non-DLL platforms mySharedLib will be installed to /lib " "and /some/full/path. On DLL platforms the mySharedLib DLL will be " "installed to /bin and /some/full/path and its import library " - "will be installed to /lib/static and /some/full/path. " - "On non-DLL platforms mySharedLib will be installed to /lib " - "and /some/full/path." + "will be installed to /lib/static and /some/full/path." "\n" "The EXPORT option associates the installed target files with an " "export called . " From 982b5d9eef0b8224c425d60539c3b1fd665062b6 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 17 Jan 2012 14:03:45 -0500 Subject: [PATCH 3/3] cmInstallCommand: Fix line length for style After indentation was fixed by a previous commit some lines became too long. Re-wrap to shorten them. --- Source/cmInstallCommand.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index ddc2a94c1..dca528d26 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -602,11 +602,11 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) break; } - // These well-known sets of files are installed *automatically* for FRAMEWORK - // SHARED library targets on the Mac as part of installing the FRAMEWORK. - // For other target types or on other platforms, they are not installed - // automatically and so we need to create install files generators for them. - // + // These well-known sets of files are installed *automatically* for + // FRAMEWORK SHARED library targets on the Mac as part of installing the + // FRAMEWORK. For other target types or on other platforms, they are not + // installed automatically and so we need to create install files + // generators for them. bool createInstallGeneratorsForTargetFileSets = true; if(target.IsFrameworkOnApple()) @@ -630,8 +630,8 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) // Create the files install generator. if (!privateHeaderArgs.GetDestination().empty()) { - privateHeaderGenerator = CreateInstallFilesGenerator(absFiles, - privateHeaderArgs, false); + privateHeaderGenerator = + CreateInstallFilesGenerator(absFiles, privateHeaderArgs, false); } else { @@ -656,8 +656,8 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) // Create the files install generator. if (!publicHeaderArgs.GetDestination().empty()) { - publicHeaderGenerator = CreateInstallFilesGenerator(absFiles, - publicHeaderArgs, false); + publicHeaderGenerator = + CreateInstallFilesGenerator(absFiles, publicHeaderArgs, false); } else {