[Cmake-commits] [cmake-commits] alex committed cmExtraEclipseCDT4Generator.h 1.9 1.10 cmExtraEclipseCDT4Generator.cxx 1.24 1.25
cmake-commits at cmake.org
cmake-commits at cmake.org
Thu Sep 10 13:49:53 EDT 2009
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv29513
Modified Files:
cmExtraEclipseCDT4Generator.h cmExtraEclipseCDT4Generator.cxx
Log Message:
sync target generation with the CodeBlocks generator
Basically the code is now a copy of the one from the CodeBlocks generator,
maybe this could move into a common helper function somewhere:
-only insert GLOBAL targets from the toplevel directory
-don't insert the edit_cache target if it calls ccmake, since this doesn't
work in the output tab of Eclipse
-add the /fast targets
Alex
Index: cmExtraEclipseCDT4Generator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmExtraEclipseCDT4Generator.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C 2 -d -r1.9 -r1.10
*** cmExtraEclipseCDT4Generator.h 13 Mar 2009 20:52:58 -0000 1.9
--- cmExtraEclipseCDT4Generator.h 10 Sep 2009 17:49:51 -0000 1.10
***************
*** 120,124 ****
std::string HomeDirectory;
std::string HomeOutputDirectory;
- std::set<std::string> TargetsToIgnore;
bool IsOutOfSourceBuild;
bool GenerateSourceProject;
--- 120,123 ----
Index: cmExtraEclipseCDT4Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmExtraEclipseCDT4Generator.cxx,v
retrieving revision 1.24
retrieving revision 1.25
diff -C 2 -d -r1.24 -r1.25
*** cmExtraEclipseCDT4Generator.cxx 13 Mar 2009 21:04:57 -0000 1.24
--- cmExtraEclipseCDT4Generator.cxx 10 Sep 2009 17:49:51 -0000 1.25
***************
*** 41,74 ****
#endif
this->SupportedGlobalGenerators.push_back("Unix Makefiles");
-
- // don't create these targets in Eclipse, they are too many and
- // should be only rarely used directly
- this->TargetsToIgnore.insert("preinstall");
- this->TargetsToIgnore.insert("install/local");
- this->TargetsToIgnore.insert("ContinuousBuild");
- this->TargetsToIgnore.insert("ContinuousConfigure");
- this->TargetsToIgnore.insert("ContinuousCoverage");
- this->TargetsToIgnore.insert("ContinuousMemCheck");
- this->TargetsToIgnore.insert("ContinuousStart");
- this->TargetsToIgnore.insert("ContinuousSubmit");
- this->TargetsToIgnore.insert("ContinuousTest");
- this->TargetsToIgnore.insert("ContinuousUpdate");
- this->TargetsToIgnore.insert("ExperimentalBuild");
- this->TargetsToIgnore.insert("ExperimentalConfigure");
- this->TargetsToIgnore.insert("ExperimentalCoverage");
- this->TargetsToIgnore.insert("ExperimentalMemCheck");
- this->TargetsToIgnore.insert("ExperimentalStart");
- this->TargetsToIgnore.insert("ExperimentalSubmit");
- this->TargetsToIgnore.insert("ExperimentalTest");
- this->TargetsToIgnore.insert("ExperimentalUpdate");
- this->TargetsToIgnore.insert("NightlyBuild");
- this->TargetsToIgnore.insert("NightlyConfigure");
- this->TargetsToIgnore.insert("NightlyCoverage");
- this->TargetsToIgnore.insert("NightlyMemCheck");
- this->TargetsToIgnore.insert("NightlyMemoryCheck");
- this->TargetsToIgnore.insert("NightlyStart");
- this->TargetsToIgnore.insert("NightlySubmit");
- this->TargetsToIgnore.insert("NightlyTest");
- this->TargetsToIgnore.insert("NightlyUpdate");
}
--- 41,44 ----
***************
*** 670,726 ****
{
const cmTargets& targets = (*it)->GetMakefile()->GetTargets();
! for(cmTargets::const_iterator t = targets.begin(); t != targets.end(); ++t)
{
! bool addFastTarget = false;
! switch(t->second.GetType())
{
- case cmTarget::EXECUTABLE:
- case cmTarget::STATIC_LIBRARY:
- case cmTarget::SHARED_LIBRARY:
- case cmTarget::MODULE_LIBRARY:
- addFastTarget = true;
- // no break here
- case cmTarget::UTILITY:
case cmTarget::GLOBAL_TARGET:
{
! bool insertTarget = true;
! if(insertTarget &&
! (std::set<std::string>::const_iterator(
! this->TargetsToIgnore.find(t->first)) !=
! this->TargetsToIgnore.end()))
! {
! insertTarget = false;
! }
!
! if(insertTarget && (emmited.find(t->first) != emmited.end()))
! {
! insertTarget = false;
! }
!
! // add the edit_cache target only if it's not ccmake
! // otherwise ccmake will be executed in the log view of Eclipse,
! // which is no terminal, so curses don't work there, Alex
! if (insertTarget && (t->first=="edit_cache"))
! {
! if (strstr(mf->GetRequiredDefinition("CMAKE_EDIT_COMMAND"),
! "ccmake")!=NULL)
! {
! insertTarget = false;
! }
! }
! if (insertTarget)
! {
! emmited.insert(t->first);
! this->AppendTarget(fout, t->first, make);
! if (addFastTarget || t->first=="install")
! {
! std::string fastTarget = t->first;
! fastTarget = fastTarget + "/fast";
! this->AppendTarget(fout, fastTarget, make);
! }
! }
! break;
! }
// ignore these:
case cmTarget::INSTALL_FILES:
--- 640,698 ----
{
const cmTargets& targets = (*it)->GetMakefile()->GetTargets();
! cmMakefile* makefile=(*it)->GetMakefile();
! for(cmTargets::const_iterator ti=targets.begin(); ti!=targets.end(); ++ti)
{
! switch(ti->second.GetType())
{
case cmTarget::GLOBAL_TARGET:
{
! bool insertTarget = false;
! // Only add the global targets from CMAKE_BINARY_DIR,
! // not from the subdirs
! if (strcmp(makefile->GetStartOutputDirectory(),
! makefile->GetHomeOutputDirectory())==0)
! {
! insertTarget = true;
! // only add the "edit_cache" target if it's not ccmake, because
! // this will not work within the IDE
! if (ti->first == "edit_cache")
! {
! if (strstr(makefile->GetRequiredDefinition
! ("CMAKE_EDIT_COMMAND"), "ccmake")!=NULL)
! {
! insertTarget = false;
! }
! }
! }
! if (insertTarget)
! {
! this->AppendTarget(fout, ti->first, make);
! }
! }
! break;
! case cmTarget::UTILITY:
! // Add all utility targets, except the Nightly/Continuous/
! // Experimental-"sub"targets as e.g. NightlyStart
! if (((ti->first.find("Nightly")==0) &&(ti->first!="Nightly"))
! || ((ti->first.find("Continuous")==0)&&(ti->first!="Continuous"))
! || ((ti->first.find("Experimental")==0)
! && (ti->first!="Experimental")))
! {
! break;
! }
! this->AppendTarget(fout, ti->first, make);
! break;
! case cmTarget::EXECUTABLE:
! case cmTarget::STATIC_LIBRARY:
! case cmTarget::SHARED_LIBRARY:
! case cmTarget::MODULE_LIBRARY:
! {
! this->AppendTarget(fout, ti->first, make);
! std::string fastTarget = ti->first;
! fastTarget += "/fast";
! this->AppendTarget(fout, fastTarget, make);
! }
! break;
// ignore these:
case cmTarget::INSTALL_FILES:
More information about the Cmake-commits
mailing list