Alternate build directory for CMake-based port?

Joshua Root jmr at macports.org
Thu Aug 23 08:06:48 PDT 2012


On 2012-8-24 00:51 , Bradley Giesbrecht wrote:
> 
> On Aug 23, 2012, at 7:45 AM, Joshua Root wrote:
> 
>> On 2012-8-24 00:39 , Kevin Reid wrote:
>>> I am interested in getting the GNU Radio ports (gnuradio-*) updated to the latest version. (Relevant ticket: <https://trac.macports.org/ticket/31475>. The maintainer has acknowledged the problem but no work has been done for 11 months.) I have not seriously attempted to work on portfiles before.
>>>
>>> GNU Radio 3.6.* has switched exclusively to a CMake-based build system. For the most part, I have been able to simply apply the cmake PortGroup and modify the configuration parameters to CMake style.
>>>
>>> However, GNU Radio also insists that the build directory be different from the source directory; the CMakeLists.txt file contains:
>>>
>>> if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
>>>    message(FATAL_ERROR "Prevented in-tree build. This is bad practice.")
>>> endif(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
>>>
>>> I could of course patch out this condition, but that seems unnecessarily fragile if it even works. How can I tell MacPorts to use distinct source and build directories for a CMake-based port?
>>>
>>> The official build instructions are to do
>>>  (in gnuradio source)
>>>  mkdir build
>>>  cd build
>>>  cmake ../
>>>  make
>>> but since MacPorts takes care of these commands via its own infrastructure I don't know where to "just" insert a cd command and tweak the pathnames.
>>
>> Sure, something like this should do it:
>>
>> worksrcdir    ${worksrcdir}/build
>> post-extract {
>>    file mkdir ${worksrcpath}
>> }
> 
> Wouldn't something like this be need:
> configure.args      ../

Yes. :)

- Josh


More information about the macports-dev mailing list