Errors when changing cmake build directory

Ao Liu ao at
Thu May 2 20:46:39 UTC 2019

Hi Michael,

The project I'm building creates a configuration script when cmake is
executed based on the path where the build happens. So when the whole build
directory is moved from ${worksrcpath} to a new location it fails to

BTW I think I set the cmake.build_dir
to ${destroot}/${prefix}/share/abc/abc${abc.version}/
in the very beginning and the build happened in
so ${destroot} was available in the very beginning of the port definition I


I also need some workaround for this problem. LOL. Probably manually
generate a new script...


On Thu, May 2, 2019 at 3:17 PM Michael Dickens <michaelld at>

> Just remember that "${destroot}" will not exist until the "destroot" phase
> unless it is created in the Portfile script. If you need a different build
> directory than that provided by the CMake PG, then you can in the Portfile
> create some other directory & my advice would be to place it in the top
> level "${worksrcpath}" directory -- which is where the "build" directory is
> placed. Not sure why one would need this, but maybe there's a use-case I'm
> not imagining. Good luck! - MLD
> On Thu, May 2, 2019, at 3:20 PM, Ao Liu wrote:
> Ummmmm. Good to know that.
> I think what I would like to do can be achieved by smartly using
> ${destroot} to deploy a new build dir and move the files to where I would
> like. In this case the build happens in the work dir and will eventually
> end up in where I want it to be.
> As I suggested in a recent ticket - it would be nice for the website to
> explain the ${destroot} variable in more details. Helps the developer to
> build powerful stuff.
> Thanks for the replies folks!
> Ao
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the macports-dev mailing list