The https://public.kitware.com/Bug/view.php?id=15231 feature request proposes a new feature to make find_package to attempt CONFIG mode first.
On 10/31/2014 01:30 PM, Brad King wrote: > I think the main challenge will be how to format error messages when > neither mode finds anything for a REQUIRED package. It took years to > get the current messages to a state that minimizes confusion among users > that do not understand the two modes. I think when neither mode finds anything it doesn't matter in which order they failed. We can pretend they failed in the usual module;config order. So the wordings of the messages may remain as they are. We should however think about what to do when CMAKE_FIND_PACKAGE_WARN_NO_MODULE is ON and both modes are enabled (and we're in CONFIG_FIRST mode). Should we check the missing find-module *after* we've found a config-module and print the warning? I think no, because the user has explicitly expressed the preference towards the CONFIG mode by specifying CONFIG_FIRST (either as a find_package option or as CMAKE_FIND_PACKAGE_CONFIG_FIRST). About the proposed change: The feature request proposes two ways to enable the CONFIG_FIRST mode: a new option for the find_package and a global variable (which I think should be called CMAKE_FIND_PACKAGE_CONFIG_FIRST). I think the find_package option is less important since the same effect can be achieved by creating a custom find_package_config_first() macro. To simulate the effect of the global variable is much more difficult and heavy-weight. Tamas -- 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-developers