<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2018-05-16 9:33 GMT+02:00 Drago Trusk <span dir="ltr"><<a href="mailto:drago.trusk@gmail.com" target="_blank">drago.trusk@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Hi everyone,<div dir="auto"><br></div><div dir="auto">I have particular problem which I'm unable to solve.</div><div dir="auto"><br></div><div dir="auto">Lets say there are following components:</div><div dir="auto"> - Main: library/executable</div><div dir="auto"> - Ignorable: Main requires it to build, but not for packaging<br></div><div dir="auto"><br></div><div dir="auto">Main simply defines:</div><div dir="auto">add_dependencies(Main Ignorable)</div><div dir="auto"><br></div><div dir="auto">FindIgnorable.cmake contains something like:</div><div dir="auto">add_custom_target(Ignorable</div><div dir="auto"> COMMAND ... ... && cmake --build --target install .</div><div dir="auto"> # ...</div><div dir="auto">)</div><div dir="auto"><br></div><div dir="auto">Problem is that deb cpack generator picks this from install tree (tar/zip doesn't contain Ignorable). So deb ends up with:</div><div dir="auto"># ... correct fs hierarchy</div><div dir="auto">/home/saduser/projects/<wbr>ignorableinstall</div><div dir="auto"><br></div><div dir="auto">I need to avoid dependency used only for building artifacts. </div><div dir="auto"><br></div><div dir="auto">What I found:</div><div dir="auto">- Remove add_dependency</div><div dir="auto">---- Problem: have to build dependencies manually and will break CI and other people builds</div><div dir="auto">- Disable automatic packaging of everything and specify custom components to package</div><div dir="auto">---- Problem: Dependency tree which might be bigger and requires to know too many details. In addition requires for outside changes so that all targets have (appropriate) install conponents.</div><div dir="auto"><br></div><div dir="auto">I tried everything else that is possible. Am i missing something or are those two only viable options?</div></div></blockquote><div><br></div><div>I think the second option should be ok and not that complicated.</div><div>Put the "Ignorable" in an "IgnoredComp" install component and remove this</div><div>component from the list of installed components.</div><div><br></div><div><div>get_cmake_property(CPACK_COMPONENTS_ALL COMPONENTS)</div><div>list(REMOVE_ITEM CPACK_COMPONENTS_ALL """)</div></div><div><br></div><div>see: <a href="https://cmake.org/cmake/help/v3.11/module/CPackComponent.html">https://cmake.org/cmake/help/v3.11/module/CPackComponent.html</a></div><div><br></div><div>AFAIR you don't need to defined a component for every install because CPack already does that for you.</div><div>I think that every bits installed without component specification ends-up in the trap-them-all </div><div>"Unspecified" component which is automatically created by CPack.</div><div><br></div><div>see: <a href="https://cmake.org/cmake/help/v3.11/variable/CMAKE_INSTALL_DEFAULT_COMPONENT_NAME.html">https://cmake.org/cmake/help/v3.11/variable/CMAKE_INSTALL_DEFAULT_COMPONENT_NAME.html</a><br></div><div><br></div><div>Another way to do that even more simply (**if you are sure no component are defined**)</div><div>would be to:</div><div><br></div><div>1) install ignorable in "IgnoredComp" component</div><div>2) let all other be in your default component</div><div>set(<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "InstallThatOnly")</span></div><div>3) only install your default component</div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">set(<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">CPACK_COMPONENTS_ALL "InstallThatOnly")</span></span></div></div><div><br></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Eric<br></div></div></div></div></div>
</div></div>