<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-2022-jp">
<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 name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@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:"\@SimSun";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"SimSun","serif";
        color:black;}
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;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
tt
        {mso-style-priority:99;
        font-family:"SimSun","serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Courier New";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@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="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 bgcolor=white lang=EN-GB link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Rather than try to explain, have a look at this one I made
earlier ....it inherits stuff from the parent project, but you should see what’s
going on.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><a
href="http://gitorious.org/hdf5/hdf5-v18/blobs/master/fortran/CMakeLists.txt">http://gitorious.org/hdf5/hdf5-v18/blobs/master/fortran/CMakeLists.txt</a><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>scroll down until you see <o:p></o:p></span></p>

<pre>#-----------------------------------------------------------------------------<o:p></o:p></pre><pre># Setup the Fortran auto-detection utilities<o:p></o:p></pre><pre># H5test_kind(_SIZEOF).f90 used to generate H5fortran_detect.f90<o:p></o:p></pre><pre># H5fortran_detect.f90&nbsp;&nbsp;&nbsp;&nbsp; used to generate H5fort_type_defines.h<o:p></o:p></pre><pre># H5fort_type_defines.h&nbsp;&nbsp;&nbsp; used to generate H5f90i_gen.h + H5fortran_types.f90<o:p></o:p></pre><pre>#-----------------------------------------------------------------------------<o:p></o:p></pre>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>and then you’ll see chained targets, which generate the next
one. Mixing C/Fortran will be ok, - note that some of the generated files are
listed as sources in the next one &#8211; this ensures that the rules are defined in
succession.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>JB<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>

<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
"Tahoma","sans-serif";color:windowtext'>From:</span></b><span lang=EN-US
style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>
cmake-bounces@cmake.org [mailto:cmake-bounces@cmake.org] <b>On Behalf Of </b>??<br>
<b>Sent:</b> 24 November 2009 16:22<br>
<b>To:</b> CMake List<br>
<b>Subject:</b> [CMake] problem about Fortran and C mixing<o:p></o:p></span></p>

</div>

</div>

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

<p class=MsoNormal><tt>Hi all,</tt><br>
<br>
<tt>I have decided to mix Fortran with C, due to a library that only has C
interface. Here is the scienario:</tt><br>
<br>
<tt>suppose there are several programs, </tt><tt><span style='color:#009900'>file1.f90</span>,
</tt><tt><span style='color:#3333FF'>file2.f90</span>, </tt><tt><span
style='color:red'>file3.c</span> and a C library &lt;lib&gt;.</tt><br>
<br>
<tt>1. </tt><tt><span style='color:#009900'>file1.f90</span> calls </tt><tt><span
style='color:#3333FF'>file2.f90</span> to generate a executable</tt><br>
<tt>2. </tt><tt><span style='color:#3333FF'>file2.f90</span> calls </tt><tt><span
style='color:red'>file3.c</span> to generate a module &lt;mod&gt;</tt><br>
<tt>3. </tt><tt><span style='color:red'>file3.c</span> calls &lt;lib&gt;</tt><br>
<br>
<tt>so how to setup CMakeLists.txt? Thanks for Help!</tt><br>
<br>
<tt>Best regards,</tt><br>
<br>
<tt>DONG Li</tt><o:p></o:p></p>

</div>

</div>

</body>

</html>