[CMake] PROJECT() command when cross compiling

Alexander Neundorf a.neundorf-work at gmx.net
Thu Jul 1 14:37:07 EDT 2010


On Thursday 01 July 2010, Kishore wrote:
> It seems that the PROJECT() command does a fair bit behind the scenes and
> is not documented enough. It seems to "reset" several variable created
> before it was _first_ called.
>
> Since i use cmake from cross compilation, i have created Platform files for
> Generic-gcc.cmake and Generic-gcc-uc3b1256.cmake (for the processor that I
> use)
>
> 1) It seems that these files are invoked inside the PROJECT() command
> 2) The platform files set up some needed variables such as CMAKE_C_FLAGS
> 3) When the PROJECT() command finishes, the variable CMAKE_C_FLAGS is again
> empty.

project() automatically enable the languages, if no languages are given, it 
tries C and C++. While doing this, a whole bunch of variables are set.

Alex


More information about the CMake mailing list