[cmake-developers] CMAKE_TOOLCHAIN_FILE and ExternalProject_Add

Brad King brad.king at kitware.com
Mon Apr 27 09:16:53 EDT 2015


On 04/26/2015 09:08 PM, David Cole via cmake-developers wrote:
> I really don't see how you solve the problem by having a toolchain
> file and some arbitrary set of variables to be passed down. Either you
> have to put the CMAKE_TOOLCHAIN_ARGS into the toolchain file itself,
> or you have to specify the complete set of what defines
> CMAKE_TOOLCHAIN_ARGS.
> 
> On Sun, Apr 26, 2015 at 8:53 PM, Andrey Pokrovskiy wrote:
>> Because it will be an ad-hoc solution. Also each time I will start
>> using a new toolchain file (for another device/platform) I will need
>> to modify that wrapper script.

The intention of a file referenced by CMAKE_TOOLCHAIN_FILE is to
contain information *local to the machine*, like the paths to
installed SDKs for the target platform.  It is *supposed* to be
a local file not distributed with the project being built.
Anything that would go in CMAKE_TOOLCHAIN_ARGS can just be put
in that local file instead.

Any information that is general knowledge about the target
platform should be in the platform information modules that
CMake loads based on the CMAKE_SYSTEM_NAME.  The project may
put these in CMAKE_MODULE_PATH.

-Brad



More information about the cmake-developers mailing list