Re: [CMake] add_subdirectory and eclipse project

2011-06-20 Thread Andrea Galeazzi

Il 12/02/2011 19.58, Alexander Neundorf ha scritto:

On Friday 11 February 2011, Andrea Galeazzi wrote:

Alexander Neundorf ha scritto:

On Wednesday 09 February 2011, Andrea Galeazzi wrote:

Il 08/02/2011 17.58, Alexander Neundorf ha scritto:

On Tuesday 08 February 2011, Andrea Galeazzi wrote:

Il 18/01/2011 19.17, Alexander Neundorf ha scritto:

On Tuesday 18 January 2011, Andrea Galeazzi wrote:
...


I just read that wiki page but what I didn't find is how can I see
the sources referenced by the add_subproject function in the layout
of eclipse project.

You mean add_subdirectory(), right ?


In other words, CMake generates an eclipse project with a folder
named [Source directory], containing just only the sources listed in
the CMakeLists.txt but it doesn't allow to see the sources included
by add_subproject.

There should be subdirectories there which you should be able to
open, which should show the files.

Which exact version of cmake are you using ?

Alex

__ Informazioni da ESET NOD32 Antivirus, versione del
database delle firme digitali 5798 (20110118) __

Il messaggio و stato controllato da ESET NOD32 Antivirus.

www.nod32.it

Yes I meant add_subdirectory and I'm using 2.8.3 version.
The point is that the path passed as argument to the add_subdirectory
function isn't necessary a real filesystem subdirectory of the current
CMakeLists.txt so, in this case, it cannot be browsed by the resource
view of eclipse.
To be more specific don't you think it'd better to generate a .project
containing more links than only [Source directory]?
i.e.:


[Source directory]
2
/Project/Prj



vs:


Main Project
2
/Project/Prj


LibName
2
/Libs/Lib1



where libName is the name declared in the project() statement of
CMakeLists.txt of /Libs/Lib1.
This behavior should be more similar to the Visual Studio generator.
So far I made a workaround writing a script which parse a
CMakeLists.txt and invokes CMake to generate one eclipse project for
each
add_subdirectory entry. Then I import all projects in a workspace.
I dislike a such solution but that's the only way to browse all
sources that I found.
I  hope my suggestion will be taken into account for the next
releases... and sorry for the late answer!
Andrea

I'll have a look.

Alex

__ Informazioni da ESET NOD32 Antivirus, versione del database
delle firme digitali 5841 (20110202) __

Il messaggio و stato controllato da ESET NOD32 Antivirus.

www.nod32.it

I took the liberty to change a piece of code just in order to test the
idea above. That's the code modified (in
cmExtraEclipseCDT4Generator::CreateProjectFile() )

Cool :-)
Without having looked at the code in detail, what I'd like to have is to
keep the linked resource [SOURCE DIR] pointing to CMAKE_SOURCE_DIR, and
additionally a linked resource [PROJECTS], which contains linked
resources pointing to the different project directories.
This way I hope it should be clear that the one link just takes you to
the source directory, while the other links (only visible when the
[PROJECTS] resource is opened) take you to the project directories.

Alex


   if (this->IsOutOfSourceBuild)
 {
 fout<<  "\t\n";
 // create a linked resource to CMAKE_SOURCE_DIR
 // (this is not done anymore for each project because of
 // http://public.kitware.com/Bug/view.php?id=9978 and because I
found it
 // actually quite confusing in bigger projects with many directories
and
 // projects, Alex
 const std::vector&  generators =
this->GlobalGenerator->GetLocalGenerators();
 std::vector::const_iterator iter =
generators.begin();
 for(; iter != generators.end(); ++iter)
 {
   mf = (*iter)->GetMakefile();
   std::string sourceLinkedResourceName = "[";
   sourceLinkedResourceName += mf->GetProjectName();
   sourceLinkedResourceName += "]";
   std::string linkSourceDirectory = this->GetEclipsePath(

mf->GetStartDirectory());
   // .project dir can't be subdir of a linked resource dir
   if
(!cmSystemTools::IsSubDirectory(this->HomeOutputDirectory.c_str(),
linkSourceDirectory.c_str())) {
 this->AppendLinkedResource(fout, sourceLinkedResourceName,

this->GetEclipsePath(linkSourceDirectory));
 this->SrcLinkedResources.push_back(sourceLinkedResourceName);
 }

   // for EXECUTABLE_OUTPUT_PATH when not in binary dir
   this->AppendOutLinkedResource(fout,
 mf->GetSafeDefinition("CMAKE_RUNTIME_OUTPUT_DIRECTORY"),
 mf->GetSafeDefinition("EXECUTABLE_OUTPUT_PATH"));
   // for LIBRARY_OUTPUT_PATH when not in binary dir
   this->AppendOutLinkedResource(fout,
 mf->GetSafeDefinition("CMAKE_LIBRARY_OUTPUT_DIRECTORY"),
 mf->GetSafeDefinition("LIBRARY_OUTPUT_PATH"));
  }

 fout<<  "\t\n";
 }

