Re: [CMake] Embedding one project inside a second

2011-06-06 Thread Glenn Coombs
A simple set of CMAKE_C_FLAGS or CMAKE_CXX_FLAGS will set the value for the
current directory and below:

set(CMAKE_C_FLAGS"${CMAKE_C_FLAGS} -m32")

Any add_directory() commands after the above line will inherit the -m32
flag.

--
Glenn

On 5 June 2011 20:36, Richard Offer  wrote:

>
> 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.
>
>
> ___
> 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
>
___
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

[CMake] Embedding one project inside a second

2011-06-05 Thread Richard Offer

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.


___
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