[Cmake] Object Suffixes

Bill Hoffman bill . hoffman at kitware . com
Wed, 09 Jul 2003 18:18:38 -0400


Well, that is not really the model that CMake uses.
CMake is more like the standard gnu tools build process.
Where you make a build directory for each architecture and
run configure on each machine.   Then run make in a different
directory for each machine.

There are a variety of reasons that this approach is simpler to
implement.   For make to work in /home/z/world on all machines,
it would require a makefile that works on all machines and is able
to determine what machine it is running on.  I guess the makefile would
have to run uname and then load system specific makefiles based on the
machine you are on.   Also those generated makefiles would get clobbered
by the different machines each time cmake was run, and since it is separate
machines, they could get in inconsistent states.

So, at the end of the day, I would not expect cmake to support what you are
asking for in the near future.   You are of course welcome to try and
extend cmake to do this, but due to the above issues, and others I am missing
right now, it may be a hard sell to get the changes into the main cmake.

I have worked with make systems that work both ways, and the cmake/gnu autoconf 
style of requiring separate directories for each machine, is the least error prone.


-Bill


At 05:04 PM 7/9/2003, Zennard Sun wrote:
>Hi Andy,
>   I don't mean to keep pestering you, but this solution doesn't seem to answer my question.  With your example, I have directories
>
>/home/z/world
>/home/z/world-linux
>/home/z/world-sun
>
>and the sources in /home/z/world.  I want to be able to run make without knowing which system I'm on.  So I don't want two different makefiles in the linux and sun directories.  In that case, I would have to go into the world-linux directory first, knowing that I am compiling on a linux machine.  Maybe I'm not understanding your solution, but I would like to be able to compile and run from the same directory no matter what system I'm under.  So in this case, I would like to run 'make' from /home/z/world on a Solaris machine while also running 'make' on a Linux machine also from /home/z/world.
>
>Thanks
>
>-Zennard Sun
>
>
>Andy Cedilnik wrote:
>
>>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
>>
>> 
>
>_______________________________________________
>Cmake mailing list
>Cmake at cmake . org
>http://www . cmake . org/mailman/listinfo/cmake