and it works in my case. Consider this just as a "draft" of a possible
patch. Let me know what do you think about it and if I can be of help in
anyways.
Andrea.
_

Re: [CMake] add_subdirectory and eclipse project

2011-02-14 Thread Andrea Galeazzi

Il 12/02/2011 19.58, Alexander Neundorf ha scritto:

On Friday 11 February 2011, Andrea Galeazzi wrote:

Alexander Neundorf ha scritto:

On Wednesday 09 February 2011, Andrea Galeazzi wrote:

Il 08/02/2011 17.58, Alexander Neundorf ha scritto:

On Tuesday 08 February 2011, Andrea Galeazzi wrote:

Il 18/01/2011 19.17, Alexander Neundorf ha scritto:

On Tuesday 18 January 2011, Andrea Galeazzi wrote:
...


I just read that wiki page but what I didn't find is how can I see
the sources referenced by the add_subproject function in the layout
of eclipse project.

You mean add_subdirectory(), right ?


In other words, CMake generates an eclipse project with a folder
named [Source directory], containing just only the sources listed in
the CMakeLists.txt but it doesn't allow to see the sources included
by add_subproject.

There should be subdirectories there which you should be able to
open, which should show the files.

Which exact version of cmake are you using ?

Alex

__ Informazioni da ESET NOD32 Antivirus, versione del
database delle firme digitali 5798 (20110118) __

Il messaggio و stato controllato da ESET NOD32 Antivirus.

www.nod32.it

Yes I meant add_subdirectory and I'm using 2.8.3 version.
The point is that the path passed as argument to the add_subdirectory
function isn't necessary a real filesystem subdirectory of the current
CMakeLists.txt so, in this case, it cannot be browsed by the resource
view of eclipse.
To be more specific don't you think it'd better to generate a .project
containing more links than only [Source directory]?
i.e.:


[Source directory]
2
/Project/Prj



vs:


Main Project
2
/Project/Prj


LibName
2
/Libs/Lib1



where libName is the name declared in the project() statement of
CMakeLists.txt of /Libs/Lib1.
This behavior should be more similar to the Visual Studio generator.
So far I made a workaround writing a script which parse a
CMakeLists.txt and invokes CMake to generate one eclipse project for
each
add_subdirectory entry. Then I import all projects in a workspace.
I dislike a such solution but that's the only way to browse all
sources that I found.
I  hope my suggestion will be taken into account for the next
releases... and sorry for the late answer!
Andrea

I'll have a look.

Alex

__ Informazioni da ESET NOD32 Antivirus, versione del database
delle firme digitali 5841 (20110202) __

Il messaggio و stato controllato da ESET NOD32 Antivirus.

www.nod32.it

I took the liberty to change a piece of code just in order to test the
idea above. That's the code modified (in
cmExtraEclipseCDT4Generator::CreateProjectFile() )

Cool :-)
Without having looked at the code in detail, what I'd like to have is to
keep the linked resource [SOURCE DIR] pointing to CMAKE_SOURCE_DIR, and
additionally a linked resource [PROJECTS], which contains linked
resources pointing to the different project directories.
This way I hope it should be clear that the one link just takes you to
the source directory, while the other links (only visible when the
[PROJECTS] resource is opened) take you to the project directories.

Alex


   if (this->IsOutOfSourceBuild)
 {
 fout<<  "\t\n";
 // create a linked resource to CMAKE_SOURCE_DIR
 // (this is not done anymore for each project because of
 // http://public.kitware.com/Bug/view.php?id=9978 and because I
found it
 // actually quite confusing in bigger projects with many directories
and
 // projects, Alex
 const std::vector&  generators =
this->GlobalGenerator->GetLocalGenerators();
 std::vector::const_iterator iter =
generators.begin();
 for(; iter != generators.end(); ++iter)
 {
   mf = (*iter)->GetMakefile();
   std::string sourceLinkedResourceName = "[";
   sourceLinkedResourceName += mf->GetProjectName();
   sourceLinkedResourceName += "]";
   std::string linkSourceDirectory = this->GetEclipsePath(

mf->GetStartDirectory());
   // .project dir can't be subdir of a linked resource dir
   if
(!cmSystemTools::IsSubDirectory(this->HomeOutputDirectory.c_str(),
linkSourceDirectory.c_str())) {
 this->AppendLinkedResource(fout, sourceLinkedResourceName,

this->GetEclipsePath(linkSourceDirectory));
 this->SrcLinkedResources.push_back(sourceLinkedResourceName);
 }

   // for EXECUTABLE_OUTPUT_PATH when not in binary dir
   this->AppendOutLinkedResource(fout,
 mf->GetSafeDefinition("CMAKE_RUNTIME_OUTPUT_DIRECTORY"),
 mf->GetSafeDefinition("EXECUTABLE_OUTPUT_PATH"));
   // for LIBRARY_OUTPUT_PATH when not in binary dir
   this->AppendOutLinkedResource(fout,
 mf->GetSafeDefinition("CMAKE_LIBRARY_OUTPUT_DIRECTORY"),
 mf->GetSafeDefinition("LIBRARY_OUTPUT_PATH"));
  }

 fout<<  "\t\n";
 }

