#44341: cmake can't find SDK when building openjpeg -----------------------------+-------------------------------- Reporter: dave.evans55@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: cmake Port: openjpeg | -----------------------------+-------------------------------- Comment (by ryandesign@…): Replying to [ticket:44341 dave.evans55@…]:
The SDK is really at {{{
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk
}}}
Indeed. The question is: where is that setting coming from? Who's specifying that `CMAKE_OSX_SYSROOT` and where? It builds fine for me on OS X 10.9.4 with Xcode 5.1.1. The cmake 1.0 portgroup has these lines: {{{ if {[vercmp $xcodeversion 4.3] < 0} { set sdks_dir ${developer_dir}/SDKs } else { set sdks_dir ${developer_dir}/Platforms/MacOSX.platform/Developer/SDKs } if {$macosx_deployment_target eq "10.4"} { set sdk ${sdks_dir}/MacOSX10.4u.sdk } else { set sdk ${sdks_dir}/MacOSX${macosx_deployment_target}.sdk } configure.args-append \ -DCMAKE_OSX_SYSROOT="${sdk}" \ -DCMAKE_OSX_DEPLOYMENT_TARGET="${macosx_deployment_target}" }}} That all looks fine, and suggests that `${developer_dir}` has the wrong value for you. `developer_dir` is automatically set by MacPorts base to the value returned by `xcode-select -print-path`. Try running that on the command line; if it does not say "/Applications/Xcode.app/Contents/Developer", then run `sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer` to fix it. If that's not it: Have you overridden `developer_dir` in macports.conf? If so, comment that out and try again.
I tried setting SDKROOT in my shell environment to the correct location, but it did not work.
That's understandable, since MacPorts deliberately clears the environment so that they would not adversely affect builds. -- Ticket URL: <https://trac.macports.org/ticket/44341#comment:1> MacPorts <http://www.macports.org/> Ports system for OS X