<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    For cross compiling I need to set the variables "CMAKE_C_FLAGS_INIT"
    and "CMAKE_CXX_FLAGS_INIT" in the Platform Generic-dcc file.<br>
    Not sure why I need to configure CXX compiler and flags, even I
    don't use them...but that's another story.<br>
    <br>
    Now the CMake tool passes and finished without any errors, but the
    created Makefile for "NMake Makefiles" Generator can't compile my
    source file.<br>
    ################### output of NMake ###################<br>
    D:\novero\Discovery\impl\target\CarIF_Appl\output&gt;nmake<br>
    <br>
    Microsoft (R) Program Maintenance Utility&nbsp;&nbsp; Version 1.50<br>
    Copyright (c) Microsoft Corp 1988-94. All rights reserved.<br>
    <br>
    'C:\Program' is not recognized as an internal or external command,<br>
    operable program or batch file.<br>
    NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return
    code '0x1'<br>
    Stop.<br>
    NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return
    code '0x2'<br>
    Stop.<br>
    NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return
    code '0x2'<br>
    Stop.<br>
    ################### output of NMake ###################<br>
    <br>
    I assume that there is a problem with blanks in the path name,
    because of the output "'C:\Program' is not recognized as an internal
    or external command,". I guess it would be something like
    "C:\Program Files\...." and the blank / space character confuses the
    build process.<br>
    <br>
    Any ideas to blanks / spaces in files and foldernames?<br>
    <br>
    Thanks<br>
    Martin...<br>
    <br>
    On 19.09.11 18:04, Martin Kupke wrote:
    <blockquote cite="mid:4E776801.50403@novero.com" type="cite">
      <pre wrap="">I'm using a toolchain file with the CMAKE_SYSTEM_NAME "Generic", because 
I want to cross compile on a Windows XP machine for a PPC (PowerPC) 
processor. From my point of view it should be in a way as in the 
documentation for the SDCC.
My toolchain file "toolchain_ppc.cmake" is setup:
#############################################
set(CMAKE_SYSTEM_NAME "Generic")

if(CMAKE_CROSSCOMPILING)
message("Cross Compiling")
endif(CMAKE_CROSSCOMPILING)

# which compilers to use for C and C++
set(CMAKE_C_COMPILER "dcc.exe")
set(CMAKE_FIND_ROOT_PATH "C:/WindRiver/diab/5.9.0.0/WIN32/bin")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

set(CMAKE_C_FLAGS "-tPPCVLEEN:simple")
#############################################

Additionally in the Platform folder I created a Generic-dcc file for 
system specific options:
#############################################
MESSAGE("SYSTEM_NAME=Generic")
set(CMAKE_C_FLAGS "-tPPCVLEEN:simple")
#############################################

In the windows console I call the CMake tool in an empty output folder:
D:\novero\Discovery\impl\target\CarIF_Appl\output&gt;cmake -G "NMake 
Makefiles" -D CMAKE_TOOLCHAIN_FILE="..\toolchain_ppc.cmake" ..

The output of the CMake process shows that the test compilation could 
not be performed and the reason for that is, that my CMAKE_C_FLAGS are 
not passed to the configured compiler dcc.exe.
#############################################
Cross Compiling
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
SYSTEM_NAME=Generic
-- Check for working C compiler: c:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe
-- Check for working C compiler: 
c:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe --broken
CMake Error at C:/Program Files/CMake 
2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
   The C compiler "c:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe" is not 
able to compile a simple test program.

   It fails with the following output:
    Change Dir: 
D:/novero/Discovery/impl/target/CarIF_Appl/output/CMakeFiles/CMakeTmp
   Run Build Command:nmake /NOLOGO "cmTryCompileExec\fast"
         nmake -f CMakeFiles\cmTryCompileExec.dir\build.make /nologo -L
   CMakeFiles\cmTryCompileExec.dir\build

         "C:\Program Files\CMake 2.8\bin\cmake.exe" -E 
cmake_progress_report  
D:\novero\Discovery\impl\target\CarIF_Appl\output\CMakeFiles\CMakeTmp\CMakeFiles  
1

   Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj

(LOOK_HERE)-&gt;        c:\WindRiver\diab\5.9.0.0\WIN32\bin\dcc.exe -o  
CMakeFiles\cmTryCompileExec.dir\testCCompiler.c.obj -c  
D:\novero\Discovery\impl\target\CarIF_Appl\output\CMakeFiles\CMakeTmp\testCCompiler.c

   Target Unknown.  Use the -t option or set a default target with dctrl -t

   NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return 
code  '0x1'
   Stop.

   NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return 
code  '0x2'
   Stop.

   CMake will not be able to correctly generate this project.
Call Stack (most recent call first):  CMakeLists.txt:2 (project)

CMake Error: your CXX compiler: "cl" was not found.   Please set 
CMAKE_CXX_COMPILER to a valid compiler path or name.
-- Configuring incomplete, errors occurred!
#############################################

I marked the position in the output with (LOOK_HERE)-&gt; where you can see 
that the necessary compile flags  CMAKE_C_FLAGS "-tPPCVLEEN:simple" have 
not been passed to the compiler. Where do I have to declare the 
CMAKE_C_FLAGS?


_______________________________________________
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>

Visit other Kitware open-source projects at <a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>

Please keep messages on-topic and check the CMake FAQ at: <a class="moz-txt-link-freetext" href="http://www.cmake.org/Wiki/CMake_FAQ">http://www.cmake.org/Wiki/CMake_FAQ</a>

Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://www.cmake.org/mailman/listinfo/cmake">http://www.cmake.org/mailman/listinfo/cmake</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.01090903.04010601@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>