and it works in my case. Consider this just as a "draft" of a possible
patch. Let me know what do you think about it and if I can be of help in
anyways.
Andrea.
_

Re: [CMake] add_subdirectory and eclipse project

2011-02-12 Thread Alexander Neundorf
On Friday 11 February 2011, Andrea Galeazzi wrote:
> Alexander Neundorf ha scritto:
> > On Wednesday 09 February 2011, Andrea Galeazzi wrote:
> >> Il 08/02/2011 17.58, Alexander Neundorf ha scritto:
> >>> On Tuesday 08 February 2011, Andrea Galeazzi wrote:
>  Il 18/01/2011 19.17, Alexander Neundorf ha scritto:
> > On Tuesday 18 January 2011, Andrea Galeazzi wrote:
> > ...
> >
> >> I just read that wiki page but what I didn't find is how can I see
> >> the sources referenced by the add_subproject function in the layout 
> >> of eclipse project.
> >
> > You mean add_subdirectory(), right ?
> >
> >> In other words, CMake generates an eclipse project with a folder
> >> named [Source directory], containing just only the sources listed in
> >> the CMakeLists.txt but it doesn't allow to see the sources included
> >> by add_subproject.
> >
> > There should be subdirectories there which you should be able to
> > open, which should show the files.
> >
> > Which exact version of cmake are you using ?
> >
> > Alex
> >
> > __ Informazioni da ESET NOD32 Antivirus, versione del
> > database delle firme digitali 5798 (20110118) __
> >
> > Il messaggio و stato controllato da ESET NOD32 Antivirus.
> >
> > www.nod32.it
> 
>  Yes I meant add_subdirectory and I'm using 2.8.3 version.
>  The point is that the path passed as argument to the add_subdirectory
>  function isn't necessary a real filesystem subdirectory of the current
>  CMakeLists.txt so, in this case, it cannot be browsed by the resource
>  view of eclipse.
>  To be more specific don't you think it'd better to generate a .project
>  containing more links than only [Source directory]?
>  i.e.:
>  
>  
>  [Source directory]
>  2
>  /Project/Prj
>  
>  
> 
>  vs:
>  
>  
>  Main Project
>  2
>  /Project/Prj
>  
>  
>  LibName
>  2
>  /Libs/Lib1
>  
>  
> 
>  where libName is the name declared in the project() statement of
>  CMakeLists.txt of /Libs/Lib1.
>  This behavior should be more similar to the Visual Studio generator.
>  So far I made a workaround writing a script which parse a
>  CMakeLists.txt and invokes CMake to generate one eclipse project for
>  each
>  add_subdirectory entry. Then I import all projects in a workspace.
>  I dislike a such solution but that's the only way to browse all
>  sources that I found.
>  I  hope my suggestion will be taken into account for the next
>  releases... and sorry for the late answer!
>  Andrea
> >>>
> >>> I'll have a look.
> >>>
> >>> Alex
> >>>
> >>> __ Informazioni da ESET NOD32 Antivirus, versione del database
> >>> delle firme digitali 5841 (20110202) __
> >>>
> >>> Il messaggio و stato controllato da ESET NOD32 Antivirus.
> >>>
> >>> www.nod32.it
> >>
> >> I took the liberty to change a piece of code just in order to test the
> >> idea above. That's the code modified (in
> >> cmExtraEclipseCDT4Generator::CreateProjectFile() )
> >
> > Cool :-)
> > Without having looked at the code in detail, what I'd like to have is to
> > keep the linked resource [SOURCE DIR] pointing to CMAKE_SOURCE_DIR, and
> > additionally a linked resource [PROJECTS], which contains linked
> > resources pointing to the different project directories.
> > This way I hope it should be clear that the one link just takes you to
> > the source directory, while the other links (only visible when the
> > [PROJECTS] resource is opened) take you to the project directories.
> >
> > Alex
> >
> >>   if (this->IsOutOfSourceBuild)
> >> {
> >> fout << "\t\n";
> >> // create a linked resource to CMAKE_SOURCE_DIR
> >> // (this is not done anymore for each project because of
> >> // http://public.kitware.com/Bug/view.php?id=9978 and because I
> >> found it
> >> // actually quite confusing in bigger projects with many directories
> >> and
> >> // projects, Alex
> >> const std::vector& generators =
> >> this->GlobalGenerator->GetLocalGenerators();
> >> std::vector::const_iterator iter =
> >> generators.begin();
> >> for(; iter != generators.end(); ++iter)
> >> {
> >>   mf = (*iter)->GetMakefile();
> >>   std::string sourceLinkedResourceName = "[";
> >>   sourceLinkedResourceName += mf->GetProjectName();
> >>   sourceLinkedResourceName += "]";
> >>   std::string linkSourceDirectory = this->GetEclipsePath(
> >>
> >> mf->GetStartDirectory());
> >>   // .project dir can't be subdir of a linked resource dir
> >>   if
> >> (!cmSystemTools::IsSubDirectory(this->HomeOutputDirectory.c_str(),
> >> linkSourceDirectory.c_str())) {
> >> this->AppendLinkedResource(fout, sourceLinkedResourceName,
> >>
> >> this->GetEclipsePath(linkSourceDirectory));
> >> this->SrcLinkedResources.push_

Re: [CMake] add_subdirectory and eclipse project

2011-02-11 Thread Andrea Galeazzi

Alexander Neundorf ha scritto:

On Wednesday 09 February 2011, Andrea Galeazzi wrote:
  

Il 08/02/2011 17.58, Alexander Neundorf ha scritto:


On Tuesday 08 February 2011, Andrea Galeazzi wrote:
  

Il 18/01/2011 19.17, Alexander Neundorf ha scritto:


On Tuesday 18 January 2011, Andrea Galeazzi wrote:
...

  

I just read that wiki page but what I didn't find is how can I see the
sources referenced by the add_subproject function in the layout  of
eclipse project.


You mean add_subdirectory(), right ?

  

In other words, CMake generates an eclipse project with a folder named
[Source directory], containing just only the sources listed in the
CMakeLists.txt but it doesn't allow to see the sources included by
add_subproject.


There should be subdirectories there which you should be able to open,
which should show the files.

Which exact version of cmake are you using ?

Alex

__ Informazioni da ESET NOD32 Antivirus, versione del database
delle firme digitali 5798 (20110118) __

Il messaggio و stato controllato da ESET NOD32 Antivirus.

www.nod32.it
  

Yes I meant add_subdirectory and I'm using 2.8.3 version.
The point is that the path passed as argument to the add_subdirectory
function isn't necessary a real filesystem subdirectory of the current
CMakeLists.txt so, in this case, it cannot be browsed by the resource
view of eclipse.
To be more specific don't you think it'd better to generate a .project
containing more links than only [Source directory]?
i.e.:


[Source directory]
2
/Project/Prj



vs:


Main Project
2
/Project/Prj


LibName
2
/Libs/Lib1



where libName is the name declared in the project() statement of
CMakeLists.txt of /Libs/Lib1.
This behavior should be more similar to the Visual Studio generator.
So far I made a workaround writing a script which parse a CMakeLists.txt
and invokes CMake to generate one eclipse project for each
add_subdirectory entry. Then I import all projects in a workspace.
I dislike a such solution but that's the only way to browse all sources
that I found.
I  hope my suggestion will be taken into account for the next
releases... and sorry for the late answer!
Andrea


I'll have a look.

Alex

__ Informazioni da ESET NOD32 Antivirus, versione del database
delle firme digitali 5841 (20110202) __

Il messaggio و stato controllato da ESET NOD32 Antivirus.

www.nod32.it
  

I took the liberty to change a piece of code just in order to test the
idea above. That's the code modified (in
cmExtraEclipseCDT4Generator::CreateProjectFile() )



Cool :-)
Without having looked at the code in detail, what I'd like to have is to keep 
the linked resource [SOURCE DIR] pointing to CMAKE_SOURCE_DIR, and 
additionally a linked resource [PROJECTS], which contains linked resources 
pointing to the different project directories.
This way I hope it should be clear that the one link just takes you to the 
source directory, while the other links (only visible when the [PROJECTS] 
resource is opened) take you to the project directories.


Alex


  

  if (this->IsOutOfSourceBuild)
{
fout << "\t\n";
// create a linked resource to CMAKE_SOURCE_DIR
// (this is not done anymore for each project because of
// http://public.kitware.com/Bug/view.php?id=9978 and because I
found it
// actually quite confusing in bigger projects with many directories
and
// projects, Alex
const std::vector& generators =
this->GlobalGenerator->GetLocalGenerators();
std::vector::const_iterator iter =
generators.begin();
for(; iter != generators.end(); ++iter)
{
  mf = (*iter)->GetMakefile();
  std::string sourceLinkedResourceName = "[";
  sourceLinkedResourceName += mf->GetProjectName();
  sourceLinkedResourceName += "]";
  std::string linkSourceDirectory = this->GetEclipsePath(

mf->GetStartDirectory());
  // .project dir can't be subdir of a linked resource dir
  if (!cmSystemTools::IsSubDirectory(this->HomeOutputDirectory.c_str(),
   linkSourceDirectory.c_str()))
{
this->AppendLinkedResource(fout, sourceLinkedResourceName,

this->GetEclipsePath(linkSourceDirectory));
this->SrcLinkedResources.push_back(sourceLinkedResourceName);
}

  // for EXECUTABLE_OUTPUT_PATH when not in binary dir
  this->AppendOutLinkedResource(fout,
mf->GetSafeDefinition("CMAKE_RUNTIME_OUTPUT_DIRECTORY"),
mf->GetSafeDefinition("EXECUTABLE_OUTPUT_PATH"));
  // for LIBRARY_OUTPUT_PATH when not in binary dir
  this->AppendOutLinkedResource(fout,
mf->GetSafeDefinition("CMAKE_LIBRARY_OUTPUT_DIRECTORY"),
mf->GetSafeDefinition("LIBRARY_OUTPUT_PATH"));
 }

fout << "\t\n";
}

and it works in my case. Consider this just as a "draft" of a possible
patch. Let me know what do you think about it and if I can be of help in
anyways.
Andrea.
_

Re: [CMake] add_subdirectory and eclipse project

2011-02-09 Thread Alexander Neundorf
On Wednesday 09 February 2011, Andrea Galeazzi wrote:
> Il 08/02/2011 17.58, Alexander Neundorf ha scritto:
> > On Tuesday 08 February 2011, Andrea Galeazzi wrote:
> >> Il 18/01/2011 19.17, Alexander Neundorf ha scritto:
> >>> On Tuesday 18 January 2011, Andrea Galeazzi wrote:
> >>> ...
> >>>
>  I just read that wiki page but what I didn't find is how can I see the
>  sources referenced by the add_subproject function in the layout  of
>  eclipse project.
> >>>
> >>> You mean add_subdirectory(), right ?
> >>>
>  In other words, CMake generates an eclipse project with a folder named
>  [Source directory], containing just only the sources listed in the
>  CMakeLists.txt but it doesn't allow to see the sources included by
>  add_subproject.
> >>>
> >>> There should be subdirectories there which you should be able to open,
> >>> which should show the files.
> >>>
> >>> Which exact version of cmake are you using ?
> >>>
> >>> Alex
> >>>
> >>> __ Informazioni da ESET NOD32 Antivirus, versione del database
> >>> delle firme digitali 5798 (20110118) __
> >>>
> >>> Il messaggio و stato controllato da ESET NOD32 Antivirus.
> >>>
> >>> www.nod32.it
> >>
> >> Yes I meant add_subdirectory and I'm using 2.8.3 version.
> >> The point is that the path passed as argument to the add_subdirectory
> >> function isn't necessary a real filesystem subdirectory of the current
> >> CMakeLists.txt so, in this case, it cannot be browsed by the resource
> >> view of eclipse.
> >> To be more specific don't you think it'd better to generate a .project
> >> containing more links than only [Source directory]?
> >> i.e.:
> >> 
> >> 
> >> [Source directory]
> >> 2
> >> /Project/Prj
> >> 
> >> 
> >>
> >> vs:
> >> 
> >> 
> >> Main Project
> >> 2
> >> /Project/Prj
> >> 
> >> 
> >> LibName
> >> 2
> >> /Libs/Lib1
> >> 
> >> 
> >>
> >> where libName is the name declared in the project() statement of
> >> CMakeLists.txt of /Libs/Lib1.
> >> This behavior should be more similar to the Visual Studio generator.
> >> So far I made a workaround writing a script which parse a CMakeLists.txt
> >> and invokes CMake to generate one eclipse project for each
> >> add_subdirectory entry. Then I import all projects in a workspace.
> >> I dislike a such solution but that's the only way to browse all sources
> >> that I found.
> >> I  hope my suggestion will be taken into account for the next
> >> releases... and sorry for the late answer!
> >> Andrea
> >
> > I'll have a look.
> >
> > Alex
> >
> > __ Informazioni da ESET NOD32 Antivirus, versione del database
> > delle firme digitali 5841 (20110202) __
> >
> > Il messaggio و stato controllato da ESET NOD32 Antivirus.
> >
> > www.nod32.it
>
> I took the liberty to change a piece of code just in order to test the
> idea above. That's the code modified (in
> cmExtraEclipseCDT4Generator::CreateProjectFile() )

