I quite frequently build third-party CMake-based packages, and many of them do not provide options to skip building some parts that are (in fact) optional or not required at all for my purposes (like tests, sometimes building tests take even longer time than the main binaries).
It’ll be nice to have a CMake variable to force-ignore specified directories and do not perform
add_subdirectory(). E.g., for the project without the
BUILD_TESTING “standard” option and having unconditional
add_subdirectory(tests), I’d be happy to configure them like
$ cmake -DCMAKE_FORCE_IGNORE_SUBDIRS=tests ...
Also, I guess, lovers of the
ExternalProject module may like this feature to ignore unneeded build subdirectories