[CMake] Find package with version numbers

Robert Dailey rcdailey at gmail.com
Wed Dec 14 18:59:05 EST 2011


I figured that, but that is one hell of a scary find module... I tend to
stay away from it :)

Thanks guys.

---------
Robert Dailey


On Wed, Dec 14, 2011 at 5:33 PM, Tim Gallagher <tim.gallagher at gatech.edu>wrote:

> Boost takes arguments for versions of the library if you need a concrete
> example.
>
> Tim
>
> ----- Original Message -----
> From: "Alexander Neundorf" <a.neundorf-work at gmx.net>
> To: cmake at cmake.org
> Sent: Wednesday, December 14, 2011 5:11:45 PM
> Subject: Re: [CMake] Find package with version numbers
>
> On Wednesday 14 December 2011, Robert Dailey wrote:
> > Is there any example of how to write a find module for find_package()
> that
> > utilizes version numbers? How is the version number passed into the
> > Find*.cmake module? The documentation on this is very confusing and
> > discusses creating a version.cmake file. I looked in the CMake modules
> > directory for an example but there are no version files...
> >
> > I'm creating a find module for the Microsoft Platform SDK:
> > FindMSPlatformSDK.cmake. I need to be able to call it like so:
> >
> > find_package( MSPlatformSDK 7.0 )
>
> See the readme file in the cmake modules directory.
>
> In the Find-module, you have access to
> <name_of_the_package>_FIND_VERSION_(MAJOR|MINOR|PATCH) etc. variables which
> you can check.
>
> If you determine the version of the found package, you can then simply put
> the
> found version number into a variable, and use the new-style
> find_package_handle_standard_args(... VERSION_VAR ...) macro to evaluate
> it,
> it will fail if it is not good.
>
> For creating a FooConfigVersion.cmake file (when installing your own
> library),
> you may use the WriteBasicConfigVersionFile.cmake (since cmake 2.8.6) which
> writes a basic version file for you, which you can install along with your
> library.
>
> Alex
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111214/1e832ba9/attachment.htm>


More information about the CMake mailing list