Cool :-)
Without having looked at the code in detail, what I'd like to have is to keep 
the linked resource [SOURCE DIR] pointing to CMAKE_SOURCE_DIR, and 
additionally a linked resource [PROJECTS], which contains linked resources 
pointing to the different project directories.
This way I hope it should be clear that the one link just takes you to the 
source directory, while the other links (only visible when the [PROJECTS] 
resource is opened) take you to the project directories.

Alex


>   if (this->IsOutOfSourceBuild)
> {
> fout << "\t\n";
> // create a linked resource to CMAKE_SOURCE_DIR
> // (this is not done anymore for each project because of
> // http://public.kitware.com/Bug/view.php?id=9978 and because I
> found it
> // actually quite confusing in bigger projects with many directories
> and
> // projects, Alex
> const std::vector& generators =
> this->GlobalGenerator->GetLocalGenerators();
> std::vector::const_iterator iter =
> generators.begin();
> for(; iter != generators.end(); ++iter)
> {
>   mf = (*iter)->GetMakefile();
>   std::string sourceLinkedResourceName = "[";
>   sourceLinkedResourceName += mf->GetProjectName();
>   sourceLinkedResourceName += "]";
>   std::string linkSourceDirectory = this->GetEclipsePath(
>
> mf->GetStartDirectory());
>   // .project dir can't be subdir of a linked resource dir
>   if (!cmSystemTools::IsSubDirectory(this->HomeOutputDirectory.c_str(),
>linkSourceDirectory.c_str()))
> {
> this->AppendLinkedResource(fout, sourceLinkedResourceName,
>
> this->GetEclipsePath(linkSourceDirectory));
> this->SrcLinkedResources.push_back(sourceLinkedResourceName);
> }
>
>   // for EXECUTABLE_OUTPUT_PATH when not in binary dir
>   this->AppendOutLinkedResource(fout,
> mf->GetSafeDefinition("CMAKE_RUNTIME_OUTPUT_DIRECTORY"),
> mf->GetSafeDefinition("EXECUTABLE_OUTPUT_PATH"));
>   // for LIBRARY_OUTPUT_PATH when not in binary dir
>   this->Appen

Re: [CMake] add_subdirectory and eclipse project

2011-02-09 Thread Andrea Galeazzi

Il 08/02/2011 17.58, Alexander Neundorf ha scritto:

On Tuesday 08 February 2011, Andrea Galeazzi wrote:
  

Il 18/01/2011 19.17, Alexander Neundorf ha scritto:


On Tuesday 18 January 2011, Andrea Galeazzi wrote:
...

  

I just read that wiki page but what I didn't find is how can I see the
sources referenced by the add_subproject function in the layout  of
eclipse project.


You mean add_subdirectory(), right ?

  

In other words, CMake generates an eclipse project with a folder named
[Source directory], containing just only the sources listed in the
CMakeLists.txt but it doesn't allow to see the sources included by
add_subproject.


There should be subdirectories there which you should be able to open,
which should show the files.

Which exact version of cmake are you using ?

Alex

__ Informazioni da ESET NOD32 Antivirus, versione del database
delle firme digitali 5798 (20110118) __

Il messaggio و stato controllato da ESET NOD32 Antivirus.

www.nod32.it
  

Yes I meant add_subdirectory and I'm using 2.8.3 version.
The point is that the path passed as argument to the add_subdirectory
function isn't necessary a real filesystem subdirectory of the current
CMakeLists.txt so, in this case, it cannot be browsed by the resource
view of eclipse.
To be more specific don't you think it'd better to generate a .project
containing more links than only [Source directory]?
i.e.:


[Source directory]
2
/Project/Prj



vs:


Main Project
2
/Project/Prj


LibName
2
/Libs/Lib1



where libName is the name declared in the project() statement of
CMakeLists.txt of /Libs/Lib1.
This behavior should be more similar to the Visual Studio generator.
So far I made a workaround writing a script which parse a CMakeLists.txt
and invokes CMake to generate one eclipse project for each
add_subdirectory entry. Then I import all projects in a workspace.
I dislike a such solution but that's the only way to browse all sources
that I found.
I  hope my suggestion will be taken into account for the next
releases... and sorry for the late answer!
Andrea


I'll have a look.

Alex

__ Informazioni da ESET NOD32 Antivirus, versione del database delle 
firme digitali 5841 (20110202) __

Il messaggio و stato controllato da ESET NOD32 Antivirus.

www.nod32.it




  
I took the liberty to change a piece of code just in order to test the 
idea above. That's the code modified (in 
cmExtraEclipseCDT4Generator::CreateProjectFile() )

 if (this->IsOutOfSourceBuild)
   {
   fout << "\t\n";
   // create a linked resource to CMAKE_SOURCE_DIR
   // (this is not done anymore for each project because of
   // http://public.kitware.com/Bug/view.php?id=9978 and because I 
found it
   // actually quite confusing in bigger projects with many directories 
and

   // projects, Alex
   const std::vector& generators = 
this->GlobalGenerator->GetLocalGenerators();
   std::vector::const_iterator iter = 
generators.begin();

   for(; iter != generators.end(); ++iter)
   {
 mf = (*iter)->GetMakefile();
 std::string sourceLinkedResourceName = "[";
 sourceLinkedResourceName += mf->GetProjectName();
 sourceLinkedResourceName += "]";
 std::string linkSourceDirectory = this->GetEclipsePath(
   
mf->GetStartDirectory());

 // .project dir can't be subdir of a linked resource dir
 if (!cmSystemTools::IsSubDirectory(this->HomeOutputDirectory.c_str(),
  linkSourceDirectory.c_str()))
   {
   this->AppendLinkedResource(fout, sourceLinkedResourceName,
  
this->GetEclipsePath(linkSourceDirectory));

   this->SrcLinkedResources.push_back(sourceLinkedResourceName);
   }

 // for EXECUTABLE_OUTPUT_PATH when not in binary dir
 this->AppendOutLinkedResource(fout,
   mf->GetSafeDefinition("CMAKE_RUNTIME_OUTPUT_DIRECTORY"),
   mf->GetSafeDefinition("EXECUTABLE_OUTPUT_PATH"));
 // for LIBRARY_OUTPUT_PATH when not in binary dir
 this->AppendOutLinkedResource(fout,
   mf->GetSafeDefinition("CMAKE_LIBRARY_OUTPUT_DIRECTORY"),
   mf->GetSafeDefinition("LIBRARY_OUTPUT_PATH"));
}

   fout << "\t\n";
   }

and it works in my case. Consider this just as a "draft" of a possible 
patch. Let me know what do you think about it and if I can be of help in 
anyways.

Andrea.
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] add_subdirectory and eclipse project

