diff options
Diffstat (limited to 'Source')
25 files changed, 339 insertions, 123 deletions
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index b5b46f6..60695da 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -412,6 +412,30 @@ bool cmCTestRunTest::StartTest(size_t total) this->TestResult.TestCount = this->TestProperties->Index; this->TestResult.Name = this->TestProperties->Name; this->TestResult.Path = this->TestProperties->Directory.c_str(); + + if(args.size() >= 2 && args[1] == "NOT_AVAILABLE") + { + this->TestProcess = new cmProcess; + std::string msg; + if(this->CTest->GetConfigType().empty()) + { + msg = "Test not available without configuration."; + msg += " (Missing \"-C <config>\"?)"; + } + else + { + msg = "Test not available in configuration \""; + msg += this->CTest->GetConfigType(); + msg += "\"."; + } + *this->TestHandler->LogFile << msg << std::endl; + cmCTestLog(this->CTest, ERROR_MESSAGE, msg << std::endl); + this->TestResult.Output = msg; + this->TestResult.FullCommandLine = ""; + this->TestResult.CompletionStatus = "Not Run"; + this->TestResult.Status = cmCTestTestHandler::NOT_RUN; + return false; + } // Check if all required files exist for(std::vector<std::string>::iterator i = diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index bad26c5..e3b81df 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -1320,6 +1320,10 @@ std::string cmCTestTestHandler::FindTheExecutable(const char *exe) std::string resConfig; std::vector<std::string> extraPaths; std::vector<std::string> failedPaths; + if(strcmp(exe, "NOT_AVAILABLE") == 0) + { + return exe; + } return cmCTestTestHandler::FindExecutable(this->CTest, exe, resConfig, extraPaths, @@ -1936,6 +1940,7 @@ void cmCTestTestHandler::SetTestsToRunInformation(const char* in) fin.getline(buff, filelen); buff[fin.gcount()] = 0; this->TestsToRunString = buff; + delete [] buff; } } diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index 342c217..1021bf2 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -69,7 +69,7 @@ We can also infer the edge because *every* time A appears B is seen on its right. We do not know whether A really needs symbols from B to link, but it *might* so we must preserve their order. This is the case also for the following -explict lists: +explicit lists: X: A B Y Y: A B diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx index 994445d..ea25e60 100644 --- a/Source/cmDocumentVariables.cxx +++ b/Source/cmDocumentVariables.cxx @@ -822,6 +822,18 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "set to the output of uname -r. On other " "systems this is set to major-minor version numbers.",false, "Variables That Describe the System"); + cm->DefineProperty + ("CMAKE_LIBRARY_ARCHITECTURE", cmProperty::VARIABLE, + "Target architecture library directory name, if detected.", + "This is the value of CMAKE_<lang>_LIBRARY_ARCHITECTURE as " + "detected for one of the enabled languages.",false, + "Variables That Describe the System"); + cm->DefineProperty + ("CMAKE_LIBRARY_ARCHITECTURE_REGEX", cmProperty::VARIABLE, + "Regex matching possible target architecture library directory names.", + "This is used to detect CMAKE_<lang>_LIBRARY_ARCHITECTURE from the " + "implicit linker search path by matching the <arch> name.",false, + "Variables That Describe the System"); cm->DefineProperty ("CMAKE_HOST_SYSTEM", cmProperty::VARIABLE, @@ -1360,6 +1372,14 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "Variables for Languages"); cm->DefineProperty + ("CMAKE_<LANG>_LIBRARY_ARCHITECTURE", cmProperty::VARIABLE, + "Target architecture library directory name detected for <lang>.", + "If the <lang> compiler passes to the linker an architecture-specific " + "system library search directory such as <prefix>/lib/<arch> this " + "variable contains the <arch> name if/as detected by CMake.",false, + "Variables for Languages"); + + cm->DefineProperty ("CMAKE_<LANG>_LINKER_PREFERENCE_PROPAGATES", cmProperty::VARIABLE, "True if CMAKE_<LANG>_LINKER_PREFERENCE propagates across targets.", "This is used when CMake selects a linker language for a target. " diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index d0fe99f..ce9deb1 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -72,12 +72,14 @@ void cmFindBase::GenerateDocumentation() "1. Search paths specified in cmake-specific cache variables. " "These are intended to be used on the command line with a -DVAR=value. " "This can be skipped if NO_CMAKE_PATH is passed.\n" + "XXX_EXTRA_PREFIX_ENTRY" " <prefix>/XXX_SUBDIR for each <prefix> in CMAKE_PREFIX_PATH\n" " CMAKE_XXX_PATH\n" " CMAKE_XXX_MAC_PATH\n" "2. Search paths specified in cmake-specific environment variables. " "These are intended to be set in the user's shell configuration. " "This can be skipped if NO_CMAKE_ENVIRONMENT_PATH is passed.\n" + "XXX_EXTRA_PREFIX_ENTRY" " <prefix>/XXX_SUBDIR for each <prefix> in CMAKE_PREFIX_PATH\n" " CMAKE_XXX_PATH\n" " CMAKE_XXX_MAC_PATH\n" @@ -92,6 +94,7 @@ void cmFindBase::GenerateDocumentation() "5. Search cmake variables defined in the Platform files " "for the current system. This can be skipped if NO_CMAKE_SYSTEM_PATH " "is passed.\n" + "XXX_EXTRA_PREFIX_ENTRY" " <prefix>/XXX_SUBDIR for each <prefix> in CMAKE_SYSTEM_PREFIX_PATH\n" " CMAKE_SYSTEM_XXX_PATH\n" " CMAKE_SYSTEM_XXX_MAC_PATH\n" @@ -346,6 +349,15 @@ void cmFindBase::AddPrefixPaths(std::vector<std::string> const& in_paths, { dir += "/"; } + if(subdir == "lib") + { + const char* arch = + this->Makefile->GetDefinition("CMAKE_LIBRARY_ARCHITECTURE"); + if(arch && *arch) + { + this->AddPathInternal(dir+"lib/"+arch, pathType); + } + } std::string add = dir + subdir; if(add != "/") { diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx index b309376..2fa2cca 100644 --- a/Source/cmFindLibraryCommand.cxx +++ b/Source/cmFindLibraryCommand.cxx @@ -44,6 +44,10 @@ void cmFindLibraryCommand::GenerateDocumentation() "SEARCH_XXX", "library"); cmSystemTools::ReplaceString(this->GenericDocumentation, "XXX_SUBDIR", "lib"); + cmSystemTools::ReplaceString( + this->GenericDocumentation, + "XXX_EXTRA_PREFIX_ENTRY", + " <prefix>/lib/<arch> if CMAKE_LIBRARY_ARCHITECTURE is set, and\n"); cmSystemTools::ReplaceString(this->GenericDocumentation, "CMAKE_FIND_ROOT_PATH_MODE_XXX", "CMAKE_FIND_ROOT_PATH_MODE_LIBRARY"); @@ -160,11 +164,6 @@ void cmFindLibraryCommand::AddArchitecturePaths(const char* suffix) void cmFindLibraryCommand::AddLib64Paths() { - if(!this->Makefile->GetLocalGenerator()->GetGlobalGenerator()-> - GetLanguageEnabled("C")) - { - return; - } std::string voidsize = this->Makefile->GetSafeDefinition("CMAKE_SIZEOF_VOID_P"); int size = atoi(voidsize.c_str()); diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index b77273c..5f106bc 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -243,9 +243,9 @@ void cmFindPackageCommand::GenerateDocumentation() " <prefix>/(cmake|CMake)/ (W)\n" " <prefix>/<name>*/ (W)\n" " <prefix>/<name>*/(cmake|CMake)/ (W)\n" - " <prefix>/(share|lib)/cmake/<name>*/ (U)\n" - " <prefix>/(share|lib)/<name>*/ (U)\n" - " <prefix>/(share|lib)/<name>*/(cmake|CMake)/ (U)\n" + " <prefix>/(lib/<arch>|lib|share)/cmake/<name>*/ (U)\n" + " <prefix>/(lib/<arch>|lib|share)/<name>*/ (U)\n" + " <prefix>/(lib/<arch>|lib|share)/<name>*/(cmake|CMake)/ (U)\n" "On systems supporting OS X Frameworks and Application Bundles " "the following directories are searched for frameworks or bundles " "containing a configuration file:\n" @@ -257,6 +257,7 @@ void cmFindPackageCommand::GenerateDocumentation() " <prefix>/<name>.app/Contents/Resources/CMake/ (A)\n" "In all cases the <name> is treated as case-insensitive and corresponds " "to any of the names specified (<package> or names given by NAMES). " + "Paths with lib/<arch> are enabled if CMAKE_LIBRARY_ARCHITECTURE is set. " "If PATH_SUFFIXES is specified the suffixes are appended to each " "(W) or (U) directory entry one-by-one.\n" "This set of directories is intended to work in cooperation with " @@ -362,6 +363,13 @@ bool cmFindPackageCommand // Check for debug mode. this->DebugMode = this->Makefile->IsOn("CMAKE_FIND_DEBUG_MODE"); + // Lookup target architecture, if any. + if(const char* arch = + this->Makefile->GetDefinition("CMAKE_LIBRARY_ARCHITECTURE")) + { + this->LibraryArchitecture = arch; + } + // Lookup whether lib64 paths should be used. if(this->Makefile->PlatformIs64Bit() && this->Makefile->GetCMakeInstance() @@ -2189,6 +2197,10 @@ bool cmFindPackageCommand::SearchPrefix(std::string const& prefix_in) // Construct list of common install locations (lib and share). std::vector<std::string> common; + if(!this->LibraryArchitecture.empty()) + { + common.push_back("lib/"+this->LibraryArchitecture); + } if(this->UseLib64Paths) { common.push_back("lib64"); @@ -2196,7 +2208,7 @@ bool cmFindPackageCommand::SearchPrefix(std::string const& prefix_in) common.push_back("lib"); common.push_back("share"); - // PREFIX/(share|lib)/cmake/(Foo|foo|FOO).*/ + // PREFIX/(lib/ARCH|lib|share)/cmake/(Foo|foo|FOO).*/ { cmFindPackageFileList lister(this); lister @@ -2210,7 +2222,7 @@ bool cmFindPackageCommand::SearchPrefix(std::string const& prefix_in) } } - // PREFIX/(share|lib)/(Foo|foo|FOO).*/ + // PREFIX/(lib/ARCH|lib|share)/(Foo|foo|FOO).*/ { cmFindPackageFileList lister(this); lister @@ -2223,7 +2235,7 @@ bool cmFindPackageCommand::SearchPrefix(std::string const& prefix_in) } } - // PREFIX/(share|lib)/(Foo|foo|FOO).*/(cmake|CMake)/ + // PREFIX/(lib/ARCH|lib|share)/(Foo|foo|FOO).*/(cmake|CMake)/ { cmFindPackageFileList lister(this); lister diff --git a/Source/cmFindPackageCommand.h b/Source/cmFindPackageCommand.h index 4229d37..2b2e1da 100644 --- a/Source/cmFindPackageCommand.h +++ b/Source/cmFindPackageCommand.h @@ -141,6 +141,7 @@ private: bool DebugMode; bool UseLib64Paths; bool PolicyScope; + std::string LibraryArchitecture; std::vector<std::string> Names; std::vector<std::string> Configs; std::set<std::string> IgnoredPaths; diff --git a/Source/cmFindPathCommand.cxx b/Source/cmFindPathCommand.cxx index 83b651b..846d187 100644 --- a/Source/cmFindPathCommand.cxx +++ b/Source/cmFindPathCommand.cxx @@ -46,6 +46,8 @@ void cmFindPathCommand::GenerateDocumentation() cmSystemTools::ReplaceString(this->GenericDocumentation, "XXX_SUBDIR", "include"); cmSystemTools::ReplaceString(this->GenericDocumentation, + "XXX_EXTRA_PREFIX_ENTRY", ""); + cmSystemTools::ReplaceString(this->GenericDocumentation, "CMAKE_FIND_ROOT_PATH_MODE_XXX", "CMAKE_FIND_ROOT_PATH_MODE_INCLUDE"); if(!this->IncludeFileInPath) diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx index 71cfdcb..7c56ad7 100644 --- a/Source/cmFindProgramCommand.cxx +++ b/Source/cmFindProgramCommand.cxx @@ -42,6 +42,8 @@ void cmFindProgramCommand::GenerateDocumentation() cmSystemTools::ReplaceString(this->GenericDocumentation, "XXX_SUBDIR", "[s]bin"); cmSystemTools::ReplaceString(this->GenericDocumentation, + "XXX_EXTRA_PREFIX_ENTRY", ""); + cmSystemTools::ReplaceString(this->GenericDocumentation, "CMAKE_FIND_ROOT_PATH_MODE_XXX", "CMAKE_FIND_ROOT_PATH_MODE_PROGRAM"); } diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 1077afd..2cbd3ed 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -323,6 +323,19 @@ void cmGlobalXCodeGenerator::SetGenerationRoot(cmLocalGenerator* root) } //---------------------------------------------------------------------------- +std::string +cmGlobalXCodeGenerator::PostBuildMakeTarget(std::string const& tName, + std::string const& configName) +{ + std::string out = "PostBuild." + tName; + if(this->XcodeVersion > 20) + { + out += "." + configName; + } + return out; +} + +//---------------------------------------------------------------------------- void cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root, std::vector<cmLocalGenerator*>& gens) @@ -351,12 +364,8 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root, makecommand.push_back(dir.c_str()); makecommand.push_back("-f"); makecommand.push_back(this->CurrentXCodeHackMakefile.c_str()); - if(this->XcodeVersion > 20) - { - makecommand.push_back("all.$(CONFIGURATION)"); - } - cmCustomCommandLines commandLines; - commandLines.push_back(makecommand); + makecommand.push_back(""); // placeholder, see below + // Add Re-Run CMake rules this->CreateReRunCMakeFile(root, gens); @@ -383,6 +392,10 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root, target.GetType() == cmTarget::SHARED_LIBRARY || target.GetType() == cmTarget::MODULE_LIBRARY)) { + makecommand[makecommand.size()-1] = + this->PostBuildMakeTarget(target.GetName(), "$(CONFIGURATION)"); + cmCustomCommandLines commandLines; + commandLines.push_back(makecommand); lg->GetMakefile()->AddCustomCommandToTarget(target.GetName(), no_depends, commandLines, @@ -2437,6 +2450,10 @@ void cmGlobalXCodeGenerator { linkLibs += li->Value; } + if(li->Target && !li->Target->IsImported()) + { + target->AddDependTarget(configName, li->Target->GetName()); + } } this->AppendBuildSettingAttribute(target, "OTHER_LDFLAGS", linkLibs.c_str(), configName); @@ -2500,62 +2517,119 @@ void cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root, } } +cmXCodeObject *cmGlobalXCodeGenerator +::CreatePBXGroup(cmXCodeObject *parent, cmStdString name) +{ + cmXCodeObject* parentChildren = NULL; + if(parent) + parentChildren = parent->GetObject("children"); + cmXCodeObject* group = this->CreateObject(cmXCodeObject::PBXGroup); + cmXCodeObject* groupChildren = + this->CreateObject(cmXCodeObject::OBJECT_LIST); + group->AddAttribute("name", this->CreateString(name.c_str())); + group->AddAttribute("children", groupChildren); + if(this->XcodeVersion == 15) + { + group->AddAttribute("refType", this->CreateString("4")); + } + group->AddAttribute("sourceTree", this->CreateString("<group>")); + if(parentChildren) + parentChildren->AddObject(group); + return group; +} + //---------------------------------------------------------------------------- cmXCodeObject* cmGlobalXCodeGenerator ::CreateOrGetPBXGroup(cmTarget& cmtarget, cmSourceGroup* sg) { - cmStdString s = cmtarget.GetName(); - s += "/"; - s += sg->GetName(); - std::map<cmStdString, cmXCodeObject* >::iterator i = + cmStdString s; + cmStdString target; + const char *targetFolder= cmtarget.GetProperty("FOLDER"); + if(targetFolder) { + target = targetFolder; + target += "/"; + } + target += cmtarget.GetName(); + s = target + "/"; + s += sg->GetFullName(); + std::map<cmStdString, cmXCodeObject* >::iterator it = this->GroupNameMap.find(s); - if(i != this->GroupNameMap.end()) + if(it != this->GroupNameMap.end()) { - return i->second; + return it->second; } - i = this->TargetGroup.find(cmtarget.GetName()); + + it = this->TargetGroup.find(target); cmXCodeObject* tgroup = 0; - if(i != this->TargetGroup.end()) + if(it != this->TargetGroup.end()) { - tgroup = i->second; + tgroup = it->second; } else { - tgroup = this->CreateObject(cmXCodeObject::PBXGroup); - this->TargetGroup[cmtarget.GetName()] = tgroup; - cmXCodeObject* tgroupChildren = - this->CreateObject(cmXCodeObject::OBJECT_LIST); - tgroup->AddAttribute("name", this->CreateString(cmtarget.GetName())); - tgroup->AddAttribute("children", tgroupChildren); - if(this->XcodeVersion == 15) + std::vector<std::string> tgt_folders = + cmSystemTools::tokenize(target, "/"); + cmStdString curr_tgt_folder; + for(std::vector<std::string>::size_type i = 0; i < tgt_folders.size();i++) { - tgroup->AddAttribute("refType", this->CreateString("4")); + curr_tgt_folder += tgt_folders[i]; + it = this->TargetGroup.find(curr_tgt_folder); + if(it == this->TargetGroup.end()) + { + tgroup = this->CreatePBXGroup(tgroup,tgt_folders[i]); + this->TargetGroup[curr_tgt_folder] = tgroup; + } + else + { + tgroup = it->second; + continue; + } + if(i == 0) + { + this->SourcesGroupChildren->AddObject(tgroup); + } + curr_tgt_folder += "/"; } - tgroup->AddAttribute("sourceTree", this->CreateString("<group>")); - this->SourcesGroupChildren->AddObject(tgroup); } + this->TargetGroup[target] = tgroup; // If it's the default source group (empty name) then put the source file // directly in the tgroup... // - if (cmStdString(sg->GetName()) == "") + if (cmStdString(sg->GetFullName()) == "") { this->GroupNameMap[s] = tgroup; return tgroup; } - cmXCodeObject* tgroupChildren = tgroup->GetObject("children"); - cmXCodeObject* group = this->CreateObject(cmXCodeObject::PBXGroup); - cmXCodeObject* groupChildren = - this->CreateObject(cmXCodeObject::OBJECT_LIST); - group->AddAttribute("name", this->CreateString(sg->GetName())); - group->AddAttribute("children", groupChildren); - if(this->XcodeVersion == 15) + //It's a recursive folder structure, let's find the real parent group + if(std::string(sg->GetFullName()) != std::string(sg->GetName())) { - group->AddAttribute("refType", this->CreateString("4")); + std::vector<std::string> folders = + cmSystemTools::tokenize(sg->GetFullName(), "\\"); + cmStdString curr_folder = cmtarget.GetName(); + curr_folder += "/"; + for(std::vector<std::string>::size_type i = 0; i < folders.size();i++) + { + curr_folder += folders[i]; + std::map<cmStdString, cmXCodeObject* >::iterator i_folder = + this->GroupNameMap.find(curr_folder); + //Create new folder + if(i_folder == this->GroupNameMap.end()) + { + cmXCodeObject *group = this->CreatePBXGroup(tgroup,folders[i]); + this->GroupNameMap[curr_folder] = group; + tgroup = group; + } + else + { + tgroup = i_folder->second; + } + curr_folder = curr_folder + "\\"; + } + return tgroup; } - group->AddAttribute("sourceTree", this->CreateString("<group>")); - tgroupChildren->AddObject(group); + cmXCodeObject *group = this->CreatePBXGroup(tgroup,sg->GetName()); this->GroupNameMap[s] = group; return group; } @@ -2882,41 +2956,10 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget( // correctly by xcode makefileStream << "# DO NOT EDIT\n"; makefileStream << "# This makefile makes sure all linkable targets are\n"; - makefileStream << "# up-to-date with anything they link to, avoiding a " - "bug in Xcode 1.5\n"; - for(std::vector<std::string>::const_iterator - ct = this->CurrentConfigurationTypes.begin(); - ct != this->CurrentConfigurationTypes.end(); ++ct) - { - if(this->XcodeVersion < 21 || ct->empty()) - { - makefileStream << "all: "; - } - else - { - makefileStream << "all." << *ct << ": "; - } - const char* configName = 0; - if(!ct->empty()) - { - configName = ct->c_str(); - } - for(std::vector<cmXCodeObject*>::iterator i = targets.begin(); - i != targets.end(); ++i) - { - cmXCodeObject* target = *i; - cmTarget* t =target->GetTarget(); - if(t->GetType() == cmTarget::EXECUTABLE || - t->GetType() == cmTarget::SHARED_LIBRARY || - t->GetType() == cmTarget::MODULE_LIBRARY) - { - std::string tfull = t->GetFullPath(configName); - makefileStream << "\\\n\t" << - this->ConvertToRelativeForMake(tfull.c_str()); - } - } - makefileStream << "\n\n"; - } + makefileStream << "# up-to-date with anything they link to\n" + "default:\n" + "\techo \"Do not invoke directly\"\n" + "\n"; makefileStream << "# For each target create a dummy rule " "so the target does not have to exist\n"; @@ -2962,14 +3005,40 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget( { cmXCodeObject* target = *i; cmTarget* t =target->GetTarget(); + + if(t->GetType() == cmTarget::EXECUTABLE || + t->GetType() == cmTarget::STATIC_LIBRARY || + t->GetType() == cmTarget::SHARED_LIBRARY || + t->GetType() == cmTarget::MODULE_LIBRARY) + { + // Declare an entry point for the target post-build phase. + makefileStream << this->PostBuildMakeTarget(t->GetName(), *ct) + << ":\n"; + } + if(t->GetType() == cmTarget::EXECUTABLE || t->GetType() == cmTarget::SHARED_LIBRARY || t->GetType() == cmTarget::MODULE_LIBRARY) { - // Create a rule for this target. std::string tfull = t->GetFullPath(configName); - makefileStream << this->ConvertToRelativeForMake(tfull.c_str()) - << ":"; + std::string trel = this->ConvertToRelativeForMake(tfull.c_str()); + + // Add this target to the post-build phases of its dependencies. + std::map<cmStdString, cmXCodeObject::StringVec>::const_iterator + y = target->GetDependTargets().find(*ct); + if(y != target->GetDependTargets().end()) + { + std::vector<cmStdString> const& deptgts = y->second; + for(std::vector<cmStdString>::const_iterator d = deptgts.begin(); + d != deptgts.end(); ++d) + { + makefileStream << this->PostBuildMakeTarget(*d, *ct) << ": " + << trel << "\n"; + } + } + + // Create a rule for this target. + makefileStream << trel << ":"; // List dependencies if any exist. std::map<cmStdString, cmXCodeObject::StringVec>::const_iterator diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index 290532a..39a5fd7 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -88,6 +88,8 @@ public: private: cmXCodeObject* CreateOrGetPBXGroup(cmTarget& cmtarget, cmSourceGroup* sg); + cmXCodeObject* CreatePBXGroup(cmXCodeObject *parent, + cmStdString name); void CreateGroups(cmLocalGenerator* root, std::vector<cmLocalGenerator*>& generators); @@ -198,6 +200,8 @@ protected: std::vector<cmXCodeObject*> XCodeObjects; cmXCodeObject* RootObject; private: + std::string PostBuildMakeTarget(std::string const& tName, + std::string const& configName); cmXCodeObject* MainGroupChildren; cmXCodeObject* SourcesGroupChildren; cmXCodeObject* ResourcesGroupChildren; diff --git a/Source/cmScriptGenerator.cxx b/Source/cmScriptGenerator.cxx index 86ecebe..cabe98a 100644 --- a/Source/cmScriptGenerator.cxx +++ b/Source/cmScriptGenerator.cxx @@ -209,6 +209,7 @@ void cmScriptGenerator::GenerateScriptActionsPerConfig(std::ostream& os, // In a multi-configuration generator we produce a separate rule // in a block for each configuration that is built. We restrict // the list of configurations to those to which this rule applies. + bool first = true; for(std::vector<std::string>::const_iterator i = this->ConfigurationTypes->begin(); i != this->ConfigurationTypes->end(); ++i) @@ -218,10 +219,19 @@ void cmScriptGenerator::GenerateScriptActionsPerConfig(std::ostream& os, { // Generate a per-configuration block. std::string config_test = this->CreateConfigTest(config); - os << indent << "IF(" << config_test << ")\n"; + os << indent << (first? "IF(" : "ELSEIF(") << config_test << ")\n"; this->GenerateScriptForConfig(os, config, indent.Next()); - os << indent << "ENDIF(" << config_test << ")\n"; + first = false; } } + if(!first) + { + if(this->NeedsScriptNoConfig()) + { + os << indent << "ELSE()\n"; + this->GenerateScriptNoConfig(os, indent.Next()); + } + os << indent << "ENDIF()\n"; + } } } diff --git a/Source/cmScriptGenerator.h b/Source/cmScriptGenerator.h index e2a0da5..8b2ca33 100644 --- a/Source/cmScriptGenerator.h +++ b/Source/cmScriptGenerator.h @@ -65,6 +65,8 @@ protected: virtual void GenerateScriptForConfig(std::ostream& os, const char* config, Indent const& indent); + virtual void GenerateScriptNoConfig(std::ostream&, Indent const&) {} + virtual bool NeedsScriptNoConfig() const { return false; } // Test if this generator does something for a given configuration. bool GeneratesForConfig(const char*); diff --git a/Source/cmSourceGroupCommand.cxx b/Source/cmSourceGroupCommand.cxx index 27d90db..8e61d0a 100644 --- a/Source/cmSourceGroupCommand.cxx +++ b/Source/cmSourceGroupCommand.cxx @@ -11,37 +11,6 @@ ============================================================================*/ #include "cmSourceGroupCommand.h" -inline std::vector<std::string> tokenize(const std::string& str, - const std::string& sep) -{ - std::vector<std::string> tokens; - std::string::size_type tokend = 0; - - do - { - std::string::size_type tokstart=str.find_first_not_of(sep, tokend); - if (tokstart==std::string::npos) - { - break; // no more tokens - } - tokend=str.find_first_of(sep,tokstart); - if (tokend==std::string::npos) - { - tokens.push_back(str.substr(tokstart)); - } - else - { - tokens.push_back(str.substr(tokstart,tokend-tokstart)); - } - } while (tokend!=std::string::npos); - - if (tokens.empty()) - { - tokens.push_back(""); - } - return tokens; -} - // cmSourceGroupCommand bool cmSourceGroupCommand ::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &) @@ -58,7 +27,8 @@ bool cmSourceGroupCommand delimiter = this->Makefile->GetDefinition("SOURCE_GROUP_DELIMITER"); } - std::vector<std::string> folders = tokenize(args[0], delimiter); + std::vector<std::string> folders = + cmSystemTools::tokenize(args[0], delimiter); cmSourceGroup* sg = 0; sg = this->Makefile->GetSourceGroup(folders); diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index c40e905..dbb2226 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -2919,3 +2919,35 @@ bool cmSystemTools::RepeatedRemoveDirectory(const char* dir) } return false; } + +//---------------------------------------------------------------------------- +std::vector<std::string> cmSystemTools::tokenize(const std::string& str, + const std::string& sep) +{ + std::vector<std::string> tokens; + std::string::size_type tokend = 0; + + do + { + std::string::size_type tokstart=str.find_first_not_of(sep, tokend); + if (tokstart==std::string::npos) + { + break; // no more tokens + } + tokend=str.find_first_of(sep,tokstart); + if (tokend==std::string::npos) + { + tokens.push_back(str.substr(tokstart)); + } + else + { + tokens.push_back(str.substr(tokstart,tokend-tokstart)); + } + } while (tokend!=std::string::npos); + + if (tokens.empty()) + { + tokens.push_back(""); + } + return tokens; +} diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index fc85d4a..ce49959 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -444,6 +444,9 @@ public: /** Remove a directory; repeat a few times in case of locked files. */ static bool RepeatedRemoveDirectory(const char* dir); + /** Tokenize a string */ + static std::vector<std::string> tokenize(const std::string& str, + const std::string& sep); private: static bool s_ForceUnixPaths; static bool s_RunCommandHideConsole; diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 7bd5372..52b9072 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -590,7 +590,7 @@ void cmTarget::DefineProperties(cmake *cm) "For an executable with exports (see the ENABLE_EXPORTS property) " "no default transitive link dependencies are used. " "This property replaces the default transitive link dependencies with " - "an explict list. " + "an explicit list. " "When the target is linked into another target the libraries " "listed (and recursively their link interface libraries) will be " "provided to the other target also. " diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx index 39f8638..e0892b2 100644 --- a/Source/cmTestGenerator.cxx +++ b/Source/cmTestGenerator.cxx @@ -130,6 +130,22 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os, } //---------------------------------------------------------------------------- +void cmTestGenerator::GenerateScriptNoConfig(std::ostream& os, + Indent const& indent) +{ + os << indent << "ADD_TEST(" << this->Test->GetName() << " NOT_AVAILABLE)\n"; +} + +//---------------------------------------------------------------------------- +bool cmTestGenerator::NeedsScriptNoConfig() const +{ + return (this->TestGenerated && // test generated for at least one config + this->ActionsPerConfig && // test is config-aware + this->Configurations.empty() && // test runs in all configs + !this->ConfigurationTypes->empty()); // config-dependent command +} + +//---------------------------------------------------------------------------- void cmTestGenerator::GenerateOldStyle(std::ostream& fout, Indent const& indent) { diff --git a/Source/cmTestGenerator.h b/Source/cmTestGenerator.h index 85d9091..2c69fc3 100644 --- a/Source/cmTestGenerator.h +++ b/Source/cmTestGenerator.h @@ -34,6 +34,8 @@ protected: virtual void GenerateScriptForConfig(std::ostream& os, const char* config, Indent const& indent); + virtual void GenerateScriptNoConfig(std::ostream& os, Indent const& indent); + virtual bool NeedsScriptNoConfig() const; void GenerateOldStyle(std::ostream& os, Indent const& indent); cmTest* Test; diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index facb551..d710405 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -351,6 +351,9 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile* source, { if(!cmSystemTools::FileExists(sourcePath.c_str())) { + // Make sure the path exists for the file + std::string path = cmSystemTools::GetFilenamePath(sourcePath); + cmSystemTools::MakeDirectory(path.c_str()); std::ofstream fout(sourcePath.c_str()); if(fout) { @@ -358,6 +361,14 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile* source, fout.flush(); fout.close(); } + else + { + std::string error = "Could not create file: ["; + error += sourcePath; + error += "] "; + cmSystemTools::Error + (error.c_str(), cmSystemTools::GetLastSystemError().c_str()); + } } } cmLocalVisualStudio7Generator* lg = this->LocalGenerator; diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx index ed0d60c..ae496ad 100644 --- a/Source/cmVisualStudioGeneratorOptions.cxx +++ b/Source/cmVisualStudioGeneratorOptions.cxx @@ -299,7 +299,12 @@ cmVisualStudioGeneratorOptions { fout << "<" << m->first << ">"; } - fout << m->second << "</" << m->first << ">\n"; + fout << m->second; + if (m->first == "AdditionalIncludeDirectories") + { + fout << ";%(AdditionalIncludeDirectories)"; + } + fout << "</" << m->first << ">\n"; } } else diff --git a/Source/cmXCodeObject.h b/Source/cmXCodeObject.h index bdb4f15..369fe66 100644 --- a/Source/cmXCodeObject.h +++ b/Source/cmXCodeObject.h @@ -139,6 +139,19 @@ public: { return this->DependLibraries; } + void AddDependTarget(const char* configName, + const char* tName) + { + if(!configName) + { + configName = ""; + } + this->DependTargets[configName].push_back(tName); + } + std::map<cmStdString, StringVec> const& GetDependTargets() + { + return this->DependTargets; + } std::vector<cmXCodeObject*> const& GetObjectList() { return this->List;} void SetComment(const char* c) { this->Comment = c;} static void PrintString(std::ostream& os,cmStdString String); @@ -156,6 +169,7 @@ protected: cmXCodeObject* PBXTargetDependencyValue; std::vector<cmXCodeObject*> List; std::map<cmStdString, StringVec> DependLibraries; + std::map<cmStdString, StringVec> DependTargets; std::map<cmStdString, cmXCodeObject*> ObjectAttributes; }; #endif diff --git a/Source/kwsys/Terminal.c b/Source/kwsys/Terminal.c index 7a3266f..25832c2 100644 --- a/Source/kwsys/Terminal.c +++ b/Source/kwsys/Terminal.c @@ -163,6 +163,7 @@ static const char* kwsysTerminalVT100Names[] = "rxvt-unicode-256color", "screen", "screen-256color", + "screen-256color-bce", "screen-bce", "screen-w", "screen.linux", diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 8b46b4d..e5193b4 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 06) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 07) +SET(KWSYS_DATE_STAMP_DAY 24) |