<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:"MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
        {font-family:"MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","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
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Arial","sans-serif";
        color:windowtext;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
.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-GB link=blue vlink=purple>
<div class=WordSection1>
<p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial","sans-serif"'>Hi
Chris<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial","sans-serif"'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial","sans-serif"'>Thanks
for your reply.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial","sans-serif"'><o:p> </o:p></span></p>
<p class=MsoNormal>>The message() and file(REMOVE) commands will be executed
when you run CMake. <o:p></o:p></p>
<p class=MsoNormal>>The command to generate the .cpp file won't be executed
until you run make.<span style='font-size:10.5pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial","sans-serif"'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial","sans-serif"'>I
don’t think I have ‘got’ CMake yet. I am now definitely
confused!<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial","sans-serif"'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial","sans-serif"'>During
normal development, i.e. when the CMakeLists.txt files are complete, do I execute
CMake or make to build the app?<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial","sans-serif"'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial","sans-serif"'>If
the answer is ‘make’, what is the point of functions such as
message() and file() only working when I execute CMake?<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial","sans-serif"'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial","sans-serif"'>I
am struggling with the online CMake documentation. The API is well defined, but
there seems to be description of CMake concepts. Some more words would be
helpful!<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial","sans-serif"'><o:p> </o:p></span></p>
<p class=MsoNormal>> Wouldn't it make more sense to generate the source file
into the binary directory and just leave it there?<span style='font-size:10.5pt;
font-family:"Arial","sans-serif"'><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial","sans-serif"'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial","sans-serif"'>Yes,
that’s a good point. I will look at doing it that way. My only argument
against it is that I will have to configure svn to ignore that source file.<o:p></o:p></span></p>
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-size:10.5pt;font-family:"Arial","sans-serif"'>David <o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial","sans-serif"'><o:p> </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"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> ceej@lambda.nu [mailto:ceej@lambda.nu] <b>On
Behalf Of </b>Chris Hillery<br>
<b>Sent:</b> 17 September 2010 11:05<br>
<b>To:</b> David Aldrich<br>
<b>Cc:</b> cmake@cmake.org<br>
<b>Subject:</b> Re: [CMake] Execution order<o:p></o:p></span></p>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal style='margin-bottom:12.0pt'>The message() and file(REMOVE)
commands will be executed when you run CMake. The command to generate the .cpp
file won't be executed until you run make. That's why it's still around after
you're done.<br>
<br>
You can't really do exactly what you want here very easily; you'd need to have
a separate custom command to delete the file after the build is complete, and
I'm not sure how to set up the dependencies to automate that for you.<br>
<br>
Why do you want this? Wouldn't it make more sense to generate the source file
into the binary directory and just leave it there? Your add_custom_command()
and list(APPEND SRCS) steps below will do this if you just change the OUTPUT to
"${CMAKE_CURRENT_BINARY_DIR}/SourceFileInfo.cpp". This would have the
added benefit of not forcing a rebuild of SourceFileInfo.o every time you run
"make".<br>
<br>
Ceej<br>
aka Chris Hillery<o:p></o:p></p>
<div>
<p class=MsoNormal>On Fri, Sep 17, 2010 at 2:53 AM, David Aldrich <<a
href="mailto:David.Aldrich@eu.nec.com">David.Aldrich@eu.nec.com</a>> wrote:<o:p></o:p></p>
<div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Hi<o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'> <o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>I
want to generate a source file ‘SourceFileInfo.cpp’, then build a
library and then delete the generated file. <o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt'> </span><span
style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>So
I wrote:<o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt'> </span><span
style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><snip><o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt'> </span><span
style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>add_custom_command
(<o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>
OUTPUT SourceFileInfo.cpp<o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>
COMMAND ../VersionInfo/_gnuRelease/versionInfo . KERNEL<o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>
DEPENDS ${SRCS}<o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>
COMMENT "Generating SourceFileInfo.cpp"<o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>
VERBATIM)<o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'> <o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>list(APPEND
SRCS SourceFileInfo.cpp)<o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'> <o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>add_library(
Kernel STATIC ${SRCS} )<o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'> <o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>message("Removing
file")<o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>file(
REMOVE SourceFileInfo.cpp )<o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt'> </span><span
style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>But
the message ‘Removing file’ appears as the first action when
executing make and the file remains after make has finished. <o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt'> </span><span
style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>I
guess that one can’t interpret a CMakeLists.txt file sequentially, just
like you can’t interpret a makefile sequentially.<o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'> <o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>What
am I doing wrong?<o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'> <o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Where
can I find an explanation of CMake command ordering?<o:p></o:p></span></p>
</div>
<div style='margin-top:5.0pt;margin-bottom:5.0pt'>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Best
regards <o:p></o:p></span></p>
</div>
<div style='margin-top:5.0pt;margin-bottom:5.0pt'>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>David
<o:p></o:p></span></p>
</div>
<div style='margin-top:5.0pt;margin-bottom:5.0pt'>
<p class=MsoNormal><span style='font-size:10.0pt'> </span><span
style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p>
</div>
</div>
<p class=MsoNormal><br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a
href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a
href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><o:p></o:p></p>
</div>
<p class=MsoNormal style='margin-bottom:12.0pt'><br>
<br>
<span style='background:white'><o:p></o:p></span></p>
<p align=center style='text-align:center'><span style='background:white'>Click <a
href="https://www.mailcontrol.com/sr/ko0+lZXnTAXTndxI!oX7UnAXsNktwyv39r1GFf+ITgBAMWnAT6em9peNQt!hhhplKiXbDbOtE1J8TccP!XTbKg==">here</a>
to report this email as spam.<o:p></o:p></span></p>
</div>
</div>
</body>
</html>