<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    That's a hint, I changed my toolchain file "toolchain_ppc.cmake" to
    the following:<br>
    INCLUDE(CMakeForceCompiler)<br>
    set(CMAKE_SYSTEM_NAME "Discovery")<br>
    <br>
    if(CMAKE_CROSSCOMPILING)<br>
    message("Cross Compiling")<br>
    endif(CMAKE_CROSSCOMPILING)<br>
    <br>
    # which compilers to use for C and C++<br>
    set(CMAKE_C_COMPILER "C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe")<br>
    set(CMAKE_FORCE_C_COMPILER
    "C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe")<br>
    set(CMAKE_C_FLAGS "-tPPCVLEEN:simple")<br>
    <br>
    Then I created a folder with the name Platform containing a file
    with CMAKE_SYSTEM_NAME which is Discovery -&gt; at this point I had
    already problems, because CMake doesn't use as described the
    filename with .cmake extension. The filename in the Platform folder
    has to have the name from CMAKE_SYSTEM_NAME without the extension
    .cmake (even the documentation says something different). I checked
    this by adding the output of a message("SYSTEM_NAME=Discovery").<br>
    <br>
    The Platform/Discovery file contains the lines:<br>
    message("SYSTEM_NAME=Discovery")<br>
    set(CMAKE_FORCE_C_COMPILER
    "C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe")<br>
    set(CMAKE_C_COMPILER "C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe")<br>
    set(CMAKE_C_FLAGS "-tPPCVLEEN:simple")<br>
    set(CMAKE_FORCE_C_FLAGS "-tPPCVLEEN:simple")<br>
    set(CMAKE_FORCE_CXX_COMPILER
    "C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe")<br>
    set(CMAKE_CXX_COMPILER
    "C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe")<br>
    set(CMAKE_CXX_FLAGS "-tPPCVLEEN:simple")<br>
    set(CMAKE_MAKE_PROGRAM
    "D:/novero/Discovery/impl/win32/nmake/nmake.exe")<br>
    <br>
    Then I call from the command line the CMake tool with the
    parameters:<br>
    D:\novero\Discovery\impl\target\CarIF_Appl\output&gt;cmake -G "NMake
    Makefiles" -D CMAKE_TOOLCHAIN_FILE="..\toolchain_ppc.cmake" ..<br>
    <br>
    The following output will be produced:<br>
    ********************* snip output ********************* <br>
    Cross Compiling<br>
    -- The C compiler identification is unknown<br>
    -- The CXX compiler identification is unknown<br>
    SYSTEM_NAME=Discovery<br>
    SYSTEM_NAME=Discovery<br>
    -- Check for working C compiler:
    C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe<br>
    System is unknown to cmake, create:<br>
    Platform/Discovery to use this system, please send your config file
    to cmake@www<br>
    .cmake.org so it can be added to cmake<br>
    -- Check for working C compiler:
    C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe --<br>
    broken<br>
    CMake Error at C:/Program Files/CMake
    2.8/share/cmake-2.8/Modules/CMakeTestCComp<br>
    iler.cmake:52 (MESSAGE):<br>
    &nbsp; The C compiler "C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe" is
    not able to<br>
    &nbsp; compile a simple test program.<br>
    <br>
    &nbsp; It fails with the following output:<br>
    <br>
    &nbsp;&nbsp; Change Dir:
    D:/novero/Discovery/impl/target/CarIF_Appl/output/CMakeFiles/CMak<br>
    eTmp<br>
    <br>
    &nbsp; Run Build Command:nmake /NOLOGO "cmTryCompileExec\fast"<br>
    <br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nmake -f CMakeFiles\cmTryCompileExec.dir\build.make /nologo
    -L<br>
    &nbsp; CMakeFiles\cmTryCompileExec.dir\build<br>
    <br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "C:\Program Files\CMake 2.8\bin\cmake.exe" -E
    cmake_progress_report<br>
    &nbsp;
