<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:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:odc="urn:schemas-microsoft-com:office:odc" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rtc="http://microsoft.com/officenet/conferencing" xmlns:D="DAV:" xmlns:Repl="http://schemas.microsoft.com/repl/" xmlns:mt="http://schemas.microsoft.com/sharepoint/soap/meetings/" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ppda="http://www.passport.com/NameSpace.xsd" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sub="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" xmlns:ec="http://www.w3.org/2001/04/xmlenc#" xmlns:sp="http://schemas.microsoft.com/sharepoint/" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udcs="http://schemas.microsoft.com/data/udc/soap" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:udcp2p="http://schemas.microsoft.com/data/udc/parttopart" xmlns:wf="http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:dsss="http://schemas.microsoft.com/office/2006/digsig-setup" xmlns:dssi="http://schemas.microsoft.com/office/2006/digsig" xmlns:mdssi="http://schemas.openxmlformats.org/package/2006/digital-signature" xmlns:mver="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:mrels="http://schemas.openxmlformats.org/package/2006/relationships" xmlns:spwp="http://microsoft.com/sharepoint/webpartpages" xmlns:ex12t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ex12m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:pptsl="http://schemas.microsoft.com/sharepoint/soap/SlideLibrary/" xmlns:spsl="http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService" xmlns:Z="urn:schemas-microsoft-com:" xmlns:st="" 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;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        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: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>I was just noticing that the find_package command documentation talks about how, in “Config” mode, the PACKAGE_FIND_* variables are defined for use by the “<config-file>-version.cmake” or “<config-file>Version.cmake” scripts for libraries. It further mentions that when find_package is used in “Module” mode that the “Find<package>.cmake” script is responsible for verifying the version. However, it doesn’t seem to document that the version variables are defined for “Module” mode as <package>_FIND_*, e.g. PACKAGE_FIND_VERSION for a package name FooBar would be passed to the FindFooBar.cmake as FooBar_FIND_VERSION, and so on.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>(I have not dealt with “Config” mode for find_package, so perhaps I’m mistaken about the naming there.)<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Anyway, I think the documentation should be updated to reflect those variables, and I’d be happy to do that, so long as I am not missing this being documented elsewhere.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Am I correct in this point? For that matter, can someone tell me if in the above example the “FooBar-version.cmake” would be passed PACKAGE_FIND_VERSION and set PACKAGE_VERSION or would it be passed FooBar_FIND_VERSION and set FooBar_VERSION?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Reference: <a href="http://cmake.org/cmake/help/cmake-2-8-docs.html#command:find_package">http://cmake.org/cmake/help/cmake-2-8-docs.html#command:find_package</a><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Incidentally, this appears to be slightly different than the XXX_VERSION_STRING being set by Modules, documented in the Modules/readme.txt (Reference: <a href="http://cmake.org/gitweb?p=cmake.git;a=blob;f=Modules/readme.txt">http://cmake.org/gitweb?p=cmake.git;a=blob;f=Modules/readme.txt</a>). <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>-----------------------------8<-----------------------------------------------------------------------------<o:p></o:p></p><p class=MsoNormal>On a side note, it might be nice to update that document to use the same <package> naming convention (possibly as <module>) as the main documentation does, like:<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'>For more information about how to contribute modules to CMake, see this page:<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'>http://www.itk.org/Wiki/CMake:Module_Maintainers<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'>Note to authors of Find<module>.cmake files<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'>We would like all Find<module>.cmake files to produce consistent variable names.<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'>Please use the following consistent variable names for general use.<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'><module>_INCLUDE_DIRS The final set of include directories listed in one variable for use by client code. This should not be a cache entry.<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'><module>_LIBRARIES The libraries to link against to use <module>. These should include full paths. This should not be a cache entry.<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'><module>_DEFINITIONS Definitions to use when compiling code that uses <module>. This really shouldn't include options such as (-DHAS_JPEG)that a client source-code file uses to decide whether to #include <jpeg.h><o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'><module>_EXECUTABLE Where to find the <module> tool.<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'><module>_<tool>_EXECUTABLE Where to find the <tool> tool that comes with <module>.<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'><module>_LIBRARY_DIRS Optionally, the final set of library directories listed in one variable for use by client code. This should not be a cache entry.<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'><module>_ROOT_DIR Where to find the base directory of <module>.<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'><module>_VERSION_<version> Expect Version <version> if true. Make sure at most one of these is ever true.<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'><module>_WRAP_<command> If False, do not try to use the relevent CMake wrapping command.<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'><module>_<sub part>_FOUND If False, optional <sub part> of <module> system is not available.<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'><module>_FOUND Set to false, or undefined, if we haven't found, or don't want to use <module>.<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'><module>_RUNTIME_LIBRARY_DIRS Optionally, the runtime library search path for use when running an executable linked to shared libraries.<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'> The list should be used by user code to create the PATH on windows or LD_LIBRARY_PATH on unix.<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'> This should not be a cache entry.<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'><module>_VERSION_STRING A human-readable string containing the version of the package found, if any.<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'><module>_VERSION_MAJOR The major version of the package found, if any.<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'><module>_VERSION_MINOR The minor version of the package found, if any.<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'><module>_VERSION_PATCH The patch version of the package found, if any.<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'>You do not have to provide all of the above variables. You should provide <module>_FOUND under most circumstances. If <module> is a library, then <module>_LIBRARIES, should also be defined, and <module>_INCLUDE_DIRS should usually be defined (I guess libm.a might be an exception)<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'>The following names should not usually be used in CMakeLists.txt files, but they may be usefully modified in users' CMake Caches to control stuff.<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'><module>_LIBRARY Name of <module> Library. A User may set this and <module>_INCLUDE_DIR to ignore to force non-use of <module>.<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'><module>_<sub_lib>_LIBRARY Name of <sub_lib> library that is part of the <module> system. It may or may not be required to use <module>.<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'><module>_INCLUDE_DIR Where to find xxx.h, etc. (<module>_INCLUDE_PATH was considered bad because a path includes an actual filename.)<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:9.0pt;font-family:Consolas'><module>_<part>_INCLUDE_DIR Where to find xxx_<part>.h, etc.<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div style='border:none;border-top:dotted silver 1.0pt;padding:4.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:#666666'>Aaron Meadows</span></b><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:#666666'><br>Software Engineer<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:0in'><b><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:#F57F20'>Thomson Reuters<o:p></o:p></span></b></p></div><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:#666666'>Phone: 314.468.3530<br>Mobile: 636.541.6139<br>aaron.meadows@thomsonreuters.com<br>thomsonreuters.com</span><o:p></o:p></p></div></body></html>