summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-09-24 18:07:45 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-10-24 07:14:12 (GMT)
commit5c058c8f12742dcb96b2e22b43208f345a865fbf (patch)
tree2b9b1bf846d1a718cbdcb26fce2a9a36dd99e170 /Source
parenta25c440f195e0ebc3f812c5e68f7f9a7546f249d (diff)
downloadCMake-5c058c8f12742dcb96b2e22b43208f345a865fbf.zip
CMake-5c058c8f12742dcb96b2e22b43208f345a865fbf.tar.gz
CMake-5c058c8f12742dcb96b2e22b43208f345a865fbf.tar.bz2
Rename the cmQtAutomoc class to cmQtAutoGenerators.
It will be extended to process .ui and .qrc files too.
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeLists.txt4
-rw-r--r--Source/cmGlobalGenerator.cxx14
-rw-r--r--Source/cmGlobalGenerator.h2
-rw-r--r--Source/cmQtAutoGenerators.cxx (renamed from Source/cmQtAutomoc.cxx)46
-rw-r--r--Source/cmQtAutoGenerators.h (renamed from Source/cmQtAutomoc.h)10
-rw-r--r--Source/cmcmd.cxx4
6 files changed, 42 insertions, 38 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 01e4f88..e13a304 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -250,8 +250,8 @@ set(SRCS
cmPropertyDefinitionMap.h
cmPropertyMap.cxx
cmPropertyMap.h
- cmQtAutomoc.cxx
- cmQtAutomoc.h
+ cmQtAutoGenerators.cxx
+ cmQtAutoGenerators.h
cmRST.cxx
cmRST.h
cmScriptGenerator.h
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index fb205be..f92fe60 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -18,7 +18,7 @@
#include "cmExternalMakefileProjectGenerator.h"
#include "cmake.h"
#include "cmMakefile.h"
-#include "cmQtAutomoc.h"
+#include "cmQtAutoGenerators.h"
#include "cmSourceFile.h"
#include "cmVersion.h"
#include "cmTargetExport.h"
@@ -1049,8 +1049,8 @@ void cmGlobalGenerator::Generate()
}
// Iterate through all targets and set up automoc for those which have
- // the AUTOMOC property set
- this->CreateAutomocTargets();
+ // the AUTOMOC, AUTOUIC or AUTORCC property set
+ this->CreateQtAutoGeneratorsTargets();
// For each existing cmLocalGenerator
unsigned int i;
@@ -1206,10 +1206,10 @@ bool cmGlobalGenerator::CheckTargets()
}
//----------------------------------------------------------------------------
-void cmGlobalGenerator::CreateAutomocTargets()
+void cmGlobalGenerator::CreateQtAutoGeneratorsTargets()
{
#ifdef CMAKE_BUILD_WITH_CMAKE
- typedef std::vector<std::pair<cmQtAutomoc, cmTarget*> > Automocs;
+ typedef std::vector<std::pair<cmQtAutoGenerators, cmTarget*> > Automocs;
Automocs automocs;
for(unsigned int i=0; i < this->LocalGenerators.size(); ++i)
{
@@ -1227,7 +1227,7 @@ void cmGlobalGenerator::CreateAutomocTargets()
{
if(target.GetPropertyAsBool("AUTOMOC") && !target.IsImported())
{
- cmQtAutomoc automoc;
+ cmQtAutoGenerators automoc;
if(automoc.InitializeMocSourceFile(&target))
{
automocs.push_back(std::make_pair(automoc, &target));
@@ -1239,7 +1239,7 @@ void cmGlobalGenerator::CreateAutomocTargets()
for (Automocs::iterator it = automocs.begin(); it != automocs.end();
++it)
{
- it->first.SetupAutomocTarget(it->second);
+ it->first.SetupAutoGenerateTarget(it->second);
}
#endif
}
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index c930b2b..773da38 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -319,7 +319,7 @@ protected:
virtual bool CheckALLOW_DUPLICATE_CUSTOM_TARGETS();
bool CheckTargets();
- void CreateAutomocTargets();
+ void CreateQtAutoGeneratorsTargets();
// Fill the ProjectMap, this must be called after LocalGenerators
diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutoGenerators.cxx
index 651e0ad..24f4498 100644
--- a/Source/cmQtAutomoc.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -29,7 +29,7 @@
#include <unistd.h>
#endif
-#include "cmQtAutomoc.h"
+#include "cmQtAutoGenerators.h"
static bool requiresMocing(const std::string& text, std::string &macroName)
@@ -113,7 +113,7 @@ static void copyTargetProperty(cmTarget* destinationTarget,
}
-cmQtAutomoc::cmQtAutomoc()
+cmQtAutoGenerators::cmQtAutoGenerators()
:Verbose(cmsys::SystemTools::GetEnv("VERBOSE") != 0)
,ColorOutput(true)
,RunMocFailed(false)
@@ -135,7 +135,7 @@ cmQtAutomoc::cmQtAutomoc()
}
}
-bool cmQtAutomoc::InitializeMocSourceFile(cmTarget* target)
+bool cmQtAutoGenerators::InitializeMocSourceFile(cmTarget* target)
{
cmMakefile* makefile = target->GetMakefile();
// don't do anything if there is no Qt4 or Qt5Core (which contains moc):
@@ -201,7 +201,7 @@ static void GetCompileDefinitionsAndDirectories(cmTarget *target,
}
}
-void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
+void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
{
cmMakefile* makefile = target->GetMakefile();
const char* targetName = target->GetName();
@@ -466,7 +466,7 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
}
-bool cmQtAutomoc::Run(const char* targetDirectory, const char *config)
+bool cmQtAutoGenerators::Run(const char* targetDirectory, const char *config)
{
bool success = true;
cmake cm;
@@ -492,7 +492,7 @@ bool cmQtAutomoc::Run(const char* targetDirectory, const char *config)
}
-cmGlobalGenerator* cmQtAutomoc::CreateGlobalGenerator(cmake* cm,
+cmGlobalGenerator* cmQtAutoGenerators::CreateGlobalGenerator(cmake* cm,
const char* targetDirectory)
{
cmGlobalGenerator* gg = new cmGlobalGenerator();
@@ -509,7 +509,7 @@ cmGlobalGenerator* cmQtAutomoc::CreateGlobalGenerator(cmake* cm,
}
-bool cmQtAutomoc::ReadAutomocInfoFile(cmMakefile* makefile,
+bool cmQtAutoGenerators::ReadAutomocInfoFile(cmMakefile* makefile,
const char* targetDirectory,
const char *config)
{
@@ -569,7 +569,7 @@ bool cmQtAutomoc::ReadAutomocInfoFile(cmMakefile* makefile,
}
-std::string cmQtAutomoc::MakeCompileSettingsString(cmMakefile* makefile)
+std::string cmQtAutoGenerators::MakeCompileSettingsString(cmMakefile* makefile)
{
std::string s;
s += makefile->GetSafeDefinition("AM_MOC_COMPILE_DEFINITIONS");
@@ -586,7 +586,7 @@ std::string cmQtAutomoc::MakeCompileSettingsString(cmMakefile* makefile)
}
-bool cmQtAutomoc::ReadOldMocDefinitionsFile(cmMakefile* makefile,
+bool cmQtAutoGenerators::ReadOldMocDefinitionsFile(cmMakefile* makefile,
const char* targetDirectory)
{
std::string filename(cmSystemTools::CollapseFullPath(targetDirectory));
@@ -602,7 +602,8 @@ bool cmQtAutomoc::ReadOldMocDefinitionsFile(cmMakefile* makefile,
}
-void cmQtAutomoc::WriteOldMocDefinitionsFile(const char* targetDirectory)
+void
+cmQtAutoGenerators::WriteOldMocDefinitionsFile(const char* targetDirectory)
{
std::string filename(cmSystemTools::CollapseFullPath(targetDirectory));
cmSystemTools::ConvertToUnixSlashes(filename);
@@ -619,7 +620,7 @@ void cmQtAutomoc::WriteOldMocDefinitionsFile(const char* targetDirectory)
}
-void cmQtAutomoc::Init()
+void cmQtAutoGenerators::Init()
{
this->OutMocCppFilename = this->Builddir;
this->OutMocCppFilename += this->TargetName;
@@ -706,7 +707,7 @@ void cmQtAutomoc::Init()
}
-bool cmQtAutomoc::RunAutomoc(cmMakefile* makefile)
+bool cmQtAutoGenerators::RunAutomoc(cmMakefile* makefile)
{
if (!cmsys::SystemTools::FileExists(this->OutMocCppFilename.c_str())
|| (this->OldCompileSettingsStr != this->CurrentCompileSettingsStr))
@@ -830,7 +831,7 @@ bool cmQtAutomoc::RunAutomoc(cmMakefile* makefile)
}
-void cmQtAutomoc::ParseCppFile(const std::string& absFilename,
+void cmQtAutoGenerators::ParseCppFile(const std::string& absFilename,
const std::vector<std::string>& headerExtensions,
std::map<std::string, std::string>& includedMocs)
{
@@ -1011,7 +1012,7 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename,
}
-void cmQtAutomoc::StrictParseCppFile(const std::string& absFilename,
+void cmQtAutoGenerators::StrictParseCppFile(const std::string& absFilename,
const std::vector<std::string>& headerExtensions,
std::map<std::string, std::string>& includedMocs)
{
@@ -1124,7 +1125,8 @@ void cmQtAutomoc::StrictParseCppFile(const std::string& absFilename,
}
-void cmQtAutomoc::SearchHeadersForCppFile(const std::string& absFilename,
+void
+cmQtAutoGenerators::SearchHeadersForCppFile(const std::string& absFilename,
const std::vector<std::string>& headerExtensions,
std::set<std::string>& absHeaders)
{
@@ -1160,7 +1162,7 @@ void cmQtAutomoc::SearchHeadersForCppFile(const std::string& absFilename,
}
-void cmQtAutomoc::ParseHeaders(const std::set<std::string>& absHeaders,
+void cmQtAutoGenerators::ParseHeaders(const std::set<std::string>& absHeaders,
const std::map<std::string, std::string>& includedMocs,
std::map<std::string, std::string>& notIncludedMocs)
{
@@ -1194,7 +1196,7 @@ void cmQtAutomoc::ParseHeaders(const std::set<std::string>& absHeaders,
}
-bool cmQtAutomoc::GenerateMoc(const std::string& sourceFile,
+bool cmQtAutoGenerators::GenerateMoc(const std::string& sourceFile,
const std::string& mocFileName)
{
const std::string mocFilePath = this->Builddir + mocFileName;
@@ -1271,7 +1273,7 @@ bool cmQtAutomoc::GenerateMoc(const std::string& sourceFile,
}
-std::string cmQtAutomoc::Join(const std::vector<std::string>& lst,
+std::string cmQtAutoGenerators::Join(const std::vector<std::string>& lst,
char separator)
{
if (lst.empty())
@@ -1291,13 +1293,15 @@ std::string cmQtAutomoc::Join(const std::vector<std::string>& lst,
}
-bool cmQtAutomoc::StartsWith(const std::string& str, const std::string& with)
+bool cmQtAutoGenerators::StartsWith(const std::string& str,
+ const std::string& with)
{
return (str.substr(0, with.length()) == with);
}
-bool cmQtAutomoc::EndsWith(const std::string& str, const std::string& with)
+bool cmQtAutoGenerators::EndsWith(const std::string& str,
+ const std::string& with)
{
if (with.length() > (str.length()))
{
@@ -1307,7 +1311,7 @@ bool cmQtAutomoc::EndsWith(const std::string& str, const std::string& with)
}
-std::string cmQtAutomoc::ReadAll(const std::string& filename)
+std::string cmQtAutoGenerators::ReadAll(const std::string& filename)
{
std::ifstream file(filename.c_str());
cmsys_ios::stringstream stream;
diff --git a/Source/cmQtAutomoc.h b/Source/cmQtAutoGenerators.h
index ebeeb0e..ef38a5b 100644
--- a/Source/cmQtAutomoc.h
+++ b/Source/cmQtAutoGenerators.h
@@ -11,20 +11,20 @@
See the License for more information.
============================================================================*/
-#ifndef cmQtAutomoc_h
-#define cmQtAutomoc_h
+#ifndef cmQtAutoGenerators_h
+#define cmQtAutoGenerators_h
class cmGlobalGenerator;
class cmMakefile;
-class cmQtAutomoc
+class cmQtAutoGenerators
{
public:
- cmQtAutomoc();
+ cmQtAutoGenerators();
bool Run(const char* targetDirectory, const char *config);
bool InitializeMocSourceFile(cmTarget* target);
- void SetupAutomocTarget(cmTarget* target);
+ void SetupAutoGenerateTarget(cmTarget* target);
private:
cmGlobalGenerator* CreateGlobalGenerator(cmake* cm,
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 9814aea..2fba5dc 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -13,7 +13,7 @@
#include "cmMakefile.h"
#include "cmLocalGenerator.h"
#include "cmGlobalGenerator.h"
-#include "cmQtAutomoc.h"
+#include "cmQtAutoGenerators.h"
#include "cmVersion.h"
#if defined(CMAKE_BUILD_WITH_CMAKE)
@@ -634,7 +634,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
}
else if (args[1] == "cmake_automoc")
{
- cmQtAutomoc automoc;
+ cmQtAutoGenerators automoc;
const char *config = args[3].empty() ? 0 : args[3].c_str();
bool automocSuccess = automoc.Run(args[2].c_str(), config);
return automocSuccess ? 0 : 1;