Instead of setting the EXCLUDE_FROM_ALL target property, pass EXCLUDE_FROM_ALL to add_subdirectory()
.
This has the following advanteges:
- It is shorter (obviously).
- Target properties are set only in the
CMakeLists.txt
file that defines the target. - Install rules defined in the subdirectory are excluded as well. This is what we want, because secp256k1 is linked statically.