[CMake] How can I automatically optionally build a submodule?

Simon Richter Simon.Richter at hogyros.de
Tue Mar 12 09:59:25 EDT 2019


Hi,

On 12.03.19 06:37, Steve Keller wrote:

> How can I build a module in a subdirectory automatically if a required
> package is available, but not fail if it's not. Say I have a
> top-level CMakeLists.txt with

With my Debian Developer hat on: please also add a mechanism to manually
specify whether the optional component should be built. If the
dependency changes and suddenly a component goes missing without
triggering a build failure, that can be rather annoying for users.

Without a package system, this also means that old files may stick
around after installation, so your program should be aware that
installed plugins could be built against an older API and weren't
updated during the last install run.

   Simon

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://cmake.org/pipermail/cmake/attachments/20190312/7b5a143e/attachment-0001.sig>


More information about the CMake mailing list