<!DOCTYPE html><html><head><title></title><style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div style="font-family:Arial;">Why not leave the build directory alone & let the cmake 1.1 PG handle it? Most CMake-based ports can handle out-of-source building these days, and that's the default for the cmake 1.1 PG, and the default setting here should work for the vast majority of cmake-based ports.<br></div><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">To your query: You shouldn't try to write to or generate files outside the ${worksrcdir} (or ${worksrcpath}); all configuring, building, installing, patching, etc must be done within the port's build path.</div><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">Hope this is useful! - MLD<br></div><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">On Thu, May 2, 2019, at 12:40 PM, Ao Liu wrote:<br></div><blockquote type="cite" id="qt"><div dir="ltr"><div style="font-family:Arial;">Hi all macports fans,<br></div><div><br></div><div>I'm recently learning to do some small modifications and enhancements on an existing portfile. One way I found that would solve my problem was to modify the build dir of cmake. (The PortGroup == cmake 1.1). <br></div><div><br></div><div>I tried to set cmake.build_dir to ${prefix}/share/abc/abc${abc.version}/<br></div><div><br></div><div>But it always throws an error and I believe it was because cmake can not write to the above directory. I tried to chown the directory to macports, still doesn't work. <br></div><div><br></div><div>Any guidance on how to customize the CMake build directory? Thanks folks!<br></div><div><br></div><div><p style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: normal;" class="qt-gmail-p1"><span style="background-color:rgb(45, 45, 45)" class="highlight"><span style="color:rgb(233, 253, 255)" class="colour"><span style="font-family:Monaco" class="font"><span style="font-size:12px" class="size"><span style="font-variant-ligatures:no-common-ligatures;" class="qt-gmail-s1">:info:configure CMake Error at /opt/local/share/cmake-3.14/Modules/CMakeDetermineSystem.cmake:173 (file):</span></span></span></span></span><br></p><p style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: normal;" class="qt-gmail-p1"><span style="background-color:rgb(45, 45, 45)" class="highlight"><span style="color:rgb(233, 253, 255)" class="colour"><span style="font-family:Monaco" class="font"><span style="font-size:12px" class="size"><span style="font-variant-ligatures:no-common-ligatures;" class="qt-gmail-s1">:info:configure <span class="qt-gmail-Apple-converted-space">  </span>file failed to open for writing (No such file or directory):</span></span></span></span></span><br></p><p style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: normal;" class="qt-gmail-p1"><span style="background-color:rgb(45, 45, 45)" class="highlight"><span style="color:rgb(233, 253, 255)" class="colour"><span style="font-family:Monaco" class="font"><span style="font-size:12px" class="size"><span style="font-variant-ligatures:no-common-ligatures;" class="qt-gmail-s1">:info:configure <span class="qt-gmail-Apple-converted-space">    </span>/opt/local/share/abc/abc4.10.5/CMakeFiles/CMakeOutput.log</span></span></span></span></span><br></p><p style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: normal;" class="qt-gmail-p1"><span style="background-color:rgb(45, 45, 45)" class="highlight"><span style="color:rgb(233, 253, 255)" class="colour"><span style="font-family:Monaco" class="font"><span style="font-size:12px" class="size"><span style="font-variant-ligatures:no-common-ligatures;" class="qt-gmail-s1">...</span></span></span></span></span><br></p><p style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: normal;" class="qt-gmail-p1"><span style="background-color:rgb(45, 45, 45)" class="highlight"><span style="color:rgb(233, 253, 255)" class="colour"><span style="font-family:Monaco" class="font"><span style="font-size:12px" class="size"><span style="font-variant-ligatures:no-common-ligatures;" class="qt-gmail-s1">...</span></span></span></span></span><br></p><p style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: normal;" class="qt-gmail-p1"><span style="background-color:rgb(45, 45, 45)" class="highlight"><span style="color:rgb(233, 253, 255)" class="colour"><span style="font-family:Monaco" class="font"><span style="font-size:12px" class="size"><span style="font-variant-ligatures:no-common-ligatures;" class="qt-gmail-s1">...(similar CMake errors)</span></span></span></span></span><br></p></div></div></blockquote><div style="font-family:Arial;"><br></div></body></html>