[Cmake] Object Suffixes

Andy Cedilnik andy . cedilnik at kitware . com
09 Jul 2003 12:15:04 -0400


Hi Zennard,

Simple as this:

Let say you have the following complex project:

PROJECT(WORLD)
ADD_EXECUTABLE(HelloWorld HelloWorld.c)

Ok, so you want to build it on several platforms using the same source
tree.

Let say your path to source is:

/home/z/world

Create directory:

/home/z/world-linux
/home/z/world-sun
...

Then go to each one of them and run

ccmake /home/z/world

And specify specific options for that platform. This will create
makefiles specific for that platform.

			Andy

On Wed, 2003-07-09 at 11:40, Zennard Sun wrote:
> Hi Andy,
>     Thank you for your response.  However, I am not sure exactly how to 
> go about this.  Let's say I have a directory called foo with sources 
> a.cc and b.cc.  I want to be able to compile for Linux, Solaris, and two 
> cross compilers simultaneously.  Then, I think you mean I should create 
> foo/Linux, foo/Solaris, foo/cross1, and foo/cross2 folders and call 
> cmake within each folder.  However, I want to automatically choose 
> between Linux vs Solaris correctly (right now I use CMAKE_SYSTEM) so 
> that users can simply call 'make' within the foo directory.  Do you have 
> any ideas on this?   I've looked into overriding the compiling rules (in 
> CMakeDefaultMakeRuleVariables.cmake) so that I can specify a different 
> location for the object files but I don't know the folder name until 
> after I call 'PROJECT' which must be called after I override the 
> compiler rules.  Thanks,