[CMake] Printing "Found <package>..." message in config mode

Sebastián Mancilla smancill at jlab.org
Thu Aug 16 14:48:37 EDT 2018


Thanks, Cyril

I did try find_package_handle_standard_args but it failed. It didn't occur
to me that I needed to set <package_CONFIG before.

Now it is much better.

El jue., 16 de ago. de 2018 a la(s) 09:24, Cyril Boucher (
cyril.boucher94260 at gmail.com) escribió:

> Hi Sebastiàn,
>
> Your question got me thinking and I also figured that way of doing it
> works:
>
> set(<package>_CONFIG ${CMAKE_CURRENT_LIST_FILE})
> find_package_handle_standard_args(<package> CONFIG_MODE)
>
> This allows you to keep most of the nice logic inside
> FindPackageHandleStandardArgs.
>
> Best regards,
> Cyril
>
> 2018-08-15 22:13 GMT+02:00 Sebastián Mancilla <smancill at jlab.org>:
>
>> Ah, I see that FIND_PACKAGE_HANDLE_STANDARD_ARGS prints
>>
>>    -- Find Foo: <path to FooConfig.cmake> (found version "<version>")
>>
>> I guess my function is not necessary, I can just put inside
>> FooConfig.cmake
>>
>>     find_package_message(Foo
>>       "Found Foo: ${CMAKE_CURRENT_LIST_FILE} (found version
>> \"@PACKAGE_VERSION@\")"
>>       "[${CMAKE_CURRENT_LIST_FILE}][@PACKAGE_VERSION@]")
>>
>>
>> El mar., 14 de ago. de 2018 a la(s) 19:36, Hendrik Sattler (
>> post at hendrik-sattler.de) escribió:
>>
>>>
>>>
>>> Am 14. August 2018 22:08:36 MESZ schrieb "Sebastián Mancilla" <
>>> smancill at jlab.org>:
>>> >Normally, find modules call FIND_PACKAGE_HANDLE_STANDARD_ARGS, which in
>>> >turn calls FIND_PACKAGE_MESSAGE, to print a nice message about the
>>> >location
>>> >and version of the dependency.
>>>
>>> You can do that with FIND_PACKAGE_HANDLE_STANDARD_ARGS, just use module
>>> name and CONFIG_MODE as arguments.
>>>
>>> HS
>>> --
>>>
>>> Powered by www.kitware.com
>>> <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.kitware.com&d=DwMFaQ&c=lz9TcOasaINaaC3U7FbMev2lsutwpI4--09aP8Lu18s&r=8hmSv9ww5s9qu3iT8h5WMi8-YcKXaJvelxT3fMih7S4&m=kUFvtJfJYSaKOycRuDd7Jlb2EeJcX38J2oKfx3DdrVw&s=phETEp6GuEap1tbRAb9bSduQrhEpdgeHQyC_5IzSJ3k&e=>
>>>
>>> Please keep messages on-topic and check the CMake FAQ at:
>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.cmake.org_Wiki_CMake-5FFAQ&d=DwIGaQ&c=lz9TcOasaINaaC3U7FbMev2lsutwpI4--09aP8Lu18s&r=8hmSv9ww5s9qu3iT8h5WMi8-YcKXaJvelxT3fMih7S4&m=vNaw4PX_cjIs-mDa1mqBspuYYh8zccYAIC84tyoB0oA&s=RJEEiZ1k-XIjXM_90_6kyZ5FMVIYsSAiyQRThYB3iJ8&e=
>>>
>>> Kitware offers various services to support the CMake community. For more
>>> information on each offering, please visit:
>>>
>>> CMake Support:
>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__cmake.org_cmake_help_support.html&d=DwIGaQ&c=lz9TcOasaINaaC3U7FbMev2lsutwpI4--09aP8Lu18s&r=8hmSv9ww5s9qu3iT8h5WMi8-YcKXaJvelxT3fMih7S4&m=vNaw4PX_cjIs-mDa1mqBspuYYh8zccYAIC84tyoB0oA&s=LqUR8QOw8X5ya0FRtvJ3J9e40LyNK-gydGXOeaM80Ps&e=
>>> CMake Consulting:
>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__cmake.org_cmake_help_consulting.html&d=DwIGaQ&c=lz9TcOasaINaaC3U7FbMev2lsutwpI4--09aP8Lu18s&r=8hmSv9ww5s9qu3iT8h5WMi8-YcKXaJvelxT3fMih7S4&m=vNaw4PX_cjIs-mDa1mqBspuYYh8zccYAIC84tyoB0oA&s=N5TtfB9fCMuIe6ZcnAzVHEk5w4MnGzNdZ8hI-zyiU5Y&e=
>>> CMake Training Courses:
>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__cmake.org_cmake_help_training.html&d=DwIGaQ&c=lz9TcOasaINaaC3U7FbMev2lsutwpI4--09aP8Lu18s&r=8hmSv9ww5s9qu3iT8h5WMi8-YcKXaJvelxT3fMih7S4&m=vNaw4PX_cjIs-mDa1mqBspuYYh8zccYAIC84tyoB0oA&s=aBTzKuF0iyTKifZQ6madT0vT189WJsgYDDf8jDL_JxI&e=
>>>
>>> Visit other Kitware open-source projects at
>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.kitware.com_opensource_opensource.html&d=DwIGaQ&c=lz9TcOasaINaaC3U7FbMev2lsutwpI4--09aP8Lu18s&r=8hmSv9ww5s9qu3iT8h5WMi8-YcKXaJvelxT3fMih7S4&m=vNaw4PX_cjIs-mDa1mqBspuYYh8zccYAIC84tyoB0oA&s=Wu5CbQmwVaf6uE5Dp9OK_EASEZ6WS16W0hVEXN_3BAo&e=
>>>
>>> Follow this link to subscribe/unsubscribe:
>>>
>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__cmake.org_mailman_listinfo_cmake&d=DwIGaQ&c=lz9TcOasaINaaC3U7FbMev2lsutwpI4--09aP8Lu18s&r=8hmSv9ww5s9qu3iT8h5WMi8-YcKXaJvelxT3fMih7S4&m=vNaw4PX_cjIs-mDa1mqBspuYYh8zccYAIC84tyoB0oA&s=QViykHUMgtj8XqForeqtw7j16bUM3hAp3JTzSse90b8&e=
>>>
>>
>>
>> --
>> Sebastian Mancilla Matta
>> CCTVal, UTFSM
>> Valparaíso, Chile
>>
>> --
>>
>> Powered by www.kitware.com
>> <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.kitware.com&d=DwMFaQ&c=lz9TcOasaINaaC3U7FbMev2lsutwpI4--09aP8Lu18s&r=8hmSv9ww5s9qu3iT8h5WMi8-YcKXaJvelxT3fMih7S4&m=kUFvtJfJYSaKOycRuDd7Jlb2EeJcX38J2oKfx3DdrVw&s=phETEp6GuEap1tbRAb9bSduQrhEpdgeHQyC_5IzSJ3k&e=>
>>
>> Please keep messages on-topic and check the CMake FAQ at:
>> http://www.cmake.org/Wiki/CMake_FAQ
>> <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.cmake.org_Wiki_CMake-5FFAQ&d=DwMFaQ&c=lz9TcOasaINaaC3U7FbMev2lsutwpI4--09aP8Lu18s&r=8hmSv9ww5s9qu3iT8h5WMi8-YcKXaJvelxT3fMih7S4&m=kUFvtJfJYSaKOycRuDd7Jlb2EeJcX38J2oKfx3DdrVw&s=H3T2l5bnM_hkcutx9EhoMYQ7u5sZ6crXyJVPqFdGK4Y&e=>
>>
>> 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
>> <https://urldefense.proofpoint.com/v2/url?u=http-3A__cmake.org_cmake_help_support.html&d=DwMFaQ&c=lz9TcOasaINaaC3U7FbMev2lsutwpI4--09aP8Lu18s&r=8hmSv9ww5s9qu3iT8h5WMi8-YcKXaJvelxT3fMih7S4&m=kUFvtJfJYSaKOycRuDd7Jlb2EeJcX38J2oKfx3DdrVw&s=zwpFrBiEjfR7tUSgMW4TkgfIRoFpxaeNyyL8s16dMog&e=>
>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> <https://urldefense.proofpoint.com/v2/url?u=http-3A__cmake.org_cmake_help_consulting.html&d=DwMFaQ&c=lz9TcOasaINaaC3U7FbMev2lsutwpI4--09aP8Lu18s&r=8hmSv9ww5s9qu3iT8h5WMi8-YcKXaJvelxT3fMih7S4&m=kUFvtJfJYSaKOycRuDd7Jlb2EeJcX38J2oKfx3DdrVw&s=mwkHdq7RmuniRx_jjK9zRWBw4DDyjeClsgTAUVPIZeQ&e=>
>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>> <https://urldefense.proofpoint.com/v2/url?u=http-3A__cmake.org_cmake_help_training.html&d=DwMFaQ&c=lz9TcOasaINaaC3U7FbMev2lsutwpI4--09aP8Lu18s&r=8hmSv9ww5s9qu3iT8h5WMi8-YcKXaJvelxT3fMih7S4&m=kUFvtJfJYSaKOycRuDd7Jlb2EeJcX38J2oKfx3DdrVw&s=jZkM0UUXLX67asxN3i1OARsPm2m_2evYMVyOOjPfVZo&e=>
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>> <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.kitware.com_opensource_opensource.html&d=DwMFaQ&c=lz9TcOasaINaaC3U7FbMev2lsutwpI4--09aP8Lu18s&r=8hmSv9ww5s9qu3iT8h5WMi8-YcKXaJvelxT3fMih7S4&m=kUFvtJfJYSaKOycRuDd7Jlb2EeJcX38J2oKfx3DdrVw&s=kON9K8r17vpuikT7ovaFvNEY3gCgHiGWOw-4j5muzjo&e=>
>>
>> Follow this link to subscribe/unsubscribe:
>> https://cmake.org/mailman/listinfo/cmake
>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__cmake.org_mailman_listinfo_cmake&d=DwMFaQ&c=lz9TcOasaINaaC3U7FbMev2lsutwpI4--09aP8Lu18s&r=8hmSv9ww5s9qu3iT8h5WMi8-YcKXaJvelxT3fMih7S4&m=kUFvtJfJYSaKOycRuDd7Jlb2EeJcX38J2oKfx3DdrVw&s=wcLntce93Bzhp7583x4IZorEkbev8foF9n9C-cpQXOM&e=>
>>
>>
>

-- 
Sebastian Mancilla Matta
CCTVal, UTFSM
Valparaíso, Chile
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180816/33d65108/attachment-0001.html>


More information about the CMake mailing list