[Cmake-commits] [cmake-commits] alex committed cmExtraEclipseCDT4Generator.cxx 1.33 1.34

cmake-commits at cmake.org cmake-commits at cmake.org
Sat Feb 13 11:08:44 EST 2010


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv17150

Modified Files:
	cmExtraEclipseCDT4Generator.cxx 
Log Message:
-fix bug for Eclipse projects where targets which are in a subdir which has the same name as the project (... and so the linked resource) could not be built

http://public.kitware.com/Bug/view.php?id=9978
Now instead of one linked resource for each project() just one linked
resource to the top level source directory is created.
This should really avoid this type of name clashes. And to me it looks also
much less confusing. 
Hopefully the name "[Source directory]" containing a space and square
brackets doesn't lead to problems somewhere. Here it works.

Alex


Index: cmExtraEclipseCDT4Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmExtraEclipseCDT4Generator.cxx,v
retrieving revision 1.33
retrieving revision 1.34
diff -C 2 -d -r1.33 -r1.34
*** cmExtraEclipseCDT4Generator.cxx	30 Dec 2009 12:31:10 -0000	1.33
--- cmExtraEclipseCDT4Generator.cxx	13 Feb 2010 16:08:42 -0000	1.34
***************
*** 44,50 ****
    entry.Brief = "Generates Eclipse CDT 4.0 project files.";
    entry.Full =
!     "Project files for Eclipse will be created in the top directory "
!     "and will have a linked resource to every subdirectory which "
!     "features a CMakeLists.txt file containing a PROJECT() call."
      "Additionally a hierarchy of makefiles is generated into the "
      "build tree. The appropriate make program can build the project through "
--- 44,50 ----
    entry.Brief = "Generates Eclipse CDT 4.0 project files.";
    entry.Full =
!     "Project files for Eclipse will be created in the top directory. "
!     "In out of source builds, a linked resource to the top level source "
!     "directory will be created."
      "Additionally a hierarchy of makefiles is generated into the "
      "build tree. The appropriate make program can build the project through "
***************
*** 393,414 ****
      {
      fout << "\t<linkedResources>\n";
!     // for each sub project create a linked resource to the source dir
!     // - only if it is an out-of-source build
!     for (std::map<cmStdString, std::vector<cmLocalGenerator*> >::const_iterator
!           it = this->GlobalGenerator->GetProjectMap().begin();
!          it != this->GlobalGenerator->GetProjectMap().end();
!          ++it)
!       {
!       std::string linkSourceDirectory = this->GetEclipsePath(
!                             it->second[0]->GetMakefile()->GetStartDirectory());
!       // .project dir can't be subdir of a linked resource dir
!       if (!cmSystemTools::IsSubDirectory(this->HomeOutputDirectory.c_str(),
                                           linkSourceDirectory.c_str()))
!         {
!         this->AppendLinkedResource(fout, it->first,
!                                    this->GetEclipsePath(linkSourceDirectory));
!         this->SrcLinkedResources.push_back(it->first);
!         }
        }
      // for EXECUTABLE_OUTPUT_PATH when not in binary dir
      this->AppendOutLinkedResource(fout,
--- 393,414 ----
      {
      fout << "\t<linkedResources>\n";
!     // create a linked resource to CMAKE_SOURCE_DIR
!     // (this is not done anymore for each project because of 
!     // http://public.kitware.com/Bug/view.php?id=9978 and because I found it 
!     // actually quite confusing in bigger projects with many directories and 
!     // projects, Alex
! 
!     std::string sourceLinkedResourceName = "[Source directory]";
!     std::string linkSourceDirectory = this->GetEclipsePath(
!                                                       mf->GetStartDirectory());
!     // .project dir can't be subdir of a linked resource dir
!     if (!cmSystemTools::IsSubDirectory(this->HomeOutputDirectory.c_str(),
                                           linkSourceDirectory.c_str()))
!       {
!       this->AppendLinkedResource(fout, sourceLinkedResourceName,
!                                  this->GetEclipsePath(linkSourceDirectory));
!       this->SrcLinkedResources.push_back(sourceLinkedResourceName);
        }
+ 
      // for EXECUTABLE_OUTPUT_PATH when not in binary dir
      this->AppendOutLinkedResource(fout,



More information about the Cmake-commits mailing list