From 1c17dcd9698faa9c8a96420b4856e5c6a356888b Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Tue, 16 May 2006 14:04:08 -0400 Subject: ENH: move changes from main tree to branch --- ChangeLog.manual | 5 ++++ Source/cmGlobalXCodeGenerator.cxx | 38 ++++++++++++++++++++++---- Source/cmGlobalXCodeGenerator.h | 1 + Source/cmListCommand.cxx | 3 +- Source/cmListCommand.h | 7 ++--- Source/cmLocalUnixMakefileGenerator3.cxx | 2 -- Source/cmMakefileExecutableTargetGenerator.cxx | 6 ++++ 7 files changed, 49 insertions(+), 13 deletions(-) diff --git a/ChangeLog.manual b/ChangeLog.manual index 80eb39cb66..c7a8e173a4 100644 --- a/ChangeLog.manual +++ b/ChangeLog.manual @@ -1,4 +1,9 @@ Changes in CMake 2.4.2 + +* Run symlink command from correct directory for executable versions + +* Fix for universal binaries and Xcode depend problem + * Changes to LIST command, see --help-command LIST * Fix FindQT to be able to use full paths to source files diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index fea2193c93..d48723f07b 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -2145,16 +2145,17 @@ void cmGlobalXCodeGenerator this->CurrentMakefile->GetDefinition("CMAKE_OSX_SYSROOT"); if(osxArch && sysroot) { - std::vector archs; + this->Architectures.clear(); cmSystemTools::ExpandListArgument(std::string(osxArch), - archs); - if(archs.size() > 1) + this->Architectures); + if(this->Architectures.size() > 1) { buildSettings->AddAttribute("SDKROOT", this->CreateString(sysroot)); std::string archString; - for( std::vector::iterator i = archs.begin(); - i != archs.end(); ++i) + for( std::vector::iterator i = + this->Architectures.begin(); + i != this->Architectures.end(); ++i) { archString += *i; archString += " "; @@ -2326,12 +2327,37 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget( this->ConvertToRelativeForMake(d->c_str()); } } - // Write the action to remove the target if it is out of date. makefileStream << "\n"; makefileStream << "\t/bin/rm -f " << this->ConvertToRelativeForMake(tfull.c_str()) << "\n"; + // if building for more than one architecture + // then remove those exectuables as well + if(this->Architectures.size() > 1) + { + std::string universal = t->GetDirectory(); + universal += "/"; + universal += this->CurrentMakefile->GetProjectName(); + universal += ".build/"; + universal += configName; + universal += "/"; + universal += t->GetName(); + universal += ".build/Objects-normal/"; + for( std::vector::iterator arch = + this->Architectures.begin(); + arch != this->Architectures.end(); ++arch) + { + std::string universalFile = universal; + universalFile += *arch; + universalFile += "/"; + universalFile += t->GetName(); + makefileStream << "\t/bin/rm -f " + << + this->ConvertToRelativeForMake(universalFile.c_str()) + << "\n"; + } + } makefileStream << "\n\n"; } } diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index 669942a7f6..326bfd0fe8 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -182,6 +182,7 @@ private: std::map GroupMap; std::map GroupNameMap; std::map TargetGroup; + std::vector Architectures; }; #endif diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index 88705b7e04..99e3ac3b55 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -299,7 +299,8 @@ bool cmListCommand } //---------------------------------------------------------------------------- -bool cmListCommand::HandleRemoveAtCommand(std::vector const& args) +bool cmListCommand::HandleRemoveAtCommand( + std::vector const& args) { if(args.size() < 3) { diff --git a/Source/cmListCommand.h b/Source/cmListCommand.h index c15a0540c0..129f045aa2 100644 --- a/Source/cmListCommand.h +++ b/Source/cmListCommand.h @@ -79,10 +79,9 @@ public: "INSERT will insert elements to the list to the specified location.\n" "When specifying an index, negative value corresponds to index from the" " end of the list.\n" - "REMOVE_AT and REMOVE_ITEM will remove item from the list. " - "The difference " - "is that REMOVE_ITEM will remove the given items, while REMOVE_AT will " - "remove the item at the given indices.\n" + "REMOVE_AT and REMOVE_ITEM will remove item from the list. The " + "difference is that REMOVE_ITEM will remove the given items, while " + "REMOVE_AT will remove the item at the given indices.\n" ; } diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 6074e6860f..95bf9aa6a1 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1413,8 +1413,6 @@ void cmLocalUnixMakefileGenerator3 this->CreateCDCommand(commands, this->Makefile->GetHomeOutputDirectory(), this->Makefile->GetStartOutputDirectory()); - std::string echoCommand = "@echo \"\""; - commands.push_back(echoCommand.c_str()); this->WriteMakeRule(ruleFileStream, "The main all target", "all", depends, commands, true); diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index 0f36f0d67d..c999106ebc 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -312,6 +312,12 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) symlink += " "; symlink += targetOutPath; commands.push_back(symlink); + commands1.clear(); + commands1.push_back(symlink); + this->LocalGenerator->CreateCDCommand(commands1, + this->Makefile->GetStartOutputDirectory(), + this->Makefile->GetHomeOutputDirectory()); + commands.insert(commands.end(), commands1.begin(), commands1.end()); } // Add the post-build rules when building but not when relinking. -- cgit v1.2.1