[CMake] ADD_SUBDIRECTORY() and mulitple PROJECT() definitions
Stephane Rouleau (Consultant)
stephane.rouleau at autodesk.com
Tue May 15 19:41:31 EDT 2007
Hi,
We may be using cmake in strange new ways that were not expected (or
intended), so if this is not exactly correct let me know and we'll
stretch it in another direction... Also this may be a bit confusing,
I'm trying to simplify our setup as much as possible for the purpose of
this message.
CMakeLists.txt
projA\CMakeLists.txt
projB\CMakeLists.txt..
..
Nothing crazy so far -- what's in "root" basically will generate a
top-level project, which can be used to build "all", and depends on
projA and B. projA depends on nothing, and projB depends on projA.
We build out of tree, and know that, within a given build tree,
everything is 'compatible' -- as such, we only want to have a single
.vcproj for every project. Thus when we perform the ADD_SUBDIRECTORY()
on a given project, we use the same output folder, so that, in the end,
we end up with (using a Visual Studio 8 generator):
all.sln
all.vcproj
projA\projA.sln
projA\projA.vcproj
projB\projB.sln (grabs ../projA.vcproj)
projB\projB.vcproj
and NOT
...
projB\projB.sln (grabs ./projA.vcproj)
projB\projA.vcproj
projB\projB.vcproj
the problem is that all.sln ends up with two Project() entries of
"projA" -- one for itself, and one from projB.
Is it expected that ADD_SUBDIRECTORY() will add it in the current
PROJECT(), but also in every parent PROJECT()? Is there a way around
this?
(BTW, I just tried not sharing the projA.vcproj and generating two
instances -- the resulting all.sln ends up with two copies of projA,
with the same name, but in different locations, which is still not a
valid solution.)
Stephane Rouleau
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20070515/52bfc3db/attachment-0001.htm
More information about the CMake
mailing list