[CMake] Documentation for find_package( COMPONENTS )

Mathieu Malaterre mathieu.malaterre at gmail.com
Tue Nov 17 08:22:31 EST 2009


Hi there,

  The documentation is pretty clear on how to generate and fill in
cmake variable to declare that package VERSION x.y was properly found:

...
       The version file checks whether it satisfies the requested version and
       sets these variables:

         PACKAGE_VERSION            = full provided version string
         PACKAGE_VERSION_EXACT      = true if version is exact match
         PACKAGE_VERSION_COMPATIBLE = true if version is compatible
         PACKAGE_VERSION_UNSUITABLE = true if unsuitable as any version
...

  What I did not find out is the documentation for components. Let say
I am the author of package BLA, which has two COMPONENTS: FOO and BAR.
When my package is configured+build+installed with only component FOO,
I'd like a call to

 find_package(BLA COMPONENTS BAR REQUIRED)

to fail. Which CMake variables should I fill in for that in my BLAConfig.cmake ?

Thanks,
-- 
Mathieu


More information about the CMake mailing list