include_regular_expression() does not propagate to subdirectories
As a work-around for a bug reported 4 years ago (which was ignored), our CMakeList.txt contains the following:
# Cmake does not allow one to ignore includes inside the <> brackets
# (see http://www.cmake.org/Bug/view.php?id=14648), but as all
# our project-specific includes end with '.h', and from the vendor
# directory only the tut includes use '.hpp' extension, we can restrict
# cmake's dependency scanner to only those files (and exclude the majority
# of boost includes and STL headers).
include_regular_expression("(\\.h$)|(^tut/)")
This works perfectly fine with old versions of cmake (up to 3.3). However while trying to switch to the latest version (3.10) of cmake I noted that this does not work at all - the depend.cmake are bloated with boost includes, e.g.:
[stripped].cpp.o: /opt/include/boost/include/boost/algorithm/string/classification.hpp
[stripped].cpp.o: /opt/include/boost/include/boost/algorithm/string/compare.hpp
[stripped].cpp.o: /opt/include/boost/include/boost/algorithm/string/concept.hpp
[stripped].cpp.o: /opt/include/boost/include/boost/algorithm/string/config.hpp
and so on...
git bisect shows this was broken in this commit:
commit 4efda261fead9f677144ffc6bc2b612a1d1dbcb6
Author: Stephen Kelly <steveire@gmail.com>
Date: Sat Apr 4 19:21:56 2015 +0200
cmMakefile: Remove special handling of INCLUDE_REGULAR_EXPRESSION.
It costs an extra cmMakefile member and extra code to maintain in
directory property handling. Remove documentation note that it
is read-only and specify high-level command to populate it.
Edited by Brad King