[cmake-commits] alex committed cmExtraEclipseCDT4Generator.cxx 1.8 1.9

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Feb 7 18:24:57 EST 2008


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

Modified Files:
	cmExtraEclipseCDT4Generator.cxx 
Log Message:
patch from Miguel
BUG: fix #5496: eclipse can't load projects where the build dir is a subdir
of the src dir

Alex


Index: cmExtraEclipseCDT4Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmExtraEclipseCDT4Generator.cxx,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- cmExtraEclipseCDT4Generator.cxx	7 Feb 2008 21:26:00 -0000	1.8
+++ cmExtraEclipseCDT4Generator.cxx	7 Feb 2008 23:24:55 -0000	1.9
@@ -283,16 +283,21 @@
          it != this->GlobalGenerator->GetProjectMap().end();
          ++it)
       {
-      fout <<
-        "\t\t<link>\n"
-        "\t\t\t<name>" << it->first << "</name>\n"
-        "\t\t\t<type>2</type>\n"
-        "\t\t\t<location>"
-        << this->GetEclipsePath(
-             it->second[0]->GetMakefile()->GetStartDirectory())
-        << "</location>\n"
-        "\t\t</link>\n"
-        ;
+      std::string linkSourceDirectory =this->GetEclipsePath(
+                            it->second[0]->GetMakefile()->GetStartDirectory());
+      if (!cmSystemTools::IsSubDirectory(homeOutputDirectory.c_str(),
+                                         linkSourceDirectory.c_str()))
+        {
+        fout <<
+          "\t\t<link>\n"
+          "\t\t\t<name>" << it->first << "</name>\n"
+          "\t\t\t<type>2</type>\n"
+          "\t\t\t<location>"
+          << this->GetEclipsePath(linkSourceDirectory)
+          << "</location>\n"
+          "\t\t</link>\n"
+          ;
+        }
       }
     // for EXECUTABLE_OUTPUT_PATH when not in binary dir
     std::string output_path = mf->GetDefinition("EXECUTABLE_OUTPUT_PATH");



More information about the Cmake-commits mailing list