diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/CPack/cmCPackNSISGenerator.cxx | 36 | ||||
-rw-r--r-- | Source/QtDialog/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Source/QtDialog/QCMakeCacheView.cxx | 6 | ||||
-rw-r--r-- | Source/cmAddSubDirectoryCommand.cxx | 15 | ||||
-rw-r--r-- | Source/cmBuildCommand.cxx | 8 | ||||
-rw-r--r-- | Source/cmDocumentGeneratorExpressions.h | 2 | ||||
-rw-r--r-- | Source/cmDocumentVariables.cxx | 9 | ||||
-rw-r--r-- | Source/cmEnableLanguageCommand.h | 7 | ||||
-rw-r--r-- | Source/cmExportInstallFileGenerator.cxx | 36 | ||||
-rw-r--r-- | Source/cmFindPackageCommand.cxx | 3 | ||||
-rw-r--r-- | Source/cmGeneratorExpression.cxx | 2 | ||||
-rw-r--r-- | Source/cmGeneratorExpressionEvaluator.cxx | 18 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 6 | ||||
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 16 | ||||
-rw-r--r-- | Source/cmInstallExportGenerator.h | 2 | ||||
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.cxx | 28 | ||||
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.h | 2 | ||||
-rw-r--r-- | Source/cmQtAutomoc.cxx | 26 | ||||
-rw-r--r-- | Source/cmQtAutomoc.h | 2 | ||||
-rw-r--r-- | Source/cmStringCommand.h | 7 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 19 |
22 files changed, 191 insertions, 63 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 2e5cafd..6f3e6ef 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 10) -set(CMake_VERSION_TWEAK 20130309) +set(CMake_VERSION_TWEAK 20130313) #set(CMake_VERSION_RC 1) diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index 9f86ea2..62bfa91 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -432,11 +432,14 @@ int cmCPackNSISGenerator::InitializeInternal() int retVal = 1; bool resS = cmSystemTools::RunSingleCommand(nsisCmd.c_str(), &output, &retVal, 0, this->GeneratorVerbose, 0); - cmsys::RegularExpression versionRex("v([0-9]+.[0-9]+)"); - if ( !resS || retVal || !versionRex.find(output)) + cmsys::RegularExpression versionRexCVS("v(.*)\\.cvs"); + if ( !resS || retVal || + (!versionRex.find(output) && !versionRexCVS.find(output)) + ) { - std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); + const char* topDir = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); + std::string tmpFile = topDir ? topDir : "."; tmpFile += "/NSISOutput.log"; cmGeneratedFileStream ofs(tmpFile.c_str()); ofs << "# Run command: " << nsisCmd.c_str() << std::endl @@ -448,17 +451,26 @@ int cmCPackNSISGenerator::InitializeInternal() << "Please check " << tmpFile.c_str() << " for errors" << std::endl); return 0; } - double nsisVersion = atof(versionRex.match(1).c_str()); - double minNSISVersion = 2.09; - cmCPackLogger(cmCPackLog::LOG_DEBUG, "NSIS Version: " - << nsisVersion << std::endl); - if ( nsisVersion < minNSISVersion ) + if ( versionRex.find(output)) { - cmCPackLogger(cmCPackLog::LOG_ERROR, - "CPack requires NSIS Version 2.09 or greater. NSIS found on the system " - "was: " + double nsisVersion = atof(versionRex.match(1).c_str()); + double minNSISVersion = 2.09; + cmCPackLogger(cmCPackLog::LOG_DEBUG, "NSIS Version: " << nsisVersion << std::endl); - return 0; + if ( nsisVersion < minNSISVersion ) + { + cmCPackLogger(cmCPackLog::LOG_ERROR, + "CPack requires NSIS Version 2.09 or greater. " + "NSIS found on the system was: " + << nsisVersion << std::endl); + return 0; + } + } + if ( versionRexCVS.find(output)) + { + // No version check for NSIS cvs build + cmCPackLogger(cmCPackLog::LOG_DEBUG, "NSIS Version: CVS " + << versionRexCVS.match(1).c_str() << std::endl); } this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM", nsisPath.c_str()); this->SetOptionIfNotSet("CPACK_NSIS_EXECUTABLES_DIRECTORY", "bin"); diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index 29daffd..1684fb2 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -27,6 +27,8 @@ if (Qt5Widgets_FOUND) set(QT_LIBRARIES ${Qt5Widgets_LIBRARIES}) # Remove this when the minimum version of Qt is 4.6. add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0) + + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") else() set(QT_MIN_VERSION "4.4.0") find_package(Qt4 REQUIRED) diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx index 1d21d42..031350b 100644 --- a/Source/QtDialog/QCMakeCacheView.cxx +++ b/Source/QtDialog/QCMakeCacheView.cxx @@ -490,7 +490,11 @@ QCMakePropertyList QCMakeCacheModel::properties() const } // go to the next in the tree - while(!idxs.isEmpty() && !idxs.last().sibling(idxs.last().row()+1, 0).isValid()) + while(!idxs.isEmpty() && ( +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 3) + (idxs.last().row()+1) >= rowCount(idxs.last().parent()) || +#endif + !idxs.last().sibling(idxs.last().row()+1, 0).isValid())) { idxs.removeLast(); } diff --git a/Source/cmAddSubDirectoryCommand.cxx b/Source/cmAddSubDirectoryCommand.cxx index 9efeda4..5b1c9c6 100644 --- a/Source/cmAddSubDirectoryCommand.cxx +++ b/Source/cmAddSubDirectoryCommand.cxx @@ -78,7 +78,7 @@ bool cmAddSubDirectoryCommand::InitialPass // No binary directory was specified. If the source directory is // not a subdirectory of the current directory then it is an // error. - if(!cmSystemTools::FindLastString(srcPath.c_str(), + if(!cmSystemTools::IsSubDirectory(srcPath.c_str(), this->Makefile->GetCurrentDirectory())) { cmOStringStream e; @@ -93,10 +93,15 @@ bool cmAddSubDirectoryCommand::InitialPass // Remove the CurrentDirectory from the srcPath and replace it // with the CurrentOutputDirectory. - binPath = srcPath; - cmSystemTools::ReplaceString(binPath, - this->Makefile->GetCurrentDirectory(), - this->Makefile->GetCurrentOutputDirectory()); + const char* src = this->Makefile->GetCurrentDirectory(); + const char* bin = this->Makefile->GetCurrentOutputDirectory(); + size_t srcLen = strlen(src); + size_t binLen = strlen(bin); + if(srcLen > 0 && src[srcLen-1] == '/') + { --srcLen; } + if(binLen > 0 && bin[binLen-1] == '/') + { --binLen; } + binPath = std::string(bin, binLen) + srcPath.substr(srcLen); } else { diff --git a/Source/cmBuildCommand.cxx b/Source/cmBuildCommand.cxx index 3722ab6..91d55a5 100644 --- a/Source/cmBuildCommand.cxx +++ b/Source/cmBuildCommand.cxx @@ -87,6 +87,14 @@ bool cmBuildCommand const char* makeprogram = this->Makefile->GetDefinition("CMAKE_MAKE_PROGRAM"); + if(!makeprogram) + { + this->Makefile->IssueMessage( + cmake::FATAL_ERROR, + "build_command() requires CMAKE_MAKE_PROGRAM to be defined. " + "Call project() or enable_language() first."); + return true; + } // If null/empty CONFIGURATION argument, GenerateBuildCommand uses 'Debug' // in the currently implemented multi-configuration global generators... diff --git a/Source/cmDocumentGeneratorExpressions.h b/Source/cmDocumentGeneratorExpressions.h index 76a60c3..6cc3f25 100644 --- a/Source/cmDocumentGeneratorExpressions.h +++ b/Source/cmDocumentGeneratorExpressions.h @@ -26,6 +26,8 @@ "strings which contain a '>' for example.\n" \ " $<COMMA> = A literal ','. Used to compare " \ "strings which contain a ',' for example.\n" \ + " $<SEMICOLON> = A literal ';'. Used to prevent " \ + "list expansion on an argument with ';'.\n" \ " $<TARGET_NAME:...> = Marks ... as being the name of a " \ "target. This is required if exporting targets to multiple " \ "dependent export sets. The '...' must be a literal name of a " \ diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx index 204bd9a..326a4ce 100644 --- a/Source/cmDocumentVariables.cxx +++ b/Source/cmDocumentVariables.cxx @@ -1551,7 +1551,14 @@ void cmDocumentVariables::DefineVariables(cmake* cm) ("CMAKE_COMPILER_IS_GNU<LANG>", cmProperty::VARIABLE, "True if the compiler is GNU.", "If the selected <LANG> compiler is the GNU " - "compiler then this is TRUE, if not it is FALSE.",false, + "compiler then this is TRUE, if not it is FALSE. " + "Unlike the other per-language variables, this uses the GNU syntax for " + "identifying languages instead of the CMake syntax. Recognized values of " + "the <LANG> suffix are:\n" + " CC = C compiler\n" + " CXX = C++ compiler\n" + " G77 = Fortran compiler", + false, "Variables for Languages"); cm->DefineProperty diff --git a/Source/cmEnableLanguageCommand.h b/Source/cmEnableLanguageCommand.h index e4bb251..ee963f9 100644 --- a/Source/cmEnableLanguageCommand.h +++ b/Source/cmEnableLanguageCommand.h @@ -65,7 +65,12 @@ public: "any of the extra variables that are created by the project command. " "Example languages are CXX, C, Fortran. " "If OPTIONAL is used, use the CMAKE_<languageName>_COMPILER_WORKS " - "variable to check whether the language has been enabled successfully."; + "variable to check whether the language has been enabled successfully." + "\n" + "This command must be called on file scope (not inside a function) and " + "the language enabled can only be used in the calling project or its " + "subdirectories added by add_subdirectory(). Also note that at present, " + "the OPTIONAL argument does not work."; } cmTypeMacro(cmEnableLanguageCommand, cmCommand); diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index b6600f0..8b8b846 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -74,17 +74,35 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os) const char* installDest = this->IEGen->GetDestination(); if(!cmSystemTools::FileIsFullPath(installDest)) { - std::string dest = installDest; - os << "# Compute the installation prefix relative to this file.\n" - << "get_filename_component(_IMPORT_PREFIX " - << "\"${CMAKE_CURRENT_LIST_FILE}\" PATH)\n"; - while(!dest.empty()) + std::string installPrefix = + this->IEGen->GetMakefile()->GetSafeDefinition("CMAKE_INSTALL_PREFIX"); + std::string absDest = installPrefix + "/" + installDest + "/"; + if(strncmp(absDest.c_str(), "/lib/", 5) == 0 || + strncmp(absDest.c_str(), "/lib64/", 7) == 0 || + strncmp(absDest.c_str(), "/usr/lib/", 9) == 0 || + strncmp(absDest.c_str(), "/usr/lib64/", 11) == 0) { - os << - "get_filename_component(_IMPORT_PREFIX \"${_IMPORT_PREFIX}\" PATH)\n"; - dest = cmSystemTools::GetFilenamePath(dest); + // Assume this is a build for system package installation rather than a + // relocatable distribution. Use an absolute prefix because some Linux + // distros symlink /lib to /usr/lib which confuses the relative path + // computation below if we generate for /lib under one prefix and but the + // file is loaded from another. + os << "set(_IMPORT_PREFIX \"" << installPrefix << "\")\n"; + } + else + { + std::string dest = installDest; + os << "# Compute the installation prefix relative to this file.\n" + << "get_filename_component(_IMPORT_PREFIX " + << "\"${CMAKE_CURRENT_LIST_FILE}\" PATH)\n"; + while(!dest.empty()) + { + os << + "get_filename_component(_IMPORT_PREFIX \"${_IMPORT_PREFIX}\" PATH)\n"; + dest = cmSystemTools::GetFilenamePath(dest); + } + os << "\n"; } - os << "\n"; // Import location properties may reference this variable. this->ImportPrefix = "${_IMPORT_PREFIX}/"; diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 470ceca..aa3a73d 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -95,7 +95,8 @@ void cmFindPackageCommand::GenerateDocumentation() "Finds and loads settings from an external project. " "<package>_FOUND will be set to indicate whether the package was found. " "When the package is found package-specific information is provided " - "through variables documented by the package itself. " + "through variables and imported targets documented by the package " + "itself. " "The QUIET option disables messages if the package cannot be found. " "The MODULE option disables the second signature documented below. " "The REQUIRED option stops processing with an error message if the " diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index 7ea58fa..3f59129 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -393,7 +393,7 @@ bool cmGeneratorExpression::IsValidTargetName(const std::string &input) cmsys::RegularExpression targetNameValidator; // The ':' is supported to allow use with IMPORTED targets. At least // Qt 4 and 5 IMPORTED targets use ':' as the namespace delimiter. - targetNameValidator.compile("^[A-Za-z0-9_.:-]+$"); + targetNameValidator.compile("^[A-Za-z0-9_.:+-]+$"); return targetNameValidator.find(input.c_str()); } diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index e2d8777..6618e83 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -227,6 +227,22 @@ static const struct CommaNode : public cmGeneratorExpressionNode } commaNode; //---------------------------------------------------------------------------- +static const struct SemicolonNode : public cmGeneratorExpressionNode +{ + SemicolonNode() {} + + virtual int NumExpectedParameters() const { return 0; } + + std::string Evaluate(const std::vector<std::string> &, + cmGeneratorExpressionContext *, + const GeneratorExpressionContent *, + cmGeneratorExpressionDAGChecker *) const + { + return ";"; + } +} semicolonNode; + +//---------------------------------------------------------------------------- static const struct ConfigurationNode : public cmGeneratorExpressionNode { ConfigurationNode() {} @@ -943,6 +959,8 @@ cmGeneratorExpressionNode* GetNode(const std::string &identifier) return &angle_rNode; else if (identifier == "COMMA") return &commaNode; + else if (identifier == "SEMICOLON") + return &semicolonNode; else if (identifier == "TARGET_PROPERTY") return &targetPropertyNode; else if (identifier == "TARGET_NAME") diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index fcd6f71..df14331 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1086,8 +1086,10 @@ void cmGlobalGenerator::CreateAutomocTargets() if(target.GetPropertyAsBool("AUTOMOC") && !target.IsImported()) { cmQtAutomoc automoc; - automoc.InitializeMocSourceFile(&target); - automocs.push_back(std::make_pair(automoc, &target)); + if(automoc.InitializeMocSourceFile(&target)) + { + automocs.push_back(std::make_pair(automoc, &target)); + } } } } diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index b02457d..fa277b1 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -17,6 +17,8 @@ #include "cmGeneratorTarget.h" #include "cmVersion.h" +#include <algorithm> + const char* cmGlobalNinjaGenerator::NINJA_BUILD_FILE = "build.ninja"; const char* cmGlobalNinjaGenerator::NINJA_RULES_FILE = "rules.ninja"; const char* cmGlobalNinjaGenerator::INDENT = " "; @@ -492,16 +494,20 @@ void cmGlobalNinjaGenerator::Generate() // Used in: // Source/cmMakefile.cxx: void cmGlobalNinjaGenerator -::EnableLanguage(std::vector<std::string>const& languages, - cmMakefile *mf, +::EnableLanguage(std::vector<std::string>const& langs, + cmMakefile* makefile, bool optional) { - if(mf->IsOn("CMAKE_COMPILER_IS_MINGW")) + if (makefile->IsOn("CMAKE_COMPILER_IS_MINGW")) { UsingMinGW = true; - this->EnableMinGWLanguage(mf); + this->EnableMinGWLanguage(makefile); + } + if (std::find(langs.begin(), langs.end(), "Fortran") != langs.end()) + { + cmSystemTools::Error("The Ninja generator does not support Fortran yet."); } - this->cmGlobalGenerator::EnableLanguage(languages, mf, optional); + this->cmGlobalGenerator::EnableLanguage(langs, makefile, optional); } bool cmGlobalNinjaGenerator::UsingMinGW = false; diff --git a/Source/cmInstallExportGenerator.h b/Source/cmInstallExportGenerator.h index ee92906..7aff731 100644 --- a/Source/cmInstallExportGenerator.h +++ b/Source/cmInstallExportGenerator.h @@ -36,6 +36,8 @@ public: cmExportSet* GetExportSet() {return this->ExportSet;} + cmMakefile* GetMakefile() const { return this->Makefile; } + const std::string& GetNamespace() const { return this->Namespace; } protected: diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index f07ebef..dfe8280 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -1621,17 +1621,30 @@ cmLocalVisualStudio7Generator return dir_max; } -void cmLocalVisualStudio7Generator +bool cmLocalVisualStudio7Generator ::WriteGroup(const cmSourceGroup *sg, cmTarget& target, std::ostream &fout, const char *libName, std::vector<std::string> *configs) { const std::vector<const cmSourceFile *> &sourceFiles = sg->GetSourceFiles(); + std::vector<cmSourceGroup> const& children = sg->GetGroupChildren(); + + // Write the children to temporary output. + bool hasChildrenWithSources = false; + cmOStringStream tmpOut; + for(unsigned int i=0;i<children.size();++i) + { + if(this->WriteGroup(&children[i], target, tmpOut, libName, configs)) + { + hasChildrenWithSources = true; + } + } + // If the group is empty, don't write it at all. - if(sourceFiles.empty() && sg->GetGroupChildren().empty()) + if(sourceFiles.empty() && !hasChildrenWithSources) { - return; + return false; } // If the group has a name, write the header. @@ -1752,11 +1765,10 @@ void cmLocalVisualStudio7Generator } } - std::vector<cmSourceGroup> const& children = sg->GetGroupChildren(); - - for(unsigned int i=0;i<children.size();++i) + // If the group has children with source files, write the children. + if(hasChildrenWithSources) { - this->WriteGroup(&children[i], target, fout, libName, configs); + fout << tmpOut.str(); } // If the group has a name, write the footer. @@ -1764,6 +1776,8 @@ void cmLocalVisualStudio7Generator { this->WriteVCProjEndGroup(fout); } + + return true; } void cmLocalVisualStudio7Generator:: diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h index 5a1d208..d9e2ef0 100644 --- a/Source/cmLocalVisualStudio7Generator.h +++ b/Source/cmLocalVisualStudio7Generator.h @@ -109,7 +109,7 @@ private: FCInfo& fcinfo); void WriteTargetVersionAttribute(std::ostream& fout, cmTarget& target); - void WriteGroup(const cmSourceGroup *sg, + bool WriteGroup(const cmSourceGroup *sg, cmTarget& target, std::ostream &fout, const char *libName, std::vector<std::string> *configs); diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx index 10ce641..5730c8c 100644 --- a/Source/cmQtAutomoc.cxx +++ b/Source/cmQtAutomoc.cxx @@ -119,10 +119,21 @@ cmQtAutomoc::cmQtAutomoc() } } -void cmQtAutomoc::InitializeMocSourceFile(cmTarget* target) +bool cmQtAutomoc::InitializeMocSourceFile(cmTarget* target) { + cmMakefile* makefile = target->GetMakefile(); + // don't do anything if there is no Qt4 or Qt5Core (which contains moc): + std::string qtMajorVersion = makefile->GetSafeDefinition("QT_VERSION_MAJOR"); + if (qtMajorVersion == "") + { + qtMajorVersion = makefile->GetSafeDefinition("Qt5Core_VERSION_MAJOR"); + } + if (qtMajorVersion != "4" && qtMajorVersion != "5") + { + return false; + } + std::string automocTargetName = target->GetName(); - cmMakefile *makefile = target->GetMakefile(); automocTargetName += "_automoc"; std::string mocCppFile = makefile->GetCurrentOutputDirectory(); mocCppFile += "/"; @@ -134,6 +145,7 @@ void cmQtAutomoc::InitializeMocSourceFile(cmTarget* target) mocCppFile.c_str(), false); target->AddSourceFile(mocCppSource); + return true; } void cmQtAutomoc::SetupAutomocTarget(cmTarget* target) @@ -141,16 +153,6 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target) cmMakefile* makefile = target->GetMakefile(); cmLocalGenerator* localGen = makefile->GetLocalGenerator(); const char* targetName = target->GetName(); - // don't do anything if there is no Qt4 or Qt5Core (which contains moc): - std::string qtMajorVersion = makefile->GetSafeDefinition("QT_VERSION_MAJOR"); - if (qtMajorVersion == "") - { - qtMajorVersion = makefile->GetSafeDefinition("Qt5Core_VERSION_MAJOR"); - } - if (qtMajorVersion != "4" && qtMajorVersion != "5") - { - return; - } bool relaxedMode = makefile->IsOn("CMAKE_AUTOMOC_RELAXED_MODE"); diff --git a/Source/cmQtAutomoc.h b/Source/cmQtAutomoc.h index 962e254..01b68fc 100644 --- a/Source/cmQtAutomoc.h +++ b/Source/cmQtAutomoc.h @@ -23,7 +23,7 @@ public: cmQtAutomoc(); bool Run(const char* targetDirectory); - void InitializeMocSourceFile(cmTarget* target); + bool InitializeMocSourceFile(cmTarget* target); void SetupAutomocTarget(cmTarget* target); private: diff --git a/Source/cmStringCommand.h b/Source/cmStringCommand.h index 4423a90..30dbaa5 100644 --- a/Source/cmStringCommand.h +++ b/Source/cmStringCommand.h @@ -136,6 +136,9 @@ public: " [^ ] Matches any character(s) not inside the brackets\n" " - Inside brackets, specifies an inclusive range between\n" " characters on either side e.g. [a-f] is [abcdef]\n" + " To match a literal - using brackets, make it the first\n" + " or the last character e.g. [+*/-] matches basic\n" + " mathematical operators.\n" " * Matches preceding pattern zero or more times\n" " + Matches preceding pattern one or more times\n" " ? Matches preceding pattern zero or once only\n" @@ -144,6 +147,10 @@ public: " in the REGEX REPLACE operation. Additionally it is saved\n" " by all regular expression-related commands, including \n" " e.g. if( MATCHES ), in the variables CMAKE_MATCH_(0..9).\n" + "*, + and ? have higher precedence than concatenation. | has lower " + "precedence than concatenation. This means that the regular expression " + "\"^ab+d$\" matches \"abbd\" but not \"ababd\", and the regular " + "expression \"^(ab|cd)$\" matches \"ab\" but not \"abd\".\n" "TIMESTAMP will write a string representation of " "the current date and/or time to the output variable.\n" "Should the command be unable to obtain a timestamp " diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index f38b16e..e0d7fa4 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1232,7 +1232,9 @@ void cmTarget::DefineProperties(cmake *cm) ("GENERATOR_FILE_NAME", cmProperty::TARGET, "Generator's file for this target.", "An internal property used by some generators to record the name of " - "project or dsp file associated with this target."); + "project or dsp file associated with this target. Note that at configure " + "time, this property is only set for targets created by " + "include_external_msproject()."); cm->DefineProperty ("SOURCES", cmProperty::TARGET, @@ -2898,7 +2900,8 @@ std::vector<std::string> cmTarget::GetIncludeDirectories(const char *config) ge.Parse(it->Value); std::string result = cge->Evaluate(this->Makefile, config, false, this, 0, 0); - if (!this->Makefile->FindTargetToUse(result.c_str())) + if (!cmGeneratorExpression::IsValidTargetName(result.c_str()) + || !this->Makefile->FindTargetToUse(result.c_str())) { continue; } @@ -2975,7 +2978,9 @@ std::string cmTarget::GetCompileDefinitions(const char *config) for (std::vector<std::string>::const_iterator it = libs.begin(); it != libs.end(); ++it) { - if (this->Makefile->FindTargetToUse(it->c_str())) + if ((cmGeneratorExpression::IsValidTargetName(it->c_str()) + || cmGeneratorExpression::Find(it->c_str()) != std::string::npos) + && this->Makefile->FindTargetToUse(it->c_str())) { depString += sep + "$<TARGET_PROPERTY:" + *it + ",INTERFACE_COMPILE_DEFINITIONS>"; @@ -4748,6 +4753,10 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget *tgt, || (!impliedByUse && !explicitlySet)); cmComputeLinkInformation *info = tgt->GetLinkInformation(config); + if(!info) + { + return propContent; + } const cmComputeLinkInformation::ItemVector &deps = info->GetItems(); bool propInitialized = explicitlySet; @@ -4888,6 +4897,10 @@ bool isLinkDependentProperty(cmTarget *tgt, const std::string &p, const char *config) { cmComputeLinkInformation *info = tgt->GetLinkInformation(config); + if(!info) + { + return false; + } const cmComputeLinkInformation::ItemVector &deps = info->GetItems(); |