<div dir="ltr">Sorry for the delay, a few more replies to your latest questions embedded below.<div><br></div><div><br><div class="gmail_quote"><div dir="ltr">On Sun, Sep 30, 2018 at 6:06 PM Jan Wielemaker <<a href="mailto:jan@swi-prolog.org">jan@swi-prolog.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
>     I've come as far as understanding:<br>
><br>
>         - The generator creates cmake_install.cmake<br>
>         - make/ninja/... install calls cmake -P cmake_install.cmake<br>
>         - This calls file(INSTALL ....)<br>
><br>
>     So, I thought I can<br>
><br>
>         - Add a file cmake_ln_install.cmake that<br>
>           - redefines file()<br>
>           - includes cmake_install.cmake<br>
><br>
><br>
> You will likely find it more convenient to use install(CODE)<br>
> <<a href="https://cmake.org/cmake/help/latest/command/install.html#code" rel="noreferrer" target="_blank">https://cmake.org/cmake/help/latest/command/install.html#code</a>> or<br>
> install(SCRIPT)<br>
> <<a href="https://cmake.org/cmake/help/latest/command/install.html#script" rel="noreferrer" target="_blank">https://cmake.org/cmake/help/latest/command/install.html#script</a>> to<br>
> define commands to add to the install process rather than trying to work<br>
> with cmake_install.cmake directly. Those two forms of the install()<br>
> command are the recommended way to get your own code into the<br>
> cmake_install.cmake file that CMake generates. At the moment, you would<br>
> need to use execute_process() to invoke cmake -E create_symlink to<br>
> create the actual link within that code or script (see further below for<br>
> state of the file() command for this).<br>
<br>
Ok. I'm already using some install(CODE) for post-copy installation<br>
steps. I find the interface rather clumsy as you typically need to call<br>
external processes and need to get the quotes right :( Good news is that<br>
cmake allows you to hide all this stuff behind a function. So, I guess<br>
your proposal would be to define a function that abstracts away over<br>
installing the Prolog (data) files and uses one of the above if some<br>
option is selected and the usual install(FILES ...) otherwise?<br></blockquote><div><br></div><div>I'm not really making a proposal, but if you can see a robust way to hide away the clumsiness in your particular situation, then go for it.</div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
> I have a follow-up "part 2" article to the above one I linked, but it is<br>
> still in preparation. It discusses other problems with trying to forward<br>
> arguments using ARGN or ARGV, but some of the observations you've made<br>
> here and in the linked stackoverflow article may also be relevant. If I<br>
> get time, I'll try to see if I can incorporate some of the observations<br>
> and behaviors you've raised.<br>
<br>
Is it a plan to have something that reliably does forward arguments?<br>
I needed that in some of my internal abstractions (between my own<br>
functions) and I've seen quite a few questions on how to do that.<br>
For example,<br>
<br>
     call_function(name a1 a2 ... list)<br>
<br>
where list is a variable name rather than an expanded variable, i.e.,<br>
the last argument is always a variable _name_?<br></blockquote><div><br></div><div>I'm not aware of any active work going on to more robustly support argument forwarding.</div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
P.s.    Examining the source a bit further, it seems that installing<br>
        a file that is in fact a symlink will create a symlink.  Would<br>
        a simple way around be to create a secondary tree next to the<br>
         source tree that copies the directory structure and symlinks<br>
         all the files work?<br></blockquote><div><br></div><div>Erm, maybe try it and see, I don't know off the top of my head. ;)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
P.s.    Migrating from autoconf/make to cmake was a lot of work<br>
        (about 2 weeks for converting 45 Makefile.in and 37<br>
        <a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a> files), but make the build specification<br>
         a lot easier to follow and much shorter.  Especially<br>
        using the ninja backend, building is quite a bit<br>
         faster as well.<br>
</blockquote></div><div><br></div>Just wait until you get a chance to add ccache into the mix too. :D<br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr">Craig Scott<br><div>Melbourne, Australia</div><div><a href="https://crascit.com" target="_blank">https://crascit.com</a><br></div><div><br></div><div>New book released: <a href="https://crascit.com/professional-cmake/" target="_blank">Professional CMake: A Practical Guide</a><br></div></div></div></div></div></div></div></div></div>