<html xmlns:v="urn:schemas-microsoft-com:vml" 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=us-ascii">
<meta name=Generator content="Microsoft Word 12 (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: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;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-ZA link=blue vlink=purple>

<div class=WordSection1>

<p class=MsoNormal>Hi All,<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>I&#8217;m brand-new to cmake, and have run into a problem
cross compiling for an Intel embedded platform:<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Make complains about missing file 'curl/curl.h' when
compiling against an Intel SDK for linux. 'curl/curl.h' resides in the
cross-compile toolchain under [toolchain-folder]/include/curl/curl.h. The
toolchain file 'toolchain.cmake' resides at the root of the SDK
(toolchain.cmake attached to end).<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>The build is configured with the usual 'cmake
-DCMAKE_TOOLCHAIN_FILE=[path-to-toolchain] ..' from a 'build' folder in the src
directory of my application tree. cmake finds the compiler toolchain (gcc, gxx,
ar, etc.) and completes the configuration all good (cmake output attached to
end). The problem comes in when make is called. The strange thing is, the
variable 'CURL_HEADER' contains the path of curl/curl.h if the following is
added to the CMakeLists.txt:<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>FIND_FILE(<o:p></o:p></p>

<p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CURL_HEADER<o:p></o:p></p>

<p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; curl/curl.h<o:p></o:p></p>

<p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ONLY_CMAKE_FIND_ROOT_PATH<o:p></o:p></p>

<p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
)<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>This means that cmake can 'see' the file that make is
complaining about. My question is why, if cmake can see the file, does make
complain that it cannot find the file? Something must be missing with the
configuration of the cross-compilation. <o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>For reference, the program compiles perfectly on the host
system, without the -DCMAKE_TOOLCHAIN_FILE flag. The host system is Fedora 13
with curl and its headers installed.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>I've also attached the important bits of the make output to
the end for reference. <o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Any help is greatly appreciated.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Many thanks and kind regards,<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Thomas Walwyn<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>#------------------------toolchain.cmake----------------------------------#<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>SET(CMAKE_SYSTEM_NAME Linux)<o:p></o:p></p>

<p class=MsoNormal>SET(CMAKE_SYSTEM_VERSION 1)<o:p></o:p></p>

<p class=MsoNormal>SET(CMAKE_C_COMPILER
[path-to-compiler]/[platform]-linux-gcc)<o:p></o:p></p>

<p class=MsoNormal>SET(CMAKE_FIND_ROOT_PATH [path-to-toolchain-folder])<o:p></o:p></p>

<p class=MsoNormal>SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)<o:p></o:p></p>

<p class=MsoNormal>SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)<o:p></o:p></p>

<p class=MsoNormal>SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>#------------------------cmake
output----------------------------------#<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>-- The C compiler identification is GNU<o:p></o:p></p>

<p class=MsoNormal>-- The CXX compiler identification is GNU<o:p></o:p></p>

<p class=MsoNormal>-- Check for working C compiler:
[path-to-compiler]/[platform]-linux-gcc<o:p></o:p></p>

<p class=MsoNormal>-- Check for working C compiler:
[path-to-compiler]/[platform]-linux-gcc -- works<o:p></o:p></p>

<p class=MsoNormal>-- Detecting C compiler ABI info<o:p></o:p></p>

<p class=MsoNormal>-- Detecting C compiler ABI info - done<o:p></o:p></p>

<p class=MsoNormal>-- Check for working CXX compiler:
[path-to-compiler]/[platform]-linux-c++<o:p></o:p></p>

<p class=MsoNormal>-- Check for working CXX compiler: [path-to-compiler]/[platform]-linux-c++
-- works<o:p></o:p></p>

<p class=MsoNormal>-- Detecting CXX compiler ABI info<o:p></o:p></p>

<p class=MsoNormal>-- Detecting CXX compiler ABI info - done<o:p></o:p></p>

<p class=MsoNormal>-- Configuring done<o:p></o:p></p>

<p class=MsoNormal>-- Generating done<o:p></o:p></p>

<p class=MsoNormal>-- Build files have been written to:
[path-to-application-folder]/build<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>#-----------------------part of make which gives
error------------------#<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>cd [path-to-application-source] &amp;&amp;
[path-to-compiler]/[platform]-linux-gcc&nbsp; -DIPFrontend_EXPORTS -fPIC
-I[path-to-application-source]/includes&nbsp;&nbsp; -o
[path-to-application-source]/[source-file].c.o&nbsp;&nbsp; -c [path-to-application-source]/[source-file]/[path-to-application-source]/[source-file].c<o:p></o:p></p>

<p class=MsoNormal>[path-to-application-source]/[source-file].c:50:23: error:
curl/curl.h: No such file or directory<o:p></o:p></p>

</div>

</body>

</html>