[CMake] Implicit toolchain file usage

Alexander Neundorf a.neundorf-work at gmx.net
Thu Jan 17 15:31:59 EST 2013


On Thursday 17 January 2013, Laszlo Papp wrote:
> Hi,
> 
> I have been pondering for a while if it was possible (theoritically, and
> then practically) to get the toolchain fine defined inside one (main?) of
> the cmake files?
> 
> I have been using the -DCMAKE_TOOLCHAIN_FILE=my-toolchain-file.cmake
> option, but I think this can become duplicated easily. That is because most
> of the time the developers, packagers, or users may have to define the
> platform to build for on the command line anyway. Hence, the toolchain file
> detection and usage could be implicit. I have also imported my toolchain
> file into the project because it is a very short file, and really not a big
> burden. I understand that the toolchain files are specified by this file,
> so this should be put into an early stage of the build procedure for sure.
> 
> Otherwise, everyone has to deal with it separately, which is undesirable, I
> believe. Sometimes, it may make sense to customize this on your own, but
> there could be a fallback provided by the project developers implicitly
> inside the build system of the given project. I think, this would be a
> great thing to have.
> 
> Is it already available now like just simple define (implicit equivalence
> of the -D) or so?

do you mean using -DCMAKE_SYSTEM_NAME=qnx should trigger something ?
Don't know, my experience is that cross compiling environments usually vary a 
lot in their setup.

Can you attach your toolchain file here so we can have a look ?

Alex


More information about the CMake mailing list