Fixed, please review it again (patches are attached to #15756 <https://gitlab.kitware.com/cmake/cmake/issues/15756>) . Erase variable from cache is necessary, I think (see comment at gitlab). Ignoring of LUA_INCLUDE_DIR was my fault, fixed. For now I use this variable as a recommendation, i.e. if there is no lua.h with compatible version in this dir, search will be continue in another dirs and in case of success this variable will be changed.
Sorry for delay. 2016-05-09 16:32 GMT+03:00 Brad King <brad.k...@kitware.com>: > On 05/06/2016 09:02 AM, ivan Ivanov wrote: > > Fix for https://cmake.org/Bug/view.php?id=15756 > > Thanks for working on this. > > Please split the patch to first perform refactoring like moving > the version extraction into a helper function. Then the actual > logic change will be easier to see in the second commit. Also > please name helper functions as "_lua_...". We might as well > rename the set_lua_version_vars helper while we're at it. > > > + unset(LUA_INCLUDE_PREFIX CACHE) > > + find_path(LUA_INCLUDE_PREFIX ${subdir}/lua.h > > This renames the cache entry from LUA_INCLUDE_DIR to > LUA_INCLUDE_PREFIX and also stops re-using an already-found > or user-provided value. Neither of these follows CMake conventions. > I don't follow why this change is needed. Using version-specific > paths in a normal find_path(LUA_INCLUDE_DIR ...) should be enough. > > Thanks, > -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: http://public.kitware.com/mailman/listinfo/cmake-developers