2011-02-08 Thread Alexander Neundorf
On Tuesday 08 February 2011, Andrea Galeazzi wrote:
> Il 18/01/2011 19.17, Alexander Neundorf ha scritto:
> > On Tuesday 18 January 2011, Andrea Galeazzi wrote:
> > ...
> >
> >> I just read that wiki page but what I didn't find is how can I see the
> >> sources referenced by the add_subproject function in the layout  of
> >> eclipse project.
> >
> > You mean add_subdirectory(), right ?
> >
> >> In other words, CMake generates an eclipse project with a folder named
> >> [Source directory], containing just only the sources listed in the
> >> CMakeLists.txt but it doesn't allow to see the sources included by
> >> add_subproject.
> >
> > There should be subdirectories there which you should be able to open,
> > which should show the files.
> >
> > Which exact version of cmake are you using ?
> >
> > Alex
> >
> > __ Informazioni da ESET NOD32 Antivirus, versione del database
> > delle firme digitali 5798 (20110118) __
> >
> > Il messaggio و stato controllato da ESET NOD32 Antivirus.
> >
> > www.nod32.it
>
> Yes I meant add_subdirectory and I'm using 2.8.3 version.
> The point is that the path passed as argument to the add_subdirectory
> function isn't necessary a real filesystem subdirectory of the current
> CMakeLists.txt so, in this case, it cannot be browsed by the resource
> view of eclipse.
> To be more specific don't you think it'd better to generate a .project
> containing more links than only [Source directory]?
> i.e.:
> 
> 
> [Source directory]
> 2
> /Project/Prj
> 
> 
>
> vs:
> 
> 
> Main Project
> 2
> /Project/Prj
> 
> 
> LibName
> 2
> /Libs/Lib1
> 
> 
>
> where libName is the name declared in the project() statement of
> CMakeLists.txt of /Libs/Lib1.
> This behavior should be more similar to the Visual Studio generator.
> So far I made a workaround writing a script which parse a CMakeLists.txt
> and invokes CMake to generate one eclipse project for each
> add_subdirectory entry. Then I import all projects in a workspace.
> I dislike a such solution but that's the only way to browse all sources
> that I found.
> I  hope my suggestion will be taken into account for the next
> releases... and sorry for the late answer!
> Andrea

