[CMake] CMakeFindDependencyMacro and components

Guillaume Dumont dumont.guillaume at gmail.com
Thu Jul 23 11:39:54 EDT 2015


According to documentation:

http://www.cmake.org/cmake/help/v3.2/module/CMakeFindDependencyMacro.html

find_dependency() wraps a find_package()
<http://www.cmake.org/cmake/help/v3.2/command/find_package.html#command:find_package>
call for a package dependency. It is designed to be used in a
<package>Config.cmake file, and it forwards the correct parameters for
EXACT, QUIET and REQUIRED which were passed to the original find_package()
<http://www.cmake.org/cmake/help/v3.2/command/find_package.html#command:find_package>
call. It also sets an informative diagnostic message if the dependency
could not be found.

But there is no mention of COMPONENTS and other find_package arguments so I
guess I will have to resort to using find_package or a custom
CMakeFindDependencyMacro.

Guillaume

On Thu, Jul 23, 2015 at 11:24 AM, Daniel S. Reichenbach <
daniel at kogitoapp.com> wrote:

> Hi,
>
>  find_dependency(Boost COMPONENTS date_time filesystem system)
>>
>> Looking at the CMakeFindDependencyMacro code the COMPONENTS argument
>> does not seem to be supported.
>>
>> Is there a workaround for this situation?
>>
> What about using e.g.
>
> set(BOOST_ROOT $ENV{BOOST_ROOT})
> find_package(Boost 1.54 REQUIRED COMPONENTS filesystem program_options
> regex system thread)
>
> I'm using this in a few projects and it reliably detects Boost and the
> components on Mac OS X, Linux and Windows.
>
> WkR,
> Daniel
> --
> [kogito](http://kogitoapp.com)  -  nerds available for awesome projects
>
> kogito Anwendungsentwicklung                       brainz at kogitoapp.com
> c/o Daniel S. Reichenbach                       phone: +49 221 27096773
> Limburger Straße 19                            mobile: +49 160 96311159
> 50672 Köln, Germany
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>



-- 
Guillaume Dumont
=========================
dumont.guillaume at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150723/6666fde0/attachment.html>


More information about the CMake mailing list