[cmake-commits] hoffman committed CMakeLists.txt 1.289.2.5 1.289.2.6 cmLocalGenerator.cxx 1.132.2.8 1.132.2.9 cmMakefileTargetGenerator.cxx 1.16.2.7 1.16.2.8 cmTarget.cxx 1.96.2.5 1.96.2.6

cmake-commits at cmake.org cmake-commits at cmake.org
Tue Nov 28 14:19:48 EST 2006


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

Modified Files:
      Tag: CMake-2-4
	CMakeLists.txt cmLocalGenerator.cxx 
	cmMakefileTargetGenerator.cxx cmTarget.cxx 
Log Message:
ENH: merge in changes from the main tree


Index: cmLocalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalGenerator.cxx,v
retrieving revision 1.132.2.8
retrieving revision 1.132.2.9
diff -u -d -r1.132.2.8 -r1.132.2.9
--- cmLocalGenerator.cxx	27 Oct 2006 20:01:47 -0000	1.132.2.8
+++ cmLocalGenerator.cxx	28 Nov 2006 19:19:44 -0000	1.132.2.9
@@ -1857,6 +1857,22 @@
   // Look for a CMake target with the given name.
   if(cmTarget* target = this->GlobalGenerator->FindTarget(0, name.c_str()))
     {
+    // make sure it is not just a coincidence that the target name
+    // found is part of the inName
+    if(cmSystemTools::FileIsFullPath(inName))
+      {
+      std::string tLocation = target->GetLocation(config);
+      tLocation = cmSystemTools::GetFilenamePath(tLocation);
+      std::string depLocation = cmSystemTools::GetFilenamePath(
+        std::string(inName));
+      if(depLocation != tLocation)
+        {
+        // it is a full path to a depend that has the same name
+        // as a target but is in a different location so do not use
+        // the target as the depend
+        return inName;
+        }
+      }
     switch (target->GetType())
       {
       case cmTarget::EXECUTABLE:

Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CMakeLists.txt,v
retrieving revision 1.289.2.5
retrieving revision 1.289.2.6
diff -u -d -r1.289.2.5 -r1.289.2.6
--- CMakeLists.txt	27 Oct 2006 20:01:47 -0000	1.289.2.5
+++ CMakeLists.txt	28 Nov 2006 19:19:44 -0000	1.289.2.6
@@ -365,6 +365,7 @@
   # and not the ctest from the cmake building and testing
   # cmake.
   SET(CMAKE_CTEST_COMMAND "${EXECUTABLE_OUTPUT_PATH}/ctest")
+  SET(CMAKE_CMAKE_COMMAND "${EXECUTABLE_OUTPUT_PATH}/cmake")
 
   # Should the long tests be run?
   OPTION(CMAKE_RUN_LONG_TESTS "Should the long tests be run (such as Bootstrap)." ON)
@@ -390,6 +391,18 @@
     --build-project TestTar
     --test-command TestTarExec)
 
+  ADD_TEST(TargetName ${CMAKE_CTEST_COMMAND}
+    --build-and-test
+    "${CMake_SOURCE_DIR}/Tests/TargetName"
+    "${CMake_BINARY_DIR}/Tests/TargetName"
+    --build-two-config
+    --build-generator ${CMAKE_TEST_GENERATOR}
+    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+    --build-project TargetName
+    --test-command ${CMAKE_CMAKE_COMMAND} -E compare_files 
+    ${CMake_SOURCE_DIR}/Tests/TargetName/scripts/hello_world
+    ${CMake_BINARY_DIR}/Tests/TargetName/scripts/hello_world)
+
   ADD_TEST(CustomCommand  ${CMAKE_CTEST_COMMAND}
     --build-and-test 
     "${CMake_SOURCE_DIR}/Tests/CustomCommand"
@@ -729,7 +742,7 @@
     QT_QT_LIBRARY
     QT_UIC_EXE)
 
-  IF (QT_FOUND AND QT_UIC_EXECUTABLE)
+  IF (QT_FOUND AND QT_WRAP_UI)
     ADD_TEST(qtwrapping  ${CMAKE_CTEST_COMMAND}
       --build-and-test
       "${CMake_SOURCE_DIR}/Tests/Wrapping"
@@ -740,7 +753,7 @@
       --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
       --test-command qtwrapping
       )
-  ENDIF (QT_FOUND AND QT_UIC_EXECUTABLE)
+  ENDIF (QT_FOUND AND QT_WRAP_UI)
 
   ADD_TEST(testdriver1 ${CMAKE_CTEST_COMMAND}
     --build-and-test

Index: cmMakefileTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileTargetGenerator.cxx,v
retrieving revision 1.16.2.7
retrieving revision 1.16.2.8
diff -u -d -r1.16.2.7 -r1.16.2.8
--- cmMakefileTargetGenerator.cxx	13 Oct 2006 14:52:06 -0000	1.16.2.7
+++ cmMakefileTargetGenerator.cxx	28 Nov 2006 19:19:44 -0000	1.16.2.8
@@ -1136,7 +1136,13 @@
     {
     return;
     }
-
+  // Compute which library configuration to link.
+  cmTarget::LinkLibraryType linkType = cmTarget::OPTIMIZED;
+  if(cmSystemTools::UpperCase(
+       this->LocalGenerator->ConfigurationName.c_str()) == "DEBUG")
+    {
+    linkType = cmTarget::DEBUG;
+    }
   // Keep track of dependencies already listed.
   std::set<cmStdString> emitted;
 
@@ -1149,6 +1155,14 @@
   for(cmTarget::LinkLibraryVectorType::const_iterator lib = tlibs.begin();
       lib != tlibs.end(); ++lib)
     {
+    // skip the library if it is not general and the link type
+    // does not match the current target
+    if(lib->second != cmTarget::GENERAL &&
+       lib->second != linkType)
+      {
+      continue;
+      }
+       
     // Don't emit the same library twice for this target.
     if(emitted.insert(lib->first).second)
       {

Index: cmTarget.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.cxx,v
retrieving revision 1.96.2.5
retrieving revision 1.96.2.6
diff -u -d -r1.96.2.5 -r1.96.2.6
--- cmTarget.cxx	27 Oct 2006 20:01:48 -0000	1.96.2.5
+++ cmTarget.cxx	28 Nov 2006 19:19:44 -0000	1.96.2.6
@@ -230,15 +230,41 @@
       unsigned int i;
       for (i = 0; i < outsf->GetCustomCommand()->GetDepends().size(); ++i)
         {
-        std::string dep = cmSystemTools::GetFilenameName(
-          outsf->GetCustomCommand()->GetDepends()[i]);
+        const std::string& fullName 
+          = outsf->GetCustomCommand()->GetDepends()[i];
+        std::string dep = cmSystemTools::GetFilenameName(fullName);
         if (cmSystemTools::GetFilenameLastExtension(dep) == ".exe")
           {
           dep = cmSystemTools::GetFilenameWithoutLastExtension(dep);
           }
-        // watch for target dependencies,
-        if(this->Makefile->GetLocalGenerator()->
-           GetGlobalGenerator()->FindTarget(0, dep.c_str()))
+        bool isUtility = false;
+        // see if we can find a target with this name
+        cmTarget* t =  this->Makefile->GetLocalGenerator()->
+          GetGlobalGenerator()->FindTarget(0, dep.c_str());
+        if(t)
+          {
+          // if we find the target and the dep was given as a full
+          // path, then make sure it was not a full path to something
+          // else, and the fact that the name matched a target was 
+          // just a coincident 
+          if(cmSystemTools::FileIsFullPath(fullName.c_str()))
+            {
+            std::string tLocation = t->GetLocation(0);
+            tLocation = cmSystemTools::GetFilenamePath(tLocation);
+            std::string depLocation = cmSystemTools::GetFilenamePath(
+              std::string(fullName));
+            if(depLocation == tLocation)
+              {
+              isUtility = true;
+              }
+            }
+          // if it was not a full path then it must be a target
+          else
+            {
+            isUtility = true;
+            }
+          }
+        if(isUtility)
           {
           // add the depend as a utility on the target
           this->AddUtility(dep.c_str());
@@ -737,7 +763,9 @@
 {
   // It's already been emitted
   if( emitted.find(lib) != emitted.end() )
+    {
     return;
+    }
 
   // Emit the dependencies only if this library node hasn't been
   // visited before. If it has, then we have a cycle. The recursion
@@ -797,7 +825,9 @@
   // If the library is already in the dependency map, then it has
   // already been fully processed.
   if( dep_map.find(lib) != dep_map.end() )
+    {
     return;
+    }
 
   const char* deps = mf.GetDefinition( (lib+"_LIB_DEPENDS").c_str() );
   if( deps && strcmp(deps,"") != 0 )
@@ -857,7 +887,8 @@
         this->Makefile->GetSafeDefinition("EXECUTABLE_OUTPUT_PATH");
       break;
     default:
-      return 0;
+      this->Directory = this->Makefile->GetStartOutputDirectory();
+      break;
     }
   if(this->Directory.empty())
     {



More information about the Cmake-commits mailing list