I'll have a look.

Alex
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] add_subdirectory and eclipse project

2011-02-08 Thread Andrea Galeazzi

Il 18/01/2011 19.17, Alexander Neundorf ha scritto:

On Tuesday 18 January 2011, Andrea Galeazzi wrote:
...

I just read that wiki page but what I didn't find is how can I see the
sources referenced by the add_subproject function in the layout  of
eclipse project.

You mean add_subdirectory(), right ?


In other words, CMake generates an eclipse project with a folder named
[Source directory], containing just only the sources listed in the
CMakeLists.txt but it doesn't allow to see the sources included by
add_subproject.

There should be subdirectories there which you should be able to open, which
should show the files.

Which exact version of cmake are you using ?

Alex

__ Informazioni da ESET NOD32 Antivirus, versione del database delle 
firme digitali 5798 (20110118) __

Il messaggio و stato controllato da ESET NOD32 Antivirus.

www.nod32.it





Yes I meant add_subdirectory and I'm using 2.8.3 version.
The point is that the path passed as argument to the add_subdirectory 
function isn't necessary a real filesystem subdirectory of the current 
CMakeLists.txt so, in this case, it cannot be browsed by the resource 
view of eclipse.
To be more specific don't you think it'd better to generate a .project 
containing more links than only [Source directory]?

