[cmake-developers] EXCLUDE_FROM_ALL behavior change

Charles Huet charles.huet at gmail.com
Tue Sep 24 08:12:14 EDT 2019


Hi,

in CMake 3.14 the EXCLUDE_FROM_ALL option of add_subdirectory had a
behavior change.
Here is the MR: https://gitlab.kitware.com/cmake/cmake/merge_requests/2816,
implementing the requirement from this ticket:
https://gitlab.kitware.com/cmake/cmake/issues/17149.

We are negatively impacted by this change, as we are in the same exact
scenario as this user:
https://cmake.org/pipermail/cmake/2019-September/069978.html

Except we used this behavior to have separate VS solutions for our unit
tests and demos.

Our hierarchy looks something like this:
|- MainLibrary
|- Extension1
|- Extension2
|- UnitTests
  | - [lots of tests]
|- Demos
  | - [lots of demos]

This had the very nice result of having a root solution containing all of
our libraries and extensions, another solution in the UnitTests folder, and
another in the Demos folder (and likewise on linux, we could build with
'ninja UnitTests/all').

The new behavior leads to the inability to build all our tests/demos in one
fell swoop, and removing the EXCLUDE_FROM_ALL directive would result in a
VS solution way too large for daily use.

This currently is blocking us to upgrade to CMake > 3.13, which prevents us
from using VS 2019.

I know this change occurred about two years ago, so changing the behavior
the other way is not a good way forward, and do not know enough to find out
by myself how the previous behavior can be re-introduced.

I would like advice on how to re-introduce the previous behavior without
perturbing the new one, e.g. a way to set EXCLUDE_FROM_ALL to FALSE on all
the targets of a folder that is itself excluded from the ALL target.

Thanks for your help.

-- 
 - Always keep in mind that you may be wrong -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake-developers/attachments/20190924/cf9bba8a/attachment.html>


More information about the cmake-developers mailing list