On 10/04/2018 02:36 PM, Joachim Wuttke wrote: > What then about user code that ought to check > for version compatibility? Module mode only offers a check > for an EXACT version string, and does not terminate if > that condition is not met [3].
Module mode is only selected if there is a Find<PakcageName>.cmake file available. Otherwise Config mode is used anyway. For a given project's call only one of the modes can be used: the find module is either present or it is not. If the find module is available it is used and becomes responsible for enforcing the version check. Many of CMake's upstream find modules now support that. > Users who need a newer-than > or same-major version check, or a strict enforcment of an > exact-version check, are advised to prefer packages that use > CMakePackageConfigHelpers to generate FooConfig[Version].cmake > files. These files, however, are ignored unless Config mode > is chosen. In module mode it is up to the find module to do the appropriate version comparisons. The FindPackageHandleStandardArgs module: https://cmake.org/cmake/help/v3.13/module/FindPackageHandleStandardArgs.html provides some help with that. If it doesn't offer the kind of version comparison needed then it could be added as an option or the find module could do its own version checking. -Brad -- 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: https://cmake.org/mailman/listinfo/cmake