i.e.:


[Source directory]
2
/Project/Prj



vs:


Main Project
2
/Project/Prj


LibName
2
/Libs/Lib1



where libName is the name declared in the project() statement of 
CMakeLists.txt of /Libs/Lib1.

This behavior should be more similar to the Visual Studio generator.
So far I made a workaround writing a script which parse a CMakeLists.txt 
and invokes CMake to generate one eclipse project for each 
add_subdirectory entry. Then I import all projects in a workspace.
I dislike a such solution but that's the only way to browse all sources 
that I found.
I  hope my suggestion will be taken into account for the next 
releases... and sorry for the late answer!

Andrea


___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] add_subdirectory and eclipse project

2011-01-18 Thread Alexander Neundorf
On Tuesday 18 January 2011, Andrea Galeazzi wrote:
...
> I just read that wiki page but what I didn't find is how can I see the
> sources referenced by the add_subproject function in the layout  of
> eclipse project.

You mean add_subdirectory(), right ?

> In other words, CMake generates an eclipse project with a folder named
> [Source directory], containing just only the sources listed in the
> CMakeLists.txt but it doesn't allow to see the sources included by
> add_subproject.

There should be subdirectories there which you should be able to open, which 
should show the files.

Which exact version of cmake are you using ?

Alex
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] add_subdirectory and eclipse project

2011-01-18 Thread Andrea Galeazzi

Il 14/01/2011 13.38, Ryan Pavlik ha scritto:

You probably want to read this:
http://www.cmake.org/Wiki/Eclipse_CDT4_Generator

Ryan

On Fri, Jan 14, 2011 at 3:49 AM, Andrea Galeazzi > wrote:


I've been puzzled over the following problem for about 3/4 days:
if I have a CMakeLists.txt with a lot of add_subdirectory how can
I automatically generate an eclipse project (containing the source
code) for each add_subdirectory?
___
Powered by www.kitware.com 

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake




--
Ryan Pavlik
HCI Graduate Student
Virtual Reality Applications Center
Iowa State University

rpav...@iastate.edu 
http://academic.cleardefinition.com
Internal VRAC/HCI Site: http://tinyurl.com/rpavlik


___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


__ Informazioni da ESET NOD32 Antivirus, versione del database delle 
firme digitali 5786 (20110114) __

Il messaggio è stato controllato da ESET NOD32 Antivirus.

www.nod32.it

I just read that wiki page but what I didn't find is how can I see the 
sources referenced by the add_subproject function in the layout  of 
eclipse project.
In other words, CMake generates an eclipse project with a folder named 
[Source directory], containing just only the sources listed in the 
CMakeLists.txt but it doesn't allow to see the sources included by 
add_subproject. On the other hand, when a VS target is chosen, it 
generates a complete solution including as many projects as 
add_subproject statements.

So, is it possible to yield a similar  behavior also for eclipse?

___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] add_subdirectory and eclipse project

2011-01-14 Thread Ryan Pavlik
You probably want to read this:
http://www.cmake.org/Wiki/Eclipse_CDT4_Generator

Ryan

On Fri, Jan 14, 2011 at 3:49 AM, Andrea Galeazzi  wrote:

> I've been puzzled over the following problem for about 3/4 days:
> if I have a CMakeLists.txt with a lot of add_subdirectory how can I
> automatically generate an eclipse project (containing the source code) for
> each add_subdirectory?
> ___
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>



-- 
Ryan Pavlik
HCI Graduate Student
Virtual Reality Applications Center
Iowa State University

rpav...@iastate.edu
http://academic.cleardefinition.com
Internal VRAC/HCI Site: http://tinyurl.com/rpavlik
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake