summaryrefslogtreecommitdiffstats
path: root/Source/cmFLTKWrapUICommand.cxx
diff options
context:
space:
mode:
authorKitware Robot <kwrobot@kitware.com>2016-05-16 14:34:04 (GMT)
committerBrad King <brad.king@kitware.com>2016-05-16 20:05:19 (GMT)
commitd9fd2f5402eeaa345691313658e02b51038f570b (patch)
treedca71b9a7e267f4c6300da3eb770415381726785 /Source/cmFLTKWrapUICommand.cxx
parent82df6deaafb36cbbfd450202bb20b320f637751a (diff)
downloadCMake-d9fd2f5402eeaa345691313658e02b51038f570b.zip
CMake-d9fd2f5402eeaa345691313658e02b51038f570b.tar.gz
CMake-d9fd2f5402eeaa345691313658e02b51038f570b.tar.bz2
Revise C++ coding style using clang-format
Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
Diffstat (limited to 'Source/cmFLTKWrapUICommand.cxx')
-rw-r--r--Source/cmFLTKWrapUICommand.cxx75
1 files changed, 32 insertions, 43 deletions
diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx
index c64e813..ebd6223 100644
--- a/Source/cmFLTKWrapUICommand.cxx
+++ b/Source/cmFLTKWrapUICommand.cxx
@@ -14,14 +14,13 @@
#include "cmSourceFile.h"
// cmFLTKWrapUICommand
-bool cmFLTKWrapUICommand
-::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &)
+bool cmFLTKWrapUICommand::InitialPass(std::vector<std::string> const& args,
+ cmExecutionStatus&)
{
- if(args.size() < 2 )
- {
+ if (args.size() < 2) {
this->SetError("called with incorrect number of arguments");
return false;
- }
+ }
// what is the current source dir
std::string cdir = this->Makefile->GetCurrentSourceDirectory();
@@ -29,27 +28,25 @@ bool cmFLTKWrapUICommand
this->Makefile->GetRequiredDefinition("FLTK_FLUID_EXECUTABLE");
// get parameter for the command
- this->Target = args[0]; // Target that will use the generated files
+ this->Target = args[0]; // Target that will use the generated files
// get the list of GUI files from which .cxx and .h will be generated
std::string outputDirectory = this->Makefile->GetCurrentBinaryDirectory();
{
- // Some of the generated files are *.h so the directory "GUI"
- // where they are created have to be added to the include path
- std::vector<std::string> outputDirectories;
- outputDirectories.push_back(outputDirectory);
- this->Makefile->AddIncludeDirectories( outputDirectories );
+ // Some of the generated files are *.h so the directory "GUI"
+ // where they are created have to be added to the include path
+ std::vector<std::string> outputDirectories;
+ outputDirectories.push_back(outputDirectory);
+ this->Makefile->AddIncludeDirectories(outputDirectories);
}
- for(std::vector<std::string>::const_iterator i = (args.begin() + 1);
- i != args.end(); i++)
- {
- cmSourceFile *curr = this->Makefile->GetSource(*i);
+ for (std::vector<std::string>::const_iterator i = (args.begin() + 1);
+ i != args.end(); i++) {
+ cmSourceFile* curr = this->Makefile->GetSource(*i);
// if we should use the source GUI
// to generate .cxx and .h files
- if (!curr || !curr->GetPropertyAsBool("WRAP_EXCLUDE"))
- {
+ if (!curr || !curr->GetPropertyAsBool("WRAP_EXCLUDE")) {
std::string outName = outputDirectory;
outName += "/";
outName += cmSystemTools::GetFilenameWithoutExtension(*i);
@@ -70,7 +67,7 @@ bool cmFLTKWrapUICommand
commandLine.push_back(hname);
commandLine.push_back("-o"); // optionally rename .cxx files
commandLine.push_back(cxxres);
- commandLine.push_back(origname);// name of the GUI fluid file
+ commandLine.push_back(origname); // name of the GUI fluid file
cmCustomCommandLines commandLines;
commandLines.push_back(commandLine);
@@ -78,33 +75,29 @@ bool cmFLTKWrapUICommand
std::string no_main_dependency = "";
const char* no_comment = 0;
const char* no_working_dir = 0;
- this->Makefile->AddCustomCommandToOutput(cxxres,
- depends, no_main_dependency,
- commandLines, no_comment,
- no_working_dir);
- this->Makefile->AddCustomCommandToOutput(hname,
- depends, no_main_dependency,
- commandLines, no_comment,
- no_working_dir);
-
- cmSourceFile *sf = this->Makefile->GetSource(cxxres);
+ this->Makefile->AddCustomCommandToOutput(
+ cxxres, depends, no_main_dependency, commandLines, no_comment,
+ no_working_dir);
+ this->Makefile->AddCustomCommandToOutput(
+ hname, depends, no_main_dependency, commandLines, no_comment,
+ no_working_dir);
+
+ cmSourceFile* sf = this->Makefile->GetSource(cxxres);
sf->AddDepend(hname.c_str());
sf->AddDepend(origname.c_str());
this->GeneratedSourcesClasses.push_back(sf);
- }
}
+ }
// create the variable with the list of sources in it
size_t lastHeadersClass = this->GeneratedSourcesClasses.size();
std::string sourceListValue;
- for(size_t classNum = 0; classNum < lastHeadersClass; classNum++)
- {
- if (classNum)
- {
+ for (size_t classNum = 0; classNum < lastHeadersClass; classNum++) {
+ if (classNum) {
sourceListValue += ";";
- }
- sourceListValue += this->GeneratedSourcesClasses[classNum]->GetFullPath();
}
+ sourceListValue += this->GeneratedSourcesClasses[classNum]->GetFullPath();
+ }
std::string varName = this->Target;
varName += "_FLTK_UI_SRCS";
this->Makefile->AddDefinition(varName, sourceListValue.c_str());
@@ -118,18 +111,14 @@ void cmFLTKWrapUICommand::FinalPass()
// didn't support that, so check and see if they added the files in and if
// they didn;t then print a warning and add then anyhow
cmTarget* target = this->Makefile->FindLocalNonAliasTarget(this->Target);
- if(!target)
- {
+ if (!target) {
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: ";
+ msg += ". The problem was found while processing the source directory: ";
msg += this->Makefile->GetCurrentSourceDirectory();
msg += ". This FLTK_WRAP_UI call will be ignored.";
- cmSystemTools::Message(msg.c_str(),"Warning");
+ cmSystemTools::Message(msg.c_str(), "Warning");
return;
- }
+ }
}
-
-
-