<div dir="ltr">I've got a follow-up question about cross-compiling for dSpace. My Toolchain file so far:<div><br></div><div><div style="font-size:13px"><font color="#3d85c6">set(CMAKE_SYSTEM_NAME dSpace)<br>list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})</font></div><div style="font-size:13px"><font color="#3d85c6"><br></font></div><div style="font-size:13px"><font color="#3d85c6">file(TO_CMAKE_PATH "C:\\Program Files\\dSPACE RCPHIL 2016-B" DSPACE_TOOLS)<br>set(DSPACE_PPCTOOLS ${DSPACE_TOOLS}/Compiler/PPCTools)</font></div><div style="font-size:13px"><font color="#3d85c6"><br>find_program(CMAKE_C_COMPILER NAMES ${DSPACE_PPCTOOLS}/bin/mccppc.exe)<br>find_program(CMAKE_C_COMPILER NAMES ${DSPACE_PPCTOOLS}/bin/cccppc.exe)</font></div><div style="font-size:13px"><font color="#3d85c6"><br></font></div><div style="font-size:13px"><font color="#3d85c6">find_program(CMAKE_MAKE_PROGRAM ${DSPACE_TOOLS}/Exe/DSMAKE.EXE)</font></div><div style="font-size:13px"><font color="#3d85c6"><br></font></div><div style="font-size:13px"><font color="#3d85c6">set(CMAKE_FIND_ROOT_PATH ${DSPACE_PPCTOOLS})</font></div><div style="font-size:13px"><font color="#3d85c6"><br>set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)<br>set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)<br>set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)</font></div><div><br></div><div>CMake is actually able to locate the C compiler (called "mccppc.exe") and CMake thus tries to compile a test program ('CompilerIdC.c'). I can compile this source file 'by hand' with said compiler. However, from CMake (which automatically uses MSBuild.exe), I get the error output below.</div><div><br></div><div>How can I circumvent MSBuild.exe and/or the attempted loading of the SDK? Do I forget to set some other important variables (e.g. CMAKE_MAKE_PROGRAM seems to be ignored?)</div><div><br></div><div><div style="font-size:13px"><font color="#cc0000">The C compiler "C:/Program Files/dSPACE RCPHIL 2016-B/Compiler/PPCTools/bin/mccppc.exe" is not able to compile a simple test program.</font></div><div style="font-size:13px"><font color="#cc0000">  It fails with the following output:</font></div></div><div style="font-size:13px"><font color="#cc0000"><br></font></div><div style="font-size:13px"><div class="inbox-uyb8Gf"><div><div class="inbox-F3hlO"><div dir="ltr"><div><font color="#cc0000">Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.<br>Compiler: C:/Program Files/dSPACE RCPHIL 2016-B/Compiler/PPCTools/bin/mccppc.exe <br>Build flags: <br>Id flags:  </font></div><div><font color="#cc0000">The output was:<br>1</font></div></div></div></div></div><div class="inbox-uyb8Gf"><div><div title="Hide quoted text" tabindex="0" class="inbox-mg"><font color="#cc0000">…</font></div><div class="inbox-vI"><div dir="ltr"><font color="#cc0000"><br>Microsoft (R) Build Engine version 15.1.1012.6693<br>Copyright (C) Microsoft Corporation. All rights reserved.</font></div></div></div></div><div class="inbox-uyb8Gf"><div><div class="inbox-F3hlO"><div dir="ltr"><div></div><div><font color="#cc0000">Build started 8/11/2017 11:34:36 AM.<br>Project "C:\Users\SYSCOP\Documents\GitHub\acados-master\build\CMakeFiles\3.8.2\CompilerIdC\CompilerIdC.vcxproj" on node 1 (default targets).<br>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Platforms\Win32\PlatformToolsets\v141\Toolset.targets(34,5): error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\Users\SYSCOP\Documents\GitHub\acados-master\build\CMakeFiles\3.8.2\CompilerIdC\CompilerIdC.vcxproj]<br>Done Building Project "C:\Users\SYSCOP\Documents\GitHub\acados-master\build\CMakeFiles\3.8.2\CompilerIdC\CompilerIdC.vcxproj" (default targets) -- FAILED.</font></div><div><font color="#cc0000">Build FAILED.</font></div></div></div></div></div></div><div><br><div class="gmail_quote"><div dir="ltr">On Fri, 23 Jun 2017 at 22:37 Robin Verschueren <<a href="mailto:robin.verschueren@gmail.com">robin.verschueren@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Dear Nils,<div><br></div><div>Perfect! This was exactly what I was looking for.</div><div>It works, and the CMAKE_INCLUDE_FLAG_C </div><div>is not overwritten.</div><div><br></div><div>Thanks,</div><div>Robin</div></div><div dir="ltr"><div><br><br><div class="gmail_quote"><div dir="ltr">On Fri, 23 Jun 2017 at 13:29 Nils Gladitz <<a href="mailto:nilsgladitz@gmail.com" target="_blank">nilsgladitz@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF">
    <div class="m_-1143848639106018753m_3110800915616364462moz-cite-prefix">On 23.06.2017 21:47, Robin Verschueren
      wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr"><span style="font-size:13px">Dear CMake,</span>
        <div style="font-size:13px"><br>
        </div>
        <div style="font-size:13px">We are trying to build our
          application for the dSPACE embedded system</div>
        <div style="font-size:13px">(<a href="http://www.dspace.com" target="_blank">www.dspace.com</a>),
          more specifically their MicroAutobox-II. This makes</div>
        <div style="font-size:13px">use of a specific compiler called
          mccppc (Microtec C/C++ PowerPC compiler).</div>
        <div style="font-size:13px"><br>
        </div>
        <div style="font-size:13px">I was following the instructions on
          <a href="https://cmake.org/Wiki/CMake_Cross_Compiling" target="_blank">this wiki page</a>, when I got the
          following warning, </div>
        <div style="font-size:13px">when trying to use a custom
          'Toolchain' file:</div>
        <div style="font-size:13px"><br>
        </div>
        <div style="font-size:13px">
          <p style="margin:0px;font-size:10px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">System
              is unknown to cmake, create:</span></p>
          <p style="margin:0px;font-size:10px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Platform/dSPACE
              to use this system, please send your config file to </span></p>
          <p style="margin:0px;font-size:10px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><a href="mailto:cmake@www.cmake.org" target="_blank">cmake@www.cmake.org</a> so it can
              be added to cmake</span></p>
        </div>
        <div style="font-size:13px"><br>
        </div>
        <div style="font-size:13px">We would be glad to send it to you
          when it is finished, but in the meantime,</div>
        <div style="font-size:13px">we cannot debug our toolchain file
          because of above warning.</div>
        <div style="font-size:13px"><br>
        </div>
        <div style="font-size:13px">Is there a way of including it
          without having to include it in the official CMake</div>
        <div style="font-size:13px">distribution? I tried setting
          CMAKE_MODULE_PATH but that did not help..</div>
      </div>
    </blockquote>
    <br></div><div text="#000000" bgcolor="#FFFFFF">
    In the Toolchain file:<br>
        set(CMAKE_SYSTEM_NAME dSPACE)<br>
    <br>
        list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})<br>
    <br>
        ...<br>
    <br>
    Then having Platform/dSPACE.cmake next to your toolchain file should
    work (works for me).</div><div text="#000000" bgcolor="#FFFFFF"><br>
    <br>
    Nils<br>
    <br>
  </div></blockquote></div></div></div></blockquote></div></div></div></div>