[CMake] Embedding one project inside a second

Richard Offer richard at whitequeen.com
Sun Jun 5 15:36:16 EDT 2011


I have two distinct projects - A and B - each has its own subversion
repository etc - they are quite independent.

Project A is nw and needs to be built 32bit and itself comprises both
in-house and third party code. The third party code is built using
ExternalProject_Add()


Project B is built 64bit - this is our current project so everyone is
already building that.

Both use Cmake :-)


I'm at the stage where Project B needs access to Projects A's message
definitions - so I thought the easiest way is to "embed it" via subversion.


How can Project A recognize that its being built as a component of Project
B ? ( I can then only build certain targets in Project A). Project A still
needs to be able to do its normal build outside of Project B. I'm guessing
this could be as simple as SET'ing a variable :-)


However, while I only really need one part of Project A inside Project B,
for the team's convenience I'd really like for them to be able to build
the 32bit Project A components at the same time they are building all of
Project B. (saves having to have multiple virtual environments running for
every task)


There doesn't seem to be an easy way to say "here are the FLAGS (-m32) for
this directory and below". Or have I missed something?

And how do I handle building the same EXTERNAL_PROJECT() multiple times
with different flags - it complains that the source directory is already
present. And then correctly reference the 32/64 versions of the libraries
when adding LINK targets ?


Thanks


Richard.




More information about the CMake mailing list