[cmake-commits] king committed cmExportLibraryDependencies.cxx 1.15
1.16 cmGlobalVisualStudio6Generator.cxx 1.70 1.71
cmGlobalVisualStudio71Generator.cxx 1.41 1.42
cmGlobalVisualStudio7Generator.cxx 1.88 1.89
cmGlobalXCodeGenerator.cxx 1.152 1.153
cmInstallFilesCommand.cxx 1.24 1.25 cmInstallFilesCommand.h
1.19 1.20 cmInstallProgramsCommand.cxx 1.17 1.18
cmInstallProgramsCommand.h 1.17 1.18 cmLocalGenerator.cxx 1.221
1.222 cmLocalVisualStudio6Generator.cxx 1.124 1.125
cmLocalVisualStudio7Generator.cxx 1.191 1.192 cmMakefile.cxx
1.391 1.392 cmTarget.cxx 1.144 1.145
cmake-commits at cmake.org
cmake-commits at cmake.org
Wed May 23 15:40:14 EDT 2007
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv11198
Modified Files:
cmExportLibraryDependencies.cxx
cmGlobalVisualStudio6Generator.cxx
cmGlobalVisualStudio71Generator.cxx
cmGlobalVisualStudio7Generator.cxx cmGlobalXCodeGenerator.cxx
cmInstallFilesCommand.cxx cmInstallFilesCommand.h
cmInstallProgramsCommand.cxx cmInstallProgramsCommand.h
cmLocalGenerator.cxx cmLocalVisualStudio6Generator.cxx
cmLocalVisualStudio7Generator.cxx cmMakefile.cxx cmTarget.cxx
Log Message:
ENH: Fixed INSTALL_FILES and INSTALL_PROGRAMS commands to not create targets. No targets of type cmTarget::INSTALL_FILES or cmTarget::INSTALL_PROGRAMS are created, so we do not need to check for them everywhere anymore.
Index: cmLocalVisualStudio7Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio7Generator.cxx,v
retrieving revision 1.191
retrieving revision 1.192
diff -u -d -r1.191 -r1.192
--- cmLocalVisualStudio7Generator.cxx 10 May 2007 15:38:23 -0000 1.191
+++ cmLocalVisualStudio7Generator.cxx 23 May 2007 19:40:12 -0000 1.192
@@ -134,9 +134,7 @@
{
// INCLUDE_EXTERNAL_MSPROJECT command only affects the workspace
// so don't build a projectfile for it
- if ((l->second.GetType() != cmTarget::INSTALL_FILES)
- && (l->second.GetType() != cmTarget::INSTALL_PROGRAMS)
- && (strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) != 0))
+ if (strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) != 0)
{
this->CreateSingleVCProj(l->first.c_str(),l->second);
}
Index: cmInstallProgramsCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmInstallProgramsCommand.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- cmInstallProgramsCommand.h 24 Jan 2007 18:45:42 -0000 1.17
+++ cmInstallProgramsCommand.h 23 May 2007 19:40:12 -0000 1.18
@@ -101,8 +101,9 @@
protected:
std::string FindInstallSource(const char* name) const;
private:
- std::string TargetName;
std::vector<std::string> FinalArgs;
+ std::string Destination;
+ std::vector<std::string> Files;
};
Index: cmGlobalXCodeGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalXCodeGenerator.cxx,v
retrieving revision 1.152
retrieving revision 1.153
diff -u -d -r1.152 -r1.153
--- cmGlobalXCodeGenerator.cxx 22 May 2007 14:24:59 -0000 1.152
+++ cmGlobalXCodeGenerator.cxx 23 May 2007 19:40:12 -0000 1.153
@@ -596,12 +596,6 @@
cmtarget.GetType() == cmTarget::GLOBAL_TARGET)
{
targets.push_back(this->CreateUtilityTarget(cmtarget));
- }
- if(cmtarget.GetType() == cmTarget::UTILITY ||
- cmtarget.GetType() == cmTarget::GLOBAL_TARGET ||
- cmtarget.GetType() == cmTarget::INSTALL_FILES ||
- cmtarget.GetType() == cmTarget::INSTALL_PROGRAMS)
- {
continue;
}
@@ -2498,9 +2492,7 @@
for(cmTargets::iterator l = tgts.begin();
l != tgts.end(); l++)
{
- if ((l->second.GetType() != cmTarget::INSTALL_FILES)
- && (l->second.GetType() != cmTarget::INSTALL_PROGRAMS)
- && (strncmp(l->first.c_str(),
+ if ((strncmp(l->first.c_str(),
"INCLUDE_EXTERNAL_MSPROJECT", 26) != 0)
&& banned.find(l->second.GetName()) == banned.end())
{
Index: cmGlobalVisualStudio71Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio71Generator.cxx,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- cmGlobalVisualStudio71Generator.cxx 22 May 2007 14:42:37 -0000 1.41
+++ cmGlobalVisualStudio71Generator.cxx 23 May 2007 19:40:12 -0000 1.42
@@ -134,9 +134,6 @@
}
else
{
- if ((l->second.GetType() != cmTarget::INSTALL_FILES)
- && (l->second.GetType() != cmTarget::INSTALL_PROGRAMS))
- {
bool skip = false;
if(l->first == "ALL_BUILD" )
{
@@ -224,7 +221,6 @@
this->WriteProject(fout, dspname, dir.c_str(),l->second);
}
}
- }
}
}
}
@@ -254,8 +250,7 @@
this->WriteProjectConfigurations(fout, project.c_str(),
true);
}
- else if ((l->second.GetType() != cmTarget::INSTALL_FILES)
- && (l->second.GetType() != cmTarget::INSTALL_PROGRAMS))
+ else
{
bool partOfDefaultBuild = this->IsPartOfDefaultBuild(
root->GetMakefile()->GetProjectName(),
Index: cmInstallFilesCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmInstallFilesCommand.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- cmInstallFilesCommand.h 24 Jan 2007 18:45:42 -0000 1.19
+++ cmInstallFilesCommand.h 23 May 2007 19:40:12 -0000 1.20
@@ -106,9 +106,10 @@
std::string FindInstallSource(const char* name) const;
private:
- std::string TargetName;
std::vector<std::string> FinalArgs;
bool IsFilesForm;
+ std::string Destination;
+ std::vector<std::string> Files;
};
Index: cmLocalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalGenerator.cxx,v
retrieving revision 1.221
retrieving revision 1.222
diff -u -d -r1.221 -r1.222
--- cmLocalGenerator.cxx 22 May 2007 14:24:59 -0000 1.221
+++ cmLocalGenerator.cxx 23 May 2007 19:40:12 -0000 1.222
@@ -145,10 +145,7 @@
{
// INCLUDE_EXTERNAL_MSPROJECT command only affects the workspace
// so don't build a projectfile for it
- if ((t->second.GetType() != cmTarget::INSTALL_FILES)
- && (t->second.GetType() != cmTarget::INSTALL_PROGRAMS)
- && (t->second.GetType() != cmTarget::INSTALL_DIRECTORY)
- && (strncmp(t->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) != 0))
+ if (strncmp(t->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) != 0)
{
std::string projectFilename;
if (this->IsMakefileGenerator == false) // only use of this variable
Index: cmGlobalVisualStudio7Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio7Generator.cxx,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -d -r1.88 -r1.89
--- cmGlobalVisualStudio7Generator.cxx 22 May 2007 14:42:37 -0000 1.88
+++ cmGlobalVisualStudio7Generator.cxx 23 May 2007 19:40:12 -0000 1.89
@@ -341,9 +341,6 @@
}
else
{
- if ((l->second.GetType() != cmTarget::INSTALL_FILES)
- && (l->second.GetType() != cmTarget::INSTALL_PROGRAMS))
- {
bool skip = false;
if(l->first == "ALL_BUILD" )
{
@@ -420,7 +417,6 @@
this->WriteProject(fout, dspname, dir.c_str(),l->second);
}
}
- }
}
}
}
@@ -476,8 +472,7 @@
depcount++;
}
}
- else if ((l->second.GetType() != cmTarget::INSTALL_FILES)
- && (l->second.GetType() != cmTarget::INSTALL_PROGRAMS))
+ else
{
const char *dspname =
l->second.GetProperty("GENERATOR_FILE_NAME");
@@ -513,8 +508,7 @@
this->WriteProjectConfigurations(fout, name.c_str(),
true);
}
- else if ((l->second.GetType() != cmTarget::INSTALL_FILES)
- && (l->second.GetType() != cmTarget::INSTALL_PROGRAMS))
+ else
{
bool partOfDefaultBuild = this->IsPartOfDefaultBuild(
root->GetMakefile()->GetProjectName(),
Index: cmLocalVisualStudio6Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio6Generator.cxx,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -d -r1.124 -r1.125
--- cmLocalVisualStudio6Generator.cxx 22 May 2007 14:24:59 -0000 1.124
+++ cmLocalVisualStudio6Generator.cxx 23 May 2007 19:40:12 -0000 1.125
@@ -141,19 +141,13 @@
case cmTarget::GLOBAL_TARGET:
this->SetBuildType(UTILITY, l->first.c_str(), l->second);
break;
- case cmTarget::INSTALL_FILES:
- break;
- case cmTarget::INSTALL_PROGRAMS:
- break;
default:
cmSystemTools::Error("Bad target type", l->first.c_str());
break;
}
// INCLUDE_EXTERNAL_MSPROJECT command only affects the workspace
// so don't build a projectfile for it
- if ((l->second.GetType() != cmTarget::INSTALL_FILES)
- && (l->second.GetType() != cmTarget::INSTALL_PROGRAMS)
- && (strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) != 0))
+ if (strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) != 0)
{
// check to see if the dsp is going into a sub-directory
std::string::size_type pos = l->first.rfind('/');
Index: cmExportLibraryDependencies.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmExportLibraryDependencies.cxx,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- cmExportLibraryDependencies.cxx 10 May 2006 19:08:38 -0000 1.15
+++ cmExportLibraryDependencies.cxx 23 May 2007 19:40:12 -0000 1.16
@@ -94,28 +94,24 @@
for(cmTargets::iterator l = tgts.begin();
l != tgts.end(); ++l)
{
- if ((l->second.GetType() != cmTarget::INSTALL_FILES)
- && (l->second.GetType() != cmTarget::INSTALL_PROGRAMS))
+ libDepName = l->first;
+ libDepName += "_LIB_DEPENDS";
+ const char* def = this->Makefile->GetDefinition(libDepName.c_str());
+ if(def)
{
- libDepName = l->first;
- libDepName += "_LIB_DEPENDS";
- const char* def = this->Makefile->GetDefinition(libDepName.c_str());
- if(def)
+ fout << "SET(" << libDepName << " \"" << def << "\")\n";
+ // now for each dependency, check for link type
+ cmSystemTools::ExpandListArgument(def, depends);
+ for(std::vector<std::string>::const_iterator d = depends.begin();
+ d != depends.end(); ++d)
{
- fout << "SET(" << libDepName << " \"" << def << "\")\n";
- // now for each dependency, check for link type
- cmSystemTools::ExpandListArgument(def, depends);
- for(std::vector<std::string>::const_iterator d = depends.begin();
- d != depends.end(); ++d)
+ libDepName = *d;
+ libDepName += "_LINK_TYPE";
+ defType = this->Makefile->GetDefinition(libDepName.c_str());
+ libDepName = cmSystemTools::EscapeSpaces(libDepName.c_str());
+ if(defType)
{
- libDepName = *d;
- libDepName += "_LINK_TYPE";
- defType = this->Makefile->GetDefinition(libDepName.c_str());
- libDepName = cmSystemTools::EscapeSpaces(libDepName.c_str());
- if(defType)
- {
- fout << "SET(" << libDepName << " \"" << defType << "\")\n";
- }
+ fout << "SET(" << libDepName << " \"" << defType << "\")\n";
}
}
}
Index: cmGlobalVisualStudio6Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio6Generator.cxx,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- cmGlobalVisualStudio6Generator.cxx 22 May 2007 14:42:37 -0000 1.70
+++ cmGlobalVisualStudio6Generator.cxx 23 May 2007 19:40:12 -0000 1.71
@@ -256,9 +256,6 @@
}
else
{
- if ((l->second.GetType() != cmTarget::INSTALL_FILES)
- && (l->second.GetType() != cmTarget::INSTALL_PROGRAMS))
- {
bool skip = false;
// skip ALL_BUILD and RUN_TESTS if they have already been added
if(l->first == "ALL_BUILD" )
@@ -332,7 +329,6 @@
this->WriteProject(fout, si->c_str(), dir.c_str(),l->second);
}
++si;
- }
}
}
}
Index: cmInstallFilesCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmInstallFilesCommand.cxx,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- cmInstallFilesCommand.cxx 12 Mar 2007 14:26:59 -0000 1.24
+++ cmInstallFilesCommand.cxx 23 May 2007 19:40:12 -0000 1.25
@@ -16,6 +16,8 @@
=========================================================================*/
#include "cmInstallFilesCommand.h"
+#include "cmInstallFilesGenerator.h"
+
// cmExecutableCommand
bool cmInstallFilesCommand
::InitialPass(std::vector<std::string> const& argsIn)
@@ -33,14 +35,8 @@
std::vector<std::string> args;
this->Makefile->ExpandSourceListArguments(argsIn, args, 2);
- // Create an INSTALL_FILES target specifically for this path.
- this->TargetName = "INSTALL_FILES_"+args[0];
- cmTarget& target = this->Makefile->GetTargets()[this->TargetName];
- target.SetType(cmTarget::INSTALL_FILES, this->TargetName.c_str());
- target.SetMakefile(this->Makefile);
- target.SetProperty("EXCLUDE_FROM_ALL","TRUE");
- target.SetInstallPath(args[0].c_str());
-
+ this->Destination = args[0];
+
if((args.size() > 1) && (args[1] == "FILES"))
{
this->IsFilesForm = true;
@@ -49,7 +45,7 @@
{
// Find the source location for each file listed.
std::string f = this->FindInstallSource(s->c_str());
- target.GetSourceLists().push_back(f);
+ this->Files.push_back(f);
}
}
else
@@ -75,8 +71,6 @@
std::string testf;
std::string ext = this->FinalArgs[0];
- std::vector<std::string>& targetSourceLists =
- this->Makefile->GetTargets()[this->TargetName].GetSourceLists();
// two different options
if (this->FinalArgs.size() > 1)
@@ -100,7 +94,7 @@
}
// add to the result
- targetSourceLists.push_back(this->FindInstallSource(testf.c_str()));
+ this->Files.push_back(this->FindInstallSource(testf.c_str()));
}
}
else // reg exp list
@@ -114,9 +108,20 @@
// for each argument, get the files
for (;s != files.end(); ++s)
{
- targetSourceLists.push_back(this->FindInstallSource(s->c_str()));
+ this->Files.push_back(this->FindInstallSource(s->c_str()));
}
}
+
+ // Use a file install generator.
+ const char* no_permissions = "";
+ const char* no_rename = "";
+ const char* no_component = "";
+ std::vector<std::string> no_configurations;
+ this->Makefile->AddInstallGenerator(
+ new cmInstallFilesGenerator(this->Files,
+ this->Destination.c_str(), false,
+ no_permissions, no_configurations,
+ no_component, no_rename));
}
/**
Index: cmInstallProgramsCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmInstallProgramsCommand.cxx,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- cmInstallProgramsCommand.cxx 12 Mar 2007 14:26:59 -0000 1.17
+++ cmInstallProgramsCommand.cxx 23 May 2007 19:40:12 -0000 1.18
@@ -30,13 +30,7 @@
this->Makefile->GetLocalGenerator()
->GetGlobalGenerator()->EnableInstallTarget();
- // Create an INSTALL_PROGRAMS target specifically for this path.
- this->TargetName = "INSTALL_PROGRAMS_"+args[0];
- cmTarget& target = this->Makefile->GetTargets()[this->TargetName];
- target.SetType(cmTarget::INSTALL_PROGRAMS, this->TargetName.c_str());
- target.SetMakefile(this->Makefile);
- target.SetProperty("EXCLUDE_FROM_ALL","TRUE");
- target.SetInstallPath(args[0].c_str());
+ this->Destination = args[0];
std::vector<std::string>::const_iterator s = args.begin();
for (++s;s != args.end(); ++s)
@@ -49,9 +43,6 @@
void cmInstallProgramsCommand::FinalPass()
{
- std::vector<std::string>& targetSourceLists =
- this->Makefile->GetTargets()[this->TargetName].GetSourceLists();
-
bool files_mode = false;
if(!this->FinalArgs.empty() && this->FinalArgs[0] == "FILES")
{
@@ -71,7 +62,7 @@
for(;s != this->FinalArgs.end(); ++s)
{
// add to the result
- targetSourceLists.push_back(this->FindInstallSource(s->c_str()));
+ this->Files.push_back(this->FindInstallSource(s->c_str()));
}
}
else // reg exp list
@@ -84,9 +75,20 @@
// for each argument, get the programs
for (;s != programs.end(); ++s)
{
- targetSourceLists.push_back(this->FindInstallSource(s->c_str()));
+ this->Files.push_back(this->FindInstallSource(s->c_str()));
}
}
+
+ // Use a file install generator.
+ const char* no_permissions = "";
+ const char* no_rename = "";
+ const char* no_component = "";
+ std::vector<std::string> no_configurations;
+ this->Makefile->AddInstallGenerator(
+ new cmInstallFilesGenerator(this->Files,
+ this->Destination.c_str(), true,
+ no_permissions, no_configurations,
+ no_component, no_rename));
}
/**
Index: cmTarget.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.cxx,v
retrieving revision 1.144
retrieving revision 1.145
diff -u -d -r1.144 -r1.145
--- cmTarget.cxx 23 May 2007 17:27:00 -0000 1.144
+++ cmTarget.cxx 23 May 2007 19:40:12 -0000 1.145
@@ -337,6 +337,12 @@
void cmTarget::SetType(TargetType type, const char* name)
{
this->Name = name;
+ if(type == cmTarget::INSTALL_FILES ||
+ type == cmTarget::INSTALL_PROGRAMS ||
+ type == cmTarget::INSTALL_DIRECTORY)
+ {
+ abort();
+ }
// only add dependency information for library targets
this->TargetTypeValue = type;
if(this->TargetTypeValue >= STATIC_LIBRARY
@@ -664,12 +670,6 @@
{
return;
}
- // this is only done for non install targets
- if ((this->TargetTypeValue == cmTarget::INSTALL_FILES)
- || (this->TargetTypeValue == cmTarget::INSTALL_PROGRAMS))
- {
- return;
- }
// for each src lists add the classes
for (std::vector<std::string>::const_iterator s = this->SourceLists.begin();
s != this->SourceLists.end(); ++s)
Index: cmMakefile.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.cxx,v
retrieving revision 1.391
retrieving revision 1.392
diff -u -d -r1.391 -r1.392
--- cmMakefile.cxx 22 May 2007 14:24:59 -0000 1.391
+++ cmMakefile.cxx 23 May 2007 19:40:12 -0000 1.392
@@ -1317,8 +1317,6 @@
{
case cmTarget::UTILITY:
case cmTarget::GLOBAL_TARGET:
- case cmTarget::INSTALL_FILES:
- case cmTarget::INSTALL_PROGRAMS:
return;
default:;
}
More information about the Cmake-commits
mailing list