[CMake] Building for 2 platforms with 4 compilers

Hendrik Sattler post at hendrik-sattler.de
Fri Apr 30 06:31:49 EDT 2010


Zitat von K?rlis Repsons <k at 11.lv>:

> On Friday 30 April 2010 09:35:46 Michael Wild wrote:
>> On 30. Apr, 2010, at 11:16 , K?rlis Repsons wrote:
>> > Good day in here,
>> > I was trying to figure out how should CMake be used to automate building,
>> > which can happen on two or more platforms with some 4 compilers to be
>> > used in total, and should store the results in file tree like
>> > $platform/$compiler or $platform/$compilerEnvironment. Could you please
>> > suggest me how should it be done? Some example?
>> >
>> > (the idea is to store various builds with all of their intermediate files
>> > in parallel both to test code against wider set of compilers and
>> > platforms, some of which will be built with cross compiling environments)
>>
>> Write a script that creates for each of the combinations a separate build
>>  tree and then invokes CMake as appropriate. If you want to, you can also
>>  use cache-initializer scripts (see the CMake documentation) to set common
>>  options in the cache. Since you are building on multiple platforms
>>  (presumably not cross-compiling), you'll want to write the script as a
>>  CMake script (or Ruby, Python, Lua, whichever suits you best).
> I think, I got the idea, but how can these three be completely separated:
> {sources and CMakeLists.txt files; CMake intermediate files and object files;
> useful binaries and headers}?

sources and CMakeLists.txt files:
  -> same source directory

CMake intermediate files and object files:
  -> binary directory as defined by you

useful binaries and headers:
  -> I guess you mean the ones for installation. You install them with  
any layout you want using "make install DESTDIR=<install-prefix>" for  
seperate trees or by using CMAKE_INSTALL_PREFIX for a common tree (or  
whatever scheme you want in the install() command).

HS





More information about the CMake mailing list