<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 14 (filtered medium)"><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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        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;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
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-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-family:"Calibri","sans-serif";color:#1F497D'>Thanks, Petr. This sounds like what we need, but I must be missing something.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Calibri","sans-serif";color:#1F497D'>I have:<o:p></o:p></span></p><p class=MsoNormal><b><span style='font-family:"Courier New";color:black'>SET( ZFPE_FILES<o:p></o:p></span></b></p><p class=MsoNormal><b><span style='font-family:"Courier New";color:black'>    FOO.asm<o:p></o:p></span></b></p><p class=MsoNormal><b><span style='font-family:"Courier New";color:black'>)<o:p></o:p></span></b></p><p class=MsoNormal><span style='font-family:"Calibri","sans-serif";color:#1F497D'>(and of course many more files in that variable). Then later:<o:p></o:p></span></p><p class=MsoNormal><b><span style='font-family:"Courier New";color:black'>add_library(zfpe ${ZFPE_FILES})<o:p></o:p></span></b></p><p class=MsoNormal><b><span style='font-family:"Courier New";color:black'>set_property(SOURCE FOO.asm PROPERTY OBJECT_DEPENDS BAR.mac)<o:p></o:p></span></b></p><p class=MsoNormal><span style='font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Calibri","sans-serif";color:#1F497D'>(all files have explicit paths on them). When I do a cmake, it builds the world. Then I change BAR.mac and do a cmake and a make and it doesn’t reassemble FOO.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Calibri","sans-serif";color:#1F497D'>This is all complicated somewhat by the additional plumbing I have wrapped around it (we’re cross-compiling with a two-phase compiler, and so there’s some other stuff in there), but the cmake and make are both definitely being invoked.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Calibri","sans-serif";color:#1F497D'>One (of many) things I’m not understanding is where the check for changes to BAR takes place. I notice that BAR does not appear in the MakeFile at all.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Calibri","sans-serif";color:#1F497D'>I tried adding a few MESSAGEs and it’s doing the </span><b><span style='font-family:"Courier New";color:black'>set_property</span></b><span style='font-family:"Calibri","sans-serif";color:#1F497D'> as expected (i.e., that code didn’t somehow get bypassed).<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Petr Kmoch [mailto:petr.kmoch@gmail.com] <br><b>Sent:</b> Wednesday, February 05, 2014 3:08 AM<br><b>To:</b> Phil Smith<br><b>Cc:</b> cmake@cmake.org<br><b>Subject:</b> Re: [CMake] Dependencies<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><div><div><div><div><p class=MsoNormal style='margin-bottom:12.0pt'>Hi Phil.<br><br>If your FOO.asm is used as a source file (i.e. it's listed in an add_executable() or add_library() command), then you can use the source file property OBJECT_DEPENDS for that:<o:p></o:p></p></div><p class=MsoNormal style='margin-bottom:12.0pt'>  add_executable(myexe FOO.asm other.file one.more)<o:p></o:p></p></div><p class=MsoNormal style='margin-bottom:12.0pt'>  set_property(SOURCE FOO.asm PROPERTY OBJECT_DEPENDS BAR.mac BAZ.mac) #any list of dependencies here<o:p></o:p></p></div><div><p class=MsoNormal>As an alternative to set_property(), you can use the weaker, but shorthand setter set_source_files_properties() (which can set it for multiple files at once).<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal style='margin-bottom:12.0pt'>If they're somehow processed with a custom command/target (i.e. via add_custom_command() or add_custom_target() instead of library/executable), you can use that command's DEPENDS argument.<o:p></o:p></p></div><p class=MsoNormal>Petr<o:p></o:p></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></p><div><p class=MsoNormal>On Tue, Feb 4, 2014 at 7:57 PM, Phil Smith <<a href="mailto:phil@voltage.com" target="_blank">phil@voltage.com</a>> wrote:<o:p></o:p></p><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>This is surely something basic, but I’m far from a CMake guru and would rather not spend weeks digging to solve something that *<b>seems</b>* like it’ll be simple.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>We have assembler modules in a project. These use macros, as assembler modules are wont to do.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>So if module FOO.asm uses macro BAR.mac, and we change BAR, a CMake should rebuild FOO. We recognize that we’re going to have to define these dependencies manually, but I’m assuming/hoping that there’s a way to do that in a CMakeLists.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>Unfortunately words like “dependency” make lousy search terms!</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>Can someone point me? Or, even better, give me an example of how to say “FOO.asm depends on macro BAR.mac”?</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>Thanks…</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>-- </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>...phsiii</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F497D'>Phil Smith III</span><o:p></o:p></p></div></div><p class=MsoNormal><br>--<br><br>Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</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>Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br><br>CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/support.html</a><br>CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/training.html</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>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><o:p> </o:p></p></div></div></body></html>