That’s perfect! It looks like it was introduced in CMake 3.6, whereas LLVM 
targets a minimum of 3.4.3 right now, but I’ll make a note of it for the next 
CMake upgrade. Thanks!

From: CMake <> on behalf of Craig Scott 
Date: Thursday, January 31, 2019 at 12:10 PM
To: "" <>
Cc: CMake MailingList <>
Subject: Re: [CMake] Checking Variables in a tool-chain file

This is precisely the scenario that the 
 variable is meant for. It allows a toolchain file to specify additional 
variables that should be passed along to try_compile().

On Fri, Feb 1, 2019 at 6:36 AM Shoaib Meenai 
<<>> wrote:
We have a somewhat similar problem with LLVM's toolchain file for 
cross-compiling to Windows, and we solve it there by saving and restoring cache 
variables from the environment inside the toolchain file itself. See;352783$88-102?as=source&blame=off<>
 and the subsequent calls to init_user_prop.

On 1/31/19, 12:19 AM, "CMake on behalf of" 
<<> on behalf of> wrote:

    Hi Sergei,

    > Am 31.01.2019 um 08:42 schrieb Sergei Nikulov 
    > Just guessing maybe better use $ENV{ARM_GCC_TOOL_PATH} ?

    Well, but this would mean, I had to configure CMake not only with Cache 

    cmake -DARM_GCC_TOOL_PATH=/usr/local/gcc-arm-none-eabi-7-2018-q2-update 
-DBINDING=nrf52 -DCMAKE_TOOLCHAIN_FILE=../cmake/gcc-arm-none-eabi.cmake 

    But also with environment variables:
    ARM_GCC_TOOL_PATH=/usr/local/gcc-arm-none-eabi-7-2018-q2-update cmake 
-DBINDING=nrf52 -DCMAKE_TOOLCHAIN_FILE=../cmake/gcc-arm-none-eabi.cmake 

    Thanks for the pointer, I will think about it.

    kind regards,

Craig Scott
Melbourne, Australia<>

Get the hand-book for every CMake user: Professional CMake: A Practical 

Powered by

Please keep messages on-topic and check the CMake FAQ at:

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support:
CMake Consulting:
CMake Training Courses:

Visit other Kitware open-source projects at

Follow this link to subscribe/unsubscribe:

Reply via email to