[cmake-commits] king committed cmIncludeExternalMSProjectCommand.cxx 1.16 1.17

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Sep 28 17:35:26 EDT 2006


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

Modified Files:
	cmIncludeExternalMSProjectCommand.cxx 
Log Message:
BUG: Move hack from old cmMakefile::AddUtilityTarget to this command directly.  There really needs to be a better way to represent external project targets.


Index: cmIncludeExternalMSProjectCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmIncludeExternalMSProjectCommand.cxx,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- cmIncludeExternalMSProjectCommand.cxx	28 Sep 2006 17:55:25 -0000	1.16
+++ cmIncludeExternalMSProjectCommand.cxx	28 Sep 2006 21:35:24 -0000	1.17
@@ -40,18 +40,34 @@
         depends.push_back(args[i]); 
         }
       }
-    
+
+    // Hack together a utility target storing enough information
+    // to reproduce the target inclusion.
     std::string utility_name("INCLUDE_EXTERNAL_MSPROJECT");
     utility_name += "_";
     utility_name += args[0];
     std::string path = args[1];
     cmSystemTools::ConvertToUnixSlashes(path);
-    const char* no_working_directory = 0;
-    this->Makefile->AddUtilityCommand(utility_name.c_str(), true,
-                                  depends,
-                                  no_working_directory,
-                                  args[0].c_str(), path.c_str());
-    
+
+    // Create a target instance for this utility.
+    cmTarget target;
+    target.SetType(cmTarget::UTILITY, utility_name.c_str());
+    target.SetInAll(true);
+    target.SetMakefile(this->Makefile);
+    std::vector<std::string> no_outputs;
+    cmCustomCommandLines commandLines;
+    cmCustomCommandLine commandLine;
+    commandLine.push_back(args[0]);
+    commandLine.push_back(path);
+    commandLines.push_back(commandLine);
+    cmCustomCommand cc(no_outputs, depends, commandLines, 0, 0);
+    target.GetPostBuildCommands().push_back(cc);
+
+    // Add the target to the set of targets.
+    cmTargets::iterator it =
+      this->Makefile->GetTargets()
+      .insert(cmTargets::value_type(utility_name.c_str(),target)).first;
+    this->Makefile->GetLocalGenerator()->GetGlobalGenerator()->AddTarget(*it);
     }
 #endif
   return true;



More information about the Cmake-commits mailing list