D:\novero\Discovery\impl\target\CarIF_Appl\output\CMakeFiles\CMakeTmp\CMakeFil<br>
    es<br>
    &nbsp; 1<br>
    <br>
    &nbsp; Building C object
    CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj<br>
    <br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C:\WindRiver\diab\5.9.0.0\WIN32\bin\dcc.exe -o<br>
    &nbsp; CMakeFiles\cmTryCompileExec.dir\testCCompiler.c.obj -c<br>
    &nbsp;
D:\novero\Discovery\impl\target\CarIF_Appl\output\CMakeFiles\CMakeTmp\testCCom<br>
    piler.c<br>
    <br>
    <br>
    &nbsp; Target Unknown.&nbsp; Use the -t option or set a default target with
    dctrl -t<br>
    <br>
    &nbsp; NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return
    code<br>
    &nbsp; '0x1'<br>
    <br>
    &nbsp; Stop.<br>
    <br>
    &nbsp; NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return
    code<br>
    &nbsp; '0x2'<br>
    <br>
    &nbsp; Stop.<br>
    <br>
    &nbsp; CMake will not be able to correctly generate this project.<br>
    Call Stack (most recent call first):<br>
    &nbsp; CMakeLists.txt:2 (project)<br>
    <br>
    <br>
    -- Configuring incomplete, errors occurred!<br>
    You have changed variables that require your cache to be deleted.<br>
    Configure will be re-run and you may have to reset some variables.<br>
    The following variables have changed:<br>
    CMAKE_CXX_COMPILER= cl<br>
    <br>
    -- Generating done<br>
    -- Build files have been written to:
    D:/novero/Discovery/impl/target/CarIF_Appl/<br>
    output<br>
    <br>
    ********************* snap output ********************* <br>
    <br>
    1.) with the output SYSTEM_NAME=Discovery I can see that the
    platform file is used<br>
    2.) the compilation doesn't complete, because the CMAKE_C_FLAGS are
    still not used<br>
    3.) why do I have to have a CXX (C++) compiler, even if I don't need
    it in my embedded solution<br>
    4.) is there any reason why CMake needs to know my system? I want
    just to compile some files... (wondering)<br>
    <br>
    <br>
    On 19.09.11 15:46, Eric Noulard wrote:
    <blockquote
cite="mid:%20%3CCAPASGLq9FP9M4=QfKB_zvhEXfMBETz9_sLVXJJm38sMANJhuwA@mail.gmail.com"
      type="cite">
      <pre wrap="">2011/9/19 Martin Kupke <a class="moz-txt-link-rfc2396E" href="mailto:martin.kupke@novero.com">&lt;martin.kupke@novero.com&gt;</a>
</pre>
      <blockquote type="cite">
        <pre wrap="">
My problem (the error) already occurs in the toolchain file, this means before the CMakeLists.txt is read. So far it is total independent of the entries in the CMakeLists.txt!

I have added the line:
message ("Mein CMakeLists.txt File")
in top of my CMakeLists.txt and would assume that there is an output on the console with the string, but it isn't.

The output is stopped while parsing the toolchain file and determining the compiler.
</pre>
      </blockquote>
      <pre wrap="">
That's what I was about to say.

Read <a class="moz-txt-link-freetext" href="http://www.vtk.org/Wiki/CMake_Cross_Compiling">http://www.vtk.org/Wiki/CMake_Cross_Compiling</a>  carefully
you'll see that you may have to write a

Platform/${CMAKE_SYSTEM_NAME}-&lt;compiler&gt;.cmake file
in order to inform CMake about your particular compiler compilation FLAGS.

Doing it in CMakeLists.txt may already be too late.
Nevertheless it puzzles me that it works on Linux and not on Windows...

I'm no expert concerning Cross-compiling with CMake so I let others
take over this discussion.

--
Erk
Membre de l'April - &laquo; promouvoir et d&eacute;fendre le logiciel libre &raquo; -
<a class="moz-txt-link-freetext" href="http://www.april.org">http://www.april.org</a>
</pre>
    </blockquote>
    <br>
    <div class="moz-signature">-- <br>
      <title></title>
      <br>
      <div class="moz-signature">
        <style><!--
 /* Font Definitions */
 @font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:KievitOT-Regular;
        panose-1:2 0 5 3 4 0 0 2 0 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        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.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style><!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="2050" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
        <div class="Section1">
          <hr size="2" width="100%">
          <p class="MsoNormal"><b><span style="font-family:
                KievitOT-Regular; color: rgb(192, 0, 0);" lang="EN-CA">martin
                kupke<o:p></o:p></span></b></p>
          <p class="MsoNormal"> <span style="font-family:
              KievitOT-Regular; color: rgb(15, 36, 62);">can diagnostics
              engineer | senior software developer<o:p></o:p></span>
          </p>
          <p class="MsoNormal"><b><span style="font-family:
                KievitOT-Regular; color: rgb(192, 0, 0);">m</span></b><span
              style="font-family: KievitOT-Regular; color: rgb(192, 0,
              0);">:</span><span style="font-family: KievitOT-Regular;
              color: rgb(31, 73, 125);"> </span><span
              style="font-family: KievitOT-Regular; color: rgb(15, 36,
              62);">+49.151.5511.3632</span><span style="font-family:
              KievitOT-Regular; color: rgb(38, 38, 38);"> </span><span
              style="font-family: KievitOT-Regular; color: rgb(31, 73,
              125);">| </span><b><span style="font-family:
                KievitOT-Regular; color: rgb(192, 0, 0);">e</span></b><span
              style="font-family: KievitOT-Regular; color: rgb(192, 0,
              0);">:</span><span style="font-family: KievitOT-Regular;
              color: rgb(155, 37, 74);"> </span><span
              style="font-family: KievitOT-Regular; color: rgb(31, 73,
              125);"><a href="mailto:martin.kupke@novero.com"><span
                  style="color: blue;">martin.kupke@novero.com</span></a><o:p></o:p></span></p>
          <p class="MsoNormal"><span style="font-family:
              KievitOT-Regular; color: rgb(15, 36, 62);">skype:</span><span
              style="font-family: KievitOT-Regular; color: rgb(31, 73,
              125);">&nbsp;
            </span><span style="font-family: KievitOT-Regular; color:
              rgb(15, 36, 62);">martin.kupke_novero&nbsp;
            </span><span style="font-family: KievitOT-Regular; color:
              rgb(0, 32, 96);">| </span><span style="font-family:
              KievitOT-Regular; color: rgb(15, 36, 62);">w:</span><span
              style="font-family: KievitOT-Regular; color: rgb(31, 73,
              125);"> <a href="http://www.novero.com"><span
                  style="color: blue;">www.novero.com</span></a><br>
              <br>
            </span>
            <span style="font-family: KievitOT-Regular; color: rgb(192,
              0, 0);"></span>
            <img src="cid:part1.03000601.09010601@novero.com"
              alt="novero GmbH"><br>
            <span style="font-family: KievitOT-Regular; color: rgb(15,
              36, 62);">meesmannstr.103 | 44807 Bochum | germany</span>
            <span style="font-family: KievitOT-Regular; color: rgb(31,
              73, 125);"><o:p></o:p></span></p>
          <p class="MsoNormal"> <span style="font-family:
              KievitOT-Regular; color: rgb(15, 36, 62);"><br>
              novero gmbh | parsevalstr. </span> <span
              style="font-family: KievitOT-Regular; color: rgb(15, 36,
              62);" lang="DE">7 a | 40468 d&uuml;sseldorf | germany |
              amtsgericht d&uuml;sseldorf | hrb 58283 |
              umsatzsteueridentifikationsnummer: de 814973142 |
              gesch&auml;ftsf&uuml;hrender gesellschafter: razvan olosu</span> <span
              style="font-family: KievitOT-Regular; color: rgb(31, 73,
              125);" lang="DE"><o:p></o:p></span>
          </p>
          <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
        </div>
      </div>
    </div>
  </body>
</html>