[CMake] Multiple source directory scenario and cdt generator

Dan Kegel dank at kegel.com
Wed Nov 16 13:13:48 EST 2011


On Wed, Nov 16, 2011 at 9:43 AM, Alexander Neundorf
<a.neundorf-work at gmx.net> wrote:
>> I suspect that the only way to make source code control
>> plugins happy is to link to dummy projects like you
>> do for the main source directory.
>> And then there's no need for those individual source file links.
>
> AFAIK svn etc. work only if you either build in-source, or in the additional
> in-source project.
> I.e. AFAIK it doesn't work in the build tree project.

Then don't.  My users expect each top level source directory to
have a top level eclipse project connected to svn.  They will
do all their svn and editing via those top-level source projects.
They expect Eclipse to rebuild when they click "Build Project"
in the build tree project, so the build tree project has to link
to the source projects.

I already posted a shell script that does this for my special case.
I'm not quite sure how the cdt generator would figure out how
what directories to create phony source projects for, but maybe
it's something like
  candidates = all CMakeList.txt files
  For each candidate
    Remove all candidates in child directories
  Create phony projects and links for all remaining candidates

The links can be hidden deep in the project hierarchy without
harm because users will ignore them; they're only there to inform
Eclipse of the dependencies.
- Dan


More information about the CMake mailing list