<div dir="ltr">Hi all,<div><br></div><div>I've already replied to an older thread mentioning the same issue, but still saw no reply.</div><div><br></div><div>I have a problem with CPack when using in combination with a custom top level target. </div>
<div><br></div><div>In my setup I have custom command which uses CPack to create a zip file. For me this zip file is a top level artefact (tight to a top level target). This top level target used to be a library, but for several reason I now want to use a custom target.</div>
<div>However, if I simply change my CMake file from add_library(name ..) to add_custom_target(name ALL) the build fails. The output I get is:</div><div><br></div><div><div>CPack: Create package using ZIP</div><div>CPack: Install projects</div>
<div>CPack: - Run preinstall target for: org.apache.incubator.celix.helloworld</div><div>CPack Error: Problem running install command: /usr/bin/make "preinstall"</div><div>Please check /Path/to/build/Celix/celix-build/examples/hello_world/_CPack_Packages/ZIP/PreinstallOutput.log for errors</div>
<div>CPack Error: Error when generating package: org.apache.incubator.celix.helloworld</div><div>make[2]: *** [org.apache.incubator.celix.helloworld] Error 1</div><div>make[1]: *** [examples/hello_world/CMakeFiles/org.apache.incubator.celix.helloworld.dir/all] Error 2</div>
<div>make: *** [all] Error 2</div></div><div><br></div><div>Strangely, if I make the custom target not a top level target, but instead create another (root only) custom top level target, and add the cpack target to it using a dependency, it works. While this works, this has the problem that the top level target is only visible in the root of my project, not in the respective sub directory (which I still would like to have).</div>
<div><br></div><div>Is there something I am doing wrong? If not, why is there a difference between add_library in combination with a custom command running CPack and add_cuctom_library and the cpack command?</div><div><br>
</div><div>-- <br>Met vriendelijke groet,<br><br>Alexander Broekhuis
</div></div>