PortGroup cmake
Bradley Giesbrecht
pixilla at macports.org
Mon Nov 5 17:00:02 PST 2012
On Nov 5, 2012, at 3:32 PM, Joshua Root wrote:
> On 2012-11-6 05:46 , Bradley Giesbrecht wrote:
>> Hi,
>>
>>
>> Changes in cmake 2.8.10 are causing problems for the cmake PortGroup.
>
> What problems?
>
>> Setting -DCMAKE_OSX_SYSROOT=/ is a problem. I believe cmake expects CMAKE_OSX_SYSROOT to be a path to an sdk.
>> cmake-1.0.tcl:
>> ...
>> pre-configure {
>> ...
>> configure.universal_args-append \
>> -DCMAKE_OSX_ARCHITECTURES=\"[join ${configure.universal_archs} \;]\"
>> if {${configure.sdkroot} != ""} {
>> configure.args-append -DCMAKE_OSX_SYSROOT="${configure.sdkroot}"
>> } else {
>> configure.args-append -DCMAKE_OSX_SYSROOT=/
>> }
>> }
>> ...
>>
>>
>> The svn log for r78651 says:
>> ...
>> cmake portgroup: set sysroot to / when an SDK is not needed (see #29008, #29452)
>> ...
>>
>>
>> Would something like this be a safe replacement for the default "/":
>> if {[vercmp ${xcodeversion} 4.3] < 0} {
>> set sdks.path ${developer_dir}/SDKs
>> } else {
>> set sdks.path ${developer_dir}/Platforms/MacOSX.platform/Developer/SDKs
>> }
>> set os.sdk ""
>> array set os.sdks {
>> 8 10.4u
>> 9 10.5
>> 10 10.6
>> 11 10.7
>> 12 10.8
>> }
>> foreach {key value} [array get os.sdks] {
>> if {${key} == ${os.major}} {
>> set os.sdk ${value}
>> }
>> }
>> if {[file exists ${sdks.path}/MacOSX${os.sdk}.sdk]} {
>> configure.args-append -DCMAKE_OSX_SYSROOT:PATH=${sdks.path}/MacOSX${os.sdk}.sdk
>> } else {
>> configure.args-append -DCMAKE_OSX_SYSROOT:PATH=/
>> }
>
> It doesn't do the same thing. The desired outcome is that the SDK
> specified in ${configure.sdkroot} is used if there is one, and no SDK is
> used if ${configure.sdkroot} is empty.
Then why not drop the else "configure.args-append -DCMAKE_OSX_SYSROOT:PATH=/"?
I was hoping you might recall why it was added in r78651.
And why not move the existing configure.args statements outside the pre-configure phase?
This would make it easier to make adjustments in the Portfile.
Regards,
Bradley Giesbrecht (pixilla)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2763 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/macports-dev/attachments/20121105/fa267e4d/attachment.p7s>
More information about the macports-dev
mailing list