Thanks for the info Philip. I would like to make this as close to the accepted convention as possible so that this might potentially get accepted into the CMake distribution if I ever decide to submit it. My scripts are fairly simple and untested on multiple operating systems and build systems. I do not have the means to test these scripts as extensively as I should. But then again, I'm not sure how the CMake developers test find modules.<div>
<br></div><div>I'm assuming that the macro in question will automatically mark all cache variables as advanced. Is this the case?</div><div><br></div><div>@Mike Jackson</div><div>Thank you for this info. I forgot about that function.</div>
<div><br></div><div>There seems to be an inconsistency in naming convention. For example, the set() function uses the term INTERNAL to represent a "hidden" cache variable. However, the function mark_as_advanced() is using the term "advanced". What I would like to see is one of the following pairs:</div>
<div><br></div><div>set( CACHE ADVANCED )</div><div>mark_as_advanced()</div><div><br></div><div> - OR -</div><div><br></div><div>set( CACHE INTERNAL )</div><div>mark_as_internal()</div><div><br></div><div>Does this make sense, or am I misunderstanding the difference between the two?<br>
<br><div class="gmail_quote">On Thu, Mar 26, 2009 at 8:18 PM, Philip Lowman <span dir="ltr"><<a href="mailto:philip@yhbt.com">philip@yhbt.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="gmail_quote"><div class="im">On Thu, Mar 26, 2009 at 6:52 PM, Robert Dailey <span dir="ltr"><<a href="mailto:rcdailey@gmail.com" target="_blank">rcdailey@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
First of all, I've created a find module called FindglFont2.cmake. Below are the contents:<div><br></div><div><div>find_path( glFont2_INCLUDE_DIRS glfont2.h )</div><div>find_library( glFont2_LIBRARIES NAMES glfont2 )</div>
<div><br></div><div>set( glFont2_FOUND FALSE )</div><div>if( glFont2_LIBRARIES AND glFont2_INCLUDE_DIRS )</div><div> set( glFont2_FOUND TRUE )</div><div>endif()</div></div></blockquote></div><div><br>Robert,<br><br>Just a minor suggestion... the second snippit of code above can be replaced with the following provided you're using CMake 2.6.0 or later. This will also handle some of the options to find_package() like QUIET and REQUIRED.<br>
<br>include(FindPackageHandleStandardArgs)<br>FIND_PACKAGE_HANDLE_STANDARD_ARGS(glFont2 DEFAULT_MSG glFont2_INCLUDE_DIRS glFont2_LIBRARIES)<br><br>Also, convention is to use the singular form for xxx_INCLUDE_DIR and xxx_LIBRARY when using find_path() and find_library() and then manually set the plural variables xxx_INCLUDE_DIRS and xxx_LIBRARIES. This makes more sense when the user is editing the cache and also allows the find module to grow in a backwards compatible manor if the library is ever refactored into two separate libraries in a later release.<br>
<br></div></div>-- <br><font color="#888888">Philip Lowman<br>
</font></blockquote></div><br></div>