<div dir="ltr">Thanks, Cyril<div><br></div><div>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.</div><div><br></div><div>Now it is much better.</div></div><br><div class="gmail_quote"><div dir="ltr">El jue., 16 de ago. de 2018 a la(s) 09:24, Cyril Boucher (<a href="mailto:cyril.boucher94260@gmail.com">cyril.boucher94260@gmail.com</a>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Sebastiàn,<br><br>Your question got me thinking and I also figured that way of doing it works:<br><br>set(<package>_CONFIG ${CMAKE_CURRENT_LIST_FILE})<div>find_package_handle_standard_args(<package> CONFIG_MODE)<br><br>This allows you to keep most of the nice logic inside FindPackageHandleStandardArgs.<br><br>Best regards,<br>Cyril</div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-08-15 22:13 GMT+02:00 Sebastián Mancilla <span dir="ltr"><<a href="mailto:smancill@jlab.org" target="_blank">smancill@jlab.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Ah, I see that FIND_PACKAGE_HANDLE_STANDARD_ARGS prints<div><br></div><div> -- Find Foo: <path to FooConfig.cmake> (found version "<version>")</div><div><br></div><div>I guess my function is not necessary, I can just put inside FooConfig.cmake</div><div><br></div><div><div> find_package_message(Foo</div><div> "Found Foo: ${CMAKE_CURRENT_LIST_FILE} (found version \"@PACKAGE_VERSION@\")"</div><div> "[${CMAKE_CURRENT_LIST_FILE}][@PACKAGE_VERSION@]")</div></div><div><br></div></div><br><div class="gmail_quote"><span><div dir="ltr">El mar., 14 de ago. de 2018 a la(s) 19:36, Hendrik Sattler (<a href="mailto:post@hendrik-sattler.de" target="_blank">post@hendrik-sattler.de</a>) escribió:<br></div></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span><br>
<br>
Am 14. August 2018 22:08:36 MESZ schrieb "Sebastián Mancilla" <<a href="mailto:smancill@jlab.org" target="_blank">smancill@jlab.org</a>>:<br>
>Normally, find modules call FIND_PACKAGE_HANDLE_STANDARD_ARGS, which in<br>
>turn calls FIND_PACKAGE_MESSAGE, to print a nice message about the<br>
>location<br>
>and version of the dependency.<br>
<br>
You can do that with FIND_PACKAGE_HANDLE_STANDARD_ARGS, just use module name and CONFIG_MODE as arguments.<br>
<br>
HS<br>
-- <br>
<br>
Powered by <a href="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=" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br></span>
Please keep messages on-topic and check the CMake FAQ at: <a href="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=" rel="noreferrer" target="_blank">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=</a> <br><span>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br></span>
CMake Support: <a href="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=" rel="noreferrer" target="_blank">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=</a> <br>
CMake Consulting: <a href="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=" rel="noreferrer" target="_blank">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=</a> <br>
CMake Training Courses: <a href="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=" rel="noreferrer" target="_blank">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=</a> <br>
<br>
Visit other Kitware open-source projects at <a href="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=" rel="noreferrer" target="_blank">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=</a> <br><span>
<br>
Follow this link to subscribe/unsubscribe:<br>
</span><a href="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=" rel="noreferrer" target="_blank">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=</a> <br><span class="m_1152050524009853296HOEnZb"><font color="#888888">
</font></span></blockquote></div><span class="m_1152050524009853296HOEnZb"><font color="#888888"><br clear="all"><div><br></div>-- <br><div dir="ltr" class="m_1152050524009853296m_2969865385420739406gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div style="font-size:small;font-family:arial">Sebastian Mancilla Matta</div><div style="font-size:small;font-family:arial">CCTVal, UTFSM</div><div style="font-size:small;font-family:arial">Valparaíso, Chile</div></div></div>
</font></span><br>-- <br>
<br>
Powered by <a href="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=" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="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=" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="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=" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="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=" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="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=" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="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=" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="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=" rel="noreferrer" target="_blank">https://cmake.org/mailman/listinfo/cmake</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div style="font-size:small;font-family:arial">Sebastian Mancilla Matta</div><div style="font-size:small;font-family:arial">CCTVal, UTFSM</div><div style="font-size:small;font-family:arial">Valparaíso, Chile</div></div></div>