[CMake] [Dev] CMake 2.5 tool chain support example

Alexander Neundorf a.neundorf-work at gmx.net
Mon May 28 12:21:47 EDT 2007


Hi Trevor,

On Monday 28 May 2007 11:48, Trevor Kellaway wrote:
> Alex,
>
> I've rebuilt with cmake version 2.5-20070527 and all seems OK.
>
> Attached is an example set of scripts for adding tool chain support for
> Freescale HC12 embedded 16-bit microcontroller. This is intended as a
> demonstration to others for how to add additional tool chain support
> (see the ReadMe.txt in the ZIP).
>
> Could you review "Toolchain-Freescale-HC12.cmake" and
> "Freescale-HC12.cmake" in terms of the general approach and in terms of
> a tutorial? Note "Freescale-HC12-opt.cmake" also in the source
> directory.

Thanks for your efforts, this looks really good !
But before publishing this as tutorial, please wait until everything is tested 
a bit more and we found the final form for everything.

Some questions/notes:
You are using HC12_CORE. I'm still wondering whether standardizing on 
CMAKE_SYSTEM_PROCESSOR (which already exists) would be a good idea to use for 
this. 
Maybe the system type should be set to "Generic". Then cmake could 
automatically try to load
${CMAKE_SYSTEM_NAME}.cmake # does probably nothing
${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER}.cmake 
# "Generic-hc12.cmake", sets compiler rules
and 
${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER}-${CMAKE_SYSTEM_PROCESSOR}.cmake 
# sets the flags for the processor

What do you think about this ?


Why are CMAKE_C_COMPILER, CMAKE_CXX_COMPILER not in the toolchain file ? 
This would then automatically disable also CMAKE_SKIP_ASSEMBLY_SOURCE_RULES, 
CMAKE_SKIP_PREPROCESSED_SOURCE_RULES (which you do currently manually).


I'm not sure about the -opt.cmake file. Can't this simply be done in the 
CMakeLists.txt ?

Bye
Alex


More information about the CMake mailing list