diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/cmExtraCodeLiteGenerator.cxx | 8 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 7 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.h | 4 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudioGenerator.cxx | 17 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudioGenerator.h | 4 | ||||
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 40 | ||||
-rw-r--r-- | Source/cmGlobalXCodeGenerator.h | 3 | ||||
-rw-r--r-- | Source/cmInstallTargetGenerator.cxx | 30 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 6 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 14 | ||||
-rw-r--r-- | Source/cmMakefile.h | 6 | ||||
-rw-r--r-- | Source/cmPolicies.cxx | 5 | ||||
-rw-r--r-- | Source/cmPolicies.h | 1 | ||||
-rw-r--r-- | Source/cmProjectCommand.cxx | 159 | ||||
-rw-r--r-- | Source/cmQtAutoGenerators.cxx | 34 | ||||
-rw-r--r-- | Source/cmQtAutoGenerators.h | 12 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 9 | ||||
-rw-r--r-- | Source/cmTarget.h | 3 |
19 files changed, 307 insertions, 57 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 7abdf92..f42f175 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -2,5 +2,5 @@ set(CMake_VERSION_MAJOR 2) set(CMake_VERSION_MINOR 8) set(CMake_VERSION_PATCH 12) -set(CMake_VERSION_TWEAK 20140202) +set(CMake_VERSION_TWEAK 20140205) #set(CMake_VERSION_RC 1) diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx index b156691..ff84fb7 100644 --- a/Source/cmExtraCodeLiteGenerator.cxx +++ b/Source/cmExtraCodeLiteGenerator.cxx @@ -449,8 +449,12 @@ cmExtraCodeLiteGenerator::GetBuildCommand(const cmMakefile* mf) const buildCommand = make; } else if ( generator == "MinGW Makefiles" || - generator == "Unix Makefiles" || - generator == "Ninja" ) + generator == "Unix Makefiles" ) + { + ss << make << " -j " << this->CpuCount; + buildCommand = ss.str(); + } + else if ( generator == "Ninja" ) { ss << make; buildCommand = ss.str(); diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 03486d8..a61cab1 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -3032,3 +3032,10 @@ void cmGlobalGenerator::ProcessEvaluationFiles() } } } + +//---------------------------------------------------------------------------- +std::string cmGlobalGenerator::ExpandCFGIntDir(const std::string& str, + const std::string& /*config*/) const +{ + return str; +} diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index ebc2db5..753eebf 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -193,6 +193,10 @@ public: ///! What is the configurations directory variable called? virtual const char* GetCMakeCFGIntDir() const { return "."; } + ///! expand CFGIntDir for a configuration + virtual std::string ExpandCFGIntDir(const std::string& str, + const std::string& config) const; + /** Get whether the generator should use a script for link commands. */ bool GetUseLinkScript() const { return this->UseLinkScript; } diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index 42492e6..0c5f35b 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -902,3 +902,20 @@ cmGlobalVisualStudioGenerator::OrderedTargetDependSet this->insert(*ti); } } + +std::string cmGlobalVisualStudioGenerator::ExpandCFGIntDir( + const std::string& str, + const std::string& config) const +{ + std::string replace = GetCMakeCFGIntDir(); + + std::string tmp = str; + for(std::string::size_type i = tmp.find(replace); + i != std::string::npos; + i = tmp.find(replace, i)) + { + tmp.replace(i, replace.size(), config); + i += config.size(); + } + return tmp; +} diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h index eab613d..9186d65 100644 --- a/Source/cmGlobalVisualStudioGenerator.h +++ b/Source/cmGlobalVisualStudioGenerator.h @@ -84,6 +84,10 @@ public: virtual void FindMakeProgram(cmMakefile*); + + virtual std::string ExpandCFGIntDir(const std::string& str, + const std::string& config) const; + protected: // Does this VS version link targets to each other if there are // dependencies in the SLN file? This was done for VS versions diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 46c34d0..484b28f 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -2272,14 +2272,24 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, std::string search_paths; std::vector<std::string> runtimeDirs; pcli->GetRPath(runtimeDirs, false); + // runpath dirs needs to be unique to prevent corruption + std::set<std::string> unique_dirs; + for(std::vector<std::string>::const_iterator i = runtimeDirs.begin(); i != runtimeDirs.end(); ++i) { - if(!search_paths.empty()) + std::string runpath = *i; + runpath = this->ExpandCFGIntDir(runpath, configName); + + if(unique_dirs.find(runpath) == unique_dirs.end()) { - search_paths += " "; + unique_dirs.insert(runpath); + if(!search_paths.empty()) + { + search_paths += " "; + } + search_paths += this->XCodeEscapePath(runpath.c_str()); } - search_paths += this->XCodeEscapePath((*i).c_str()); } if(!search_paths.empty()) { @@ -3675,6 +3685,30 @@ const char* cmGlobalXCodeGenerator::GetCMakeCFGIntDir() const "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)" : "."; } +std::string cmGlobalXCodeGenerator::ExpandCFGIntDir(const std::string& str, + const std::string& config) const +{ + std::string replace1 = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)"; + std::string replace2 = "$(CONFIGURATION)"; + + std::string tmp = str; + for(std::string::size_type i = tmp.find(replace1); + i != std::string::npos; + i = tmp.find(replace1, i)) + { + tmp.replace(i, replace1.size(), config); + i += config.size(); + } + for(std::string::size_type i = tmp.find(replace2); + i != std::string::npos; + i = tmp.find(replace2, i)) + { + tmp.replace(i, replace2.size(), config); + i += config.size(); + } + return tmp; +} + //---------------------------------------------------------------------------- void cmGlobalXCodeGenerator::GetDocumentation(cmDocumentationEntry& entry) { diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index ae7f07e..c9d20c2 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -79,6 +79,9 @@ public: ///! What is the configurations directory variable called? virtual const char* GetCMakeCFGIntDir() const; + ///! expand CFGIntDir + virtual std::string ExpandCFGIntDir(const std::string& str, + const std::string& config) const; void SetCurrentLocalGenerator(cmLocalGenerator*); diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index 68f45a6..7a39f45 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -669,22 +669,36 @@ cmInstallTargetGenerator cli->GetRPath(oldRuntimeDirs, false); cli->GetRPath(newRuntimeDirs, true); - // Note: These are separate commands to avoid install_name_tool - // corruption on 10.6. + // Note: These paths are kept unique to avoid install_name_tool corruption. + std::set<std::string> runpaths; for(std::vector<std::string>::const_iterator i = oldRuntimeDirs.begin(); i != oldRuntimeDirs.end(); ++i) { - os << indent << "execute_process(COMMAND " << installNameTool << "\n"; - os << indent << " -delete_rpath \"" << *i << "\"\n"; - os << indent << " \"" << toDestDirPath << "\")\n"; + std::string runpath = this->Target->GetMakefile()->GetLocalGenerator()-> + GetGlobalGenerator()->ExpandCFGIntDir(*i, config); + + if(runpaths.find(runpath) == runpaths.end()) + { + runpaths.insert(runpath); + os << indent << "execute_process(COMMAND " << installNameTool << "\n"; + os << indent << " -delete_rpath \"" << runpath << "\"\n"; + os << indent << " \"" << toDestDirPath << "\")\n"; + } } + runpaths.clear(); for(std::vector<std::string>::const_iterator i = newRuntimeDirs.begin(); i != newRuntimeDirs.end(); ++i) { - os << indent << "execute_process(COMMAND " << installNameTool << "\n"; - os << indent << " -add_rpath \"" << *i << "\"\n"; - os << indent << " \"" << toDestDirPath << "\")\n"; + std::string runpath = this->Target->GetMakefile()->GetLocalGenerator()-> + GetGlobalGenerator()->ExpandCFGIntDir(*i, config); + + if(runpaths.find(runpath) == runpaths.end()) + { + os << indent << "execute_process(COMMAND " << installNameTool << "\n"; + os << indent << " -add_rpath \"" << runpath << "\"\n"; + os << indent << " \"" << toDestDirPath << "\")\n"; + } } } else diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index c13b8ee..a2a66ae 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2187,7 +2187,11 @@ void cmLocalGenerator return; } AddVisibilityCompileOption(flags, target, this, lang); - AddInlineVisibilityCompileOption(flags, target, this); + + if(strcmp(lang, "CXX") == 0) + { + AddInlineVisibilityCompileOption(flags, target, this); + } } //---------------------------------------------------------------------------- diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 55a9d5c..f248c57 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1570,23 +1570,23 @@ void cmMakefile::InitializeFromParent() // Initialize definitions with the closure of the parent scope. this->Internal->VarStack.top() = parent->Internal->VarStack.top().Closure(); - const std::vector<cmValueWithOrigin> parentIncludes = + const std::vector<cmValueWithOrigin>& parentIncludes = parent->GetIncludeDirectoriesEntries(); this->IncludeDirectoriesEntries.insert(this->IncludeDirectoriesEntries.end(), - parentIncludes.begin(), - parentIncludes.end()); + parentIncludes.begin(), + parentIncludes.end()); - const std::vector<cmValueWithOrigin> parentOptions = + const std::vector<cmValueWithOrigin>& parentOptions = parent->GetCompileOptionsEntries(); this->CompileOptionsEntries.insert(this->CompileOptionsEntries.end(), parentOptions.begin(), parentOptions.end()); - const std::vector<cmValueWithOrigin> parentDefines = + const std::vector<cmValueWithOrigin>& parentDefines = parent->GetCompileDefinitionsEntries(); this->CompileDefinitionsEntries.insert(this->CompileDefinitionsEntries.end(), - parentDefines.begin(), - parentDefines.end()); + parentDefines.begin(), + parentDefines.end()); this->SystemIncludeDirectories = parent->SystemIncludeDirectories; diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 66a33bb..45f3b9f 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -853,15 +853,15 @@ public: /** Set whether or not to report a CMP0000 violation. */ void SetCheckCMP0000(bool b) { this->CheckCMP0000 = b; } - std::vector<cmValueWithOrigin> GetIncludeDirectoriesEntries() const + const std::vector<cmValueWithOrigin>& GetIncludeDirectoriesEntries() const { return this->IncludeDirectoriesEntries; } - std::vector<cmValueWithOrigin> GetCompileOptionsEntries() const + const std::vector<cmValueWithOrigin>& GetCompileOptionsEntries() const { return this->CompileOptionsEntries; } - std::vector<cmValueWithOrigin> GetCompileDefinitionsEntries() const + const std::vector<cmValueWithOrigin>& GetCompileDefinitionsEntries() const { return this->CompileDefinitionsEntries; } diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index a1451f1..e191256 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -341,6 +341,11 @@ cmPolicies::cmPolicies() CMP0047, "CMP0047", "Use QCC compiler id for the qcc drivers on QNX.", 3,0,0,0, cmPolicies::WARN); + + this->DefinePolicy( + CMP0048, "CMP0048", + "project() command manages VERSION variables.", + 3,0,0,0, cmPolicies::WARN); } cmPolicies::~cmPolicies() diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index d1bba7b..42271dd 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -101,6 +101,7 @@ public: CMP0045, ///< Error on non-existent target in get_target_property CMP0046, ///< Error on non-existent dependency in add_dependencies CMP0047, ///< Use QCC compiler id for the qcc drivers on QNX. + CMP0048, ///< project() command manages VERSION variables /** \brief Always the last entry. * diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index 11f9a76..a9ce0cc 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -62,15 +62,168 @@ bool cmProjectCommand "Value Computed by CMake", cmCacheManager::STATIC); } + bool haveVersion = false; + bool haveLanguages = false; + std::string version; std::vector<std::string> languages; - if(args.size() > 1) + enum Doing { DoingLanguages, DoingVersion }; + Doing doing = DoingLanguages; + for(size_t i = 1; i < args.size(); ++i) { - for(size_t i =1; i < args.size(); ++i) + if(args[i] == "LANGUAGES") + { + if(haveLanguages) + { + this->Makefile->IssueMessage + (cmake::FATAL_ERROR, "LANGUAGES may be specified at most once."); + cmSystemTools::SetFatalErrorOccured(); + return true; + } + haveLanguages = true; + doing = DoingLanguages; + } + else if (args[i] == "VERSION") + { + if(haveVersion) + { + this->Makefile->IssueMessage + (cmake::FATAL_ERROR, "VERSION may be specified at most once."); + cmSystemTools::SetFatalErrorOccured(); + return true; + } + haveVersion = true; + doing = DoingVersion; + } + else if(doing == DoingVersion) + { + doing = DoingLanguages; + version = args[i]; + } + else // doing == DoingLanguages { languages.push_back(args[i]); } } - else + + if (haveVersion && !haveLanguages && !languages.empty()) + { + this->Makefile->IssueMessage + (cmake::FATAL_ERROR, + "project with VERSION must use LANGUAGES before language names."); + cmSystemTools::SetFatalErrorOccured(); + return true; + } + if (haveLanguages && languages.empty()) + { + languages.push_back("NONE"); + } + + cmPolicies::PolicyStatus cmp0048 = + this->Makefile->GetPolicyStatus(cmPolicies::CMP0048); + if (haveVersion) + { + // Set project VERSION variables to given values + if (cmp0048 == cmPolicies::OLD || + cmp0048 == cmPolicies::WARN) + { + this->Makefile->IssueMessage + (cmake::FATAL_ERROR, + "VERSION not allowed unless CMP0048 is set to NEW"); + cmSystemTools::SetFatalErrorOccured(); + return true; + } + + cmsys::RegularExpression + vx("^([0-9]+(\\.[0-9]+(\\.[0-9]+(\\.[0-9]+)?)?)?)?$"); + if(!vx.find(version)) + { + std::string e = "VERSION \"" + version + "\" format invalid."; + this->Makefile->IssueMessage(cmake::FATAL_ERROR, e); + cmSystemTools::SetFatalErrorOccured(); + return true; + } + + std::string vs; + const char* sep = ""; + char vb[4][64]; + unsigned int v[4] = {0,0,0,0}; + int vc = sscanf(version.c_str(), "%u.%u.%u.%u", + &v[0], &v[1], &v[2], &v[3]); + for(int i=0; i < 4; ++i) + { + if(i < vc) + { + sprintf(vb[i], "%u", v[i]); + vs += sep; + vs += vb[i]; + sep = "."; + } + else + { + vb[i][0] = 0; + } + } + + std::string vv; + vv = args[0] + "_VERSION"; + this->Makefile->AddDefinition("PROJECT_VERSION", vs.c_str()); + this->Makefile->AddDefinition(vv.c_str(), vs.c_str()); + vv = args[0] + "_VERSION_MAJOR"; + this->Makefile->AddDefinition("PROJECT_VERSION_MAJOR", vb[0]); + this->Makefile->AddDefinition(vv.c_str(), vb[0]); + vv = args[0] + "_VERSION_MINOR"; + this->Makefile->AddDefinition("PROJECT_VERSION_MINOR", vb[1]); + this->Makefile->AddDefinition(vv.c_str(), vb[1]); + vv = args[0] + "_VERSION_PATCH"; + this->Makefile->AddDefinition("PROJECT_VERSION_PATCH", vb[2]); + this->Makefile->AddDefinition(vv.c_str(), vb[2]); + vv = args[0] + "_VERSION_TWEAK"; + this->Makefile->AddDefinition("PROJECT_VERSION_TWEAK", vb[3]); + this->Makefile->AddDefinition(vv.c_str(), vb[3]); + } + else if(cmp0048 != cmPolicies::OLD) + { + // Set project VERSION variables to empty + std::vector<std::string> vv; + vv.push_back("PROJECT_VERSION"); + vv.push_back("PROJECT_VERSION_MAJOR"); + vv.push_back("PROJECT_VERSION_MINOR"); + vv.push_back("PROJECT_VERSION_PATCH"); + vv.push_back("PROJECT_VERSION_TWEAK"); + vv.push_back(args[0] + "_VERSION"); + vv.push_back(args[0] + "_VERSION_MAJOR"); + vv.push_back(args[0] + "_VERSION_MINOR"); + vv.push_back(args[0] + "_VERSION_PATCH"); + vv.push_back(args[0] + "_VERSION_TWEAK"); + std::string vw; + for(std::vector<std::string>::iterator i = vv.begin(); + i != vv.end(); ++i) + { + const char* v = this->Makefile->GetDefinition(i->c_str()); + if(v && *v) + { + if(cmp0048 == cmPolicies::WARN) + { + vw += "\n "; + vw += *i; + } + else + { + this->Makefile->AddDefinition(i->c_str(), ""); + } + } + } + if(!vw.empty()) + { + cmOStringStream w; + w << (this->Makefile->GetPolicies() + ->GetPolicyWarning(cmPolicies::CMP0048)) + << "\nThe following variable(s) would be set to empty:" << vw; + this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str()); + } + } + + if (languages.empty()) { // if no language is specified do c and c++ languages.push_back("C"); diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index cab59fe..7e44c26 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -1279,8 +1279,8 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile) const std::vector<std::string>& headerExtensions = makefile->GetHeaderExtensions(); - std::vector<std::string> includedUis; - std::vector<std::string> skippedUis; + std::map<std::string, std::string> includedUis; + std::map<std::string, std::string> skippedUis; std::vector<std::string> uicSkipped; cmSystemTools::ExpandListArgument(this->SkipUic, uicSkipped); @@ -1290,7 +1290,8 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile) { const bool skipUic = std::find(uicSkipped.begin(), uicSkipped.end(), *it) != uicSkipped.end(); - std::vector<std::string>& uiFiles = skipUic ? skippedUis : includedUis; + std::map<std::string, std::string>& uiFiles + = skipUic ? skippedUis : includedUis; const std::string &absFilename = *it; if (this->Verbose) { @@ -1350,11 +1351,12 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile) { this->GenerateMoc(it->first, it->second); } - for(std::vector<std::string>::const_iterator it = includedUis.begin(); + for(std::map<std::string, std::string>::const_iterator + it = includedUis.begin(); it != includedUis.end(); ++it) { - this->GenerateUi(*it); + this->GenerateUi(it->first, it->second); } if(!this->RccExecutable.empty()) @@ -1431,7 +1433,7 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile) void cmQtAutoGenerators::ParseCppFile(const std::string& absFilename, const std::vector<std::string>& headerExtensions, std::map<std::string, std::string>& includedMocs, - std::vector<std::string> &includedUis) + std::map<std::string, std::string> &includedUis) { cmsys::RegularExpression mocIncludeRegExp( "[\n][ \t]*#[ \t]*include[ \t]+" @@ -1619,7 +1621,7 @@ void cmQtAutoGenerators::ParseCppFile(const std::string& absFilename, void cmQtAutoGenerators::StrictParseCppFile(const std::string& absFilename, const std::vector<std::string>& headerExtensions, std::map<std::string, std::string>& includedMocs, - std::vector<std::string>& includedUis) + std::map<std::string, std::string>& includedUis) { cmsys::RegularExpression mocIncludeRegExp( "[\n][ \t]*#[ \t]*include[ \t]+" @@ -1737,7 +1739,7 @@ void cmQtAutoGenerators::StrictParseCppFile(const std::string& absFilename, void cmQtAutoGenerators::ParseForUic(const std::string& absFilename, - std::vector<std::string>& includedUis) + std::map<std::string, std::string>& includedUis) { if (this->UicExecutable.empty()) { @@ -1754,9 +1756,9 @@ void cmQtAutoGenerators::ParseForUic(const std::string& absFilename, } -void cmQtAutoGenerators::ParseForUic(const std::string&, +void cmQtAutoGenerators::ParseForUic(const std::string& absFilename, const std::string& contentsString, - std::vector<std::string>& includedUis) + std::map<std::string, std::string>& includedUis) { if (this->UicExecutable.empty()) { @@ -1768,6 +1770,9 @@ void cmQtAutoGenerators::ParseForUic(const std::string&, std::string::size_type matchOffset = 0; + const std::string absPath = cmsys::SystemTools::GetFilenamePath( + cmsys::SystemTools::GetRealPath(absFilename.c_str())) + '/'; + matchOffset = 0; if ((strstr(contentsString.c_str(), "ui_") != NULL) && (uiIncludeRegExp.find(contentsString))) @@ -1783,7 +1788,7 @@ void cmQtAutoGenerators::ParseForUic(const std::string&, // finding the correct header, so we need to remove the ui_ part basename = basename.substr(3); - includedUis.push_back(basename); + includedUis[absPath] = basename; matchOffset += uiIncludeRegExp.end(); } while(uiIncludeRegExp.find(contentsString.c_str() + matchOffset)); @@ -1831,7 +1836,7 @@ cmQtAutoGenerators::SearchHeadersForCppFile(const std::string& absFilename, void cmQtAutoGenerators::ParseHeaders(const std::set<std::string>& absHeaders, const std::map<std::string, std::string>& includedMocs, std::map<std::string, std::string>& notIncludedMocs, - std::vector<std::string>& includedUis) + std::map<std::string, std::string>& includedUis) { for(std::set<std::string>::const_iterator hIt=absHeaders.begin(); hIt!=absHeaders.end(); @@ -1939,7 +1944,8 @@ bool cmQtAutoGenerators::GenerateMoc(const std::string& sourceFile, return false; } -bool cmQtAutoGenerators::GenerateUi(const std::string& uiFileName) +bool cmQtAutoGenerators::GenerateUi(const std::string& path, + const std::string& uiFileName) { if (!cmsys::SystemTools::FileExists(this->Builddir.c_str(), false)) { @@ -1947,7 +1953,7 @@ bool cmQtAutoGenerators::GenerateUi(const std::string& uiFileName) } std::string ui_output_file = "ui_" + uiFileName + ".h"; - std::string ui_input_file = this->Srcdir + uiFileName + ".ui"; + std::string ui_input_file = path + uiFileName + ".ui"; int sourceNewerThanUi = 0; bool success = cmsys::SystemTools::FileTimeCompare(ui_input_file.c_str(), diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h index f66d02b..2840fbf 100644 --- a/Source/cmQtAutoGenerators.h +++ b/Source/cmQtAutoGenerators.h @@ -48,16 +48,16 @@ private: bool RunAutogen(cmMakefile* makefile); bool GenerateMoc(const std::string& sourceFile, const std::string& mocFileName); - bool GenerateUi(const std::string& uiFileName); + bool GenerateUi(const std::string& path, const std::string& uiFileName); bool GenerateQrc(); void ParseCppFile(const std::string& absFilename, const std::vector<std::string>& headerExtensions, std::map<std::string, std::string>& includedMocs, - std::vector<std::string>& includedUis); + std::map<std::string, std::string>& includedUis); void StrictParseCppFile(const std::string& absFilename, const std::vector<std::string>& headerExtensions, std::map<std::string, std::string>& includedMocs, - std::vector<std::string>& includedUis); + std::map<std::string, std::string>& includedUis); void SearchHeadersForCppFile(const std::string& absFilename, const std::vector<std::string>& headerExtensions, std::set<std::string>& absHeaders); @@ -65,14 +65,14 @@ private: void ParseHeaders(const std::set<std::string>& absHeaders, const std::map<std::string, std::string>& includedMocs, std::map<std::string, std::string>& notIncludedMocs, - std::vector<std::string>& includedUis); + std::map<std::string, std::string>& includedUis); void ParseForUic(const std::string& fileName, const std::string& contentsString, - std::vector<std::string>& includedUis); + std::map<std::string, std::string>& includedUis); void ParseForUic(const std::string& fileName, - std::vector<std::string>& includedUis); + std::map<std::string, std::string>& includedUis); void Init(); diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 21f8d4c..e51095e 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1620,16 +1620,11 @@ void cmTarget::InsertCompileOption(const cmValueWithOrigin &entry, } //---------------------------------------------------------------------------- -void cmTarget::InsertCompileDefinition(const cmValueWithOrigin &entry, - bool before) +void cmTarget::InsertCompileDefinition(const cmValueWithOrigin &entry) { cmGeneratorExpression ge(entry.Backtrace); - std::vector<cmTargetInternals::TargetPropertyEntry*>::iterator position - = before ? this->Internal->CompileDefinitionsEntries.begin() - : this->Internal->CompileDefinitionsEntries.end(); - - this->Internal->CompileDefinitionsEntries.insert(position, + this->Internal->CompileDefinitionsEntries.push_back( new cmTargetInternals::TargetPropertyEntry(ge.Parse(entry.Value))); } diff --git a/Source/cmTarget.h b/Source/cmTarget.h index ce0d812..271824b 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -531,8 +531,7 @@ public: bool before = false); void InsertCompileOption(const cmValueWithOrigin &entry, bool before = false); - void InsertCompileDefinition(const cmValueWithOrigin &entry, - bool before = false); + void InsertCompileDefinition(const cmValueWithOrigin &entry); void AppendBuildInterfaceIncludes(); |