<div dir="ltr"><div>Hi,</div><div><br></div><div>I was thinking about the best way to handle plugin building during further refactoring of the CMake scripts. Right now, some stuff is built implicitly depending on whether certain libraries are found or not (see addons/CMakeLists.txt). I was wondering if this shouldn't be made explicit instead, with each plugin either being turned on/off explicitly in the CMake script which determines whether it gets built or not.</div><div><br></div><div>Making building of plugins explicit prevents hard to trace builds where a default build succeeds on two machines but may differ in features from one machine to another depending on what other libraries are installed. <br></div><div><br></div><div>To achieve this, I could add an optional second parameter to `ecm_add_optional_subdirectory` which takes ON/OFF as its value (just like CMake's `option` command) and initializes the default value of  `ecm_add_optional_subdirectory`'s `BUILD_<span class="gmail-pl-smi">${_dir}` to that value. The optional value would default to `ON` if not provided to keep backwards compatibility.<br></span></div><div><span class="gmail-pl-smi"><br></span></div><div><span class="gmail-pl-smi">Most plugins would be enabled by default so as  to not change anything substantial for users but some plugins with more exotic dependencies might be disabled by default instead.</span></div><div><span class="gmail-pl-smi"><br></span></div><div><span class="gmail-pl-smi">Any thoughts?<br></span></div><div><span class="gmail-pl-smi"><br></span></div><div><span class="gmail-pl-smi">Regards,</span></div><div><span class="gmail-pl-smi"><br></span></div><div><span class="gmail-pl-smi">Daan<br></span></div></div>