<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">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!<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">CMake <cmake-bounces@cmake.org> on behalf of Craig Scott <craig.scott@crascit.com><br>
<b>Date: </b>Thursday, January 31, 2019 at 12:10 PM<br>
<b>To: </b>"Torsten@Robitzki.de" <Torsten@robitzki.de><br>
<b>Cc: </b>CMake MailingList <cmake@cmake.org><br>
<b>Subject: </b>Re: [CMake] Checking Variables in a tool-chain file<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">This is precisely the scenario that the <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__cmake.org_cmake_help_latest_variable_CMAKE-5FTRY-5FCOMPILE-5FPLATFORM-5FVARIABLES.html&d=DwMFaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=DWIp-ETcvhiY2syIyGl15SjKRGmBgOqESLLbtIITkg0&s=dUHD897Pz1vT4JSorC4Kp7QbWhBuxzgq9jS4SQWX5I0&e=">CMAKE_TRY_COMPILE_PLATFORM_VARIABLES</a> variable
is meant for. It allows a toolchain file to specify additional variables that should be passed along to try_compile().<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Fri, Feb 1, 2019 at 6:36 AM Shoaib Meenai <<a href="mailto:smeenai@fb.com">smeenai@fb.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">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
<a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__reviews.llvm.org_diffusion_L_browse_llvm_trunk_cmake_platforms_WinMsvc.cmake-3B352783-2488-2D102-3Fas-3Dsource-26blame-3Doff&d=DwMFaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=DWIp-ETcvhiY2syIyGl15SjKRGmBgOqESLLbtIITkg0&s=lF2TBukE0bj0x1YOkOC6golh5vzIBnpbZLQVXb_1poU&e=" target="_blank">
https://reviews.llvm.org/diffusion/L/browse/llvm/trunk/cmake/platforms/WinMsvc.cmake;352783$88-102?as=source&blame=off</a> and the subsequent calls to init_user_prop.<br>
<br>
On 1/31/19, 12:19 AM, "CMake on behalf of Torsten@Robitzki.de" <<a href="mailto:cmake-bounces@cmake.org" target="_blank">cmake-bounces@cmake.org</a> on behalf of Torsten@Robitzki.de> wrote:<br>
<br>
Hi Sergei,<br>
<br>
> Am 31.01.2019 um 08:42 schrieb Sergei Nikulov <<a href="mailto:sergey.nikulov@gmail.com" target="_blank">sergey.nikulov@gmail.com</a>>:<br>
> <br>
> Just guessing maybe better use $ENV{ARM_GCC_TOOL_PATH} ?<br>
> <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__cmake.org_cmake_help_latest_variable_ENV.html-3Fhighlight-3Denv&d=DwMFaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=DWIp-ETcvhiY2syIyGl15SjKRGmBgOqESLLbtIITkg0&s=vw42QC6Z-nK-9Ga13koxIghj6vajaXQv1OQa3aSXloU&e=" target="_blank">
https://cmake.org/cmake/help/latest/variable/ENV.html?highlight=env</a><br>
<br>
Well, but this would mean, I had to configure CMake not only with Cache variables:<br>
<br>
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 -DNRF5_SDK_ROOT=~/CMSIS/nRF5_SDK_14-2/ ..<br>
<br>
But also with environment variables:<br>
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 -DNRF5_SDK_ROOT=~/CMSIS/nRF5_SDK_14-2/ ..<br>
<br>
Thanks for the pointer, I will think about it.<br>
<br>
kind regards,<br>
Torsten<o:p></o:p></p>
</blockquote>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<p class="MsoNormal">-- <o:p></o:p></p>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">Craig Scott<o:p></o:p></p>
<div>
<p class="MsoNormal">Melbourne, Australia<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__crascit.com&d=DwMFaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=DWIp-ETcvhiY2syIyGl15SjKRGmBgOqESLLbtIITkg0&s=-gBb_NSht4wIEsgFyHBr8kq1xS721KBwcVTguP18ehA&e=" target="_blank">https://crascit.com</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Get the hand-book for every CMake user: <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__crascit.com_professional-2Dcmake_&d=DwMFaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=DWIp-ETcvhiY2syIyGl15SjKRGmBgOqESLLbtIITkg0&s=roR58RXGVlqqg-JVPQNTOi7OfUznG7eEEHheyPmJEnc&e=" target="_blank">Professional
CMake: A Practical Guide</a><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>