CMake + Xcode generator minor issue

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
konis
Posts: 28
Joined: Mon, 2015-11-23, 16:05

CMake + Xcode generator minor issue

#1 Post by konis »

There is a minor issue present when using CMAKE to build DCMTK on OSX. I am currently using CMAKE 3.9.0 with DCMTK 3.6.2 and Xcode 8.3.3 but it has being present since we begun using DCMTK (we have an entry in our internal how-to document for DCMTK).

When generating the Xcode project CMAKE outputs CMAKE_OSX_SYSROOT using the full SDK directory path, like that:

Code: Select all

SDKROOT = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk;
This causes 'SDK not found' compilation errors, if we don't correct it manually in the Xcode project file. The correct value for the case above should be:

Code: Select all

SDKROOT = macosx10.12;
It would be nice to not have to this every time.

Thanks in advance.

- Christos

P.S. I see that the DCMTK_BUILD_DATE problem with Xcode was fixed in the 3.6.2 snapshot. One less step in building DCMTK. Many thanks.

Michael Onken
DCMTK Developer
Posts: 2048
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: CMake + Xcode generator minor issue

#2 Post by Michael Onken »

Hi Christos,

thanks for the valuable feedback. This has not been reported so far, and on our Mac (we just have an old Mac Mini to test on Mac ourselves) this does not show up either.

It seems that this is a CMake issue, since we do not set or influence CMAKE_OSX_SYSROOT in our CMake scripts at all. You could override the variable yourself (as described in related CMake documentation, if you do not want to edit the XCode file (what I can fully understand;).

Did you analyze what goes wrong in detail, i.e. why it is not possible to provide an absolute path at that position?

Best,
Michael

konis
Posts: 28
Joined: Mon, 2015-11-23, 16:05

Re: CMake + Xcode generator minor issue

#3 Post by konis »

Michael,

I didn't look into the CMake scripts yet, but I will give it a try.

My experience is that the CMAKE_OSX_SYSROOT value is set to the latest SDK by CMake in the first step (after I select XCode as the generator). After that I can change the SDK version by selecting a different one, but the value in SDKROOT is not the one Xcode expects. After correcting the SDK in the resulting Xcode project and inspecting the value written, I see that the SDKROOT is set to the short fort I mentioned in my first message.

What version os mac OS and Xcode do you have installed on your Mac Mini?

Christos

konis
Posts: 28
Joined: Mon, 2015-11-23, 16:05

Re: CMake + Xcode generator minor issue

#4 Post by konis »

Michael,

I came to think that this is a Cmake problem as you initially suggested.

When clearing the default value that Cmake inserts in CMAKE_OSX_SYSROOT, the SDKROOT is set to an empty string, which Xcode interprets as the generic 'No SDK (Latest macOS)'. This is a partial solution, since it avoids the compilation error, but we still cannot set the SDK from the Cmake GUI.

I'll take this to cmake.org.

Thank you for your time.

Regards,
Christos

Michael Onken
DCMTK Developer
Posts: 2048
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: CMake + Xcode generator minor issue

#5 Post by Michael Onken »

Hi Christos,

sorry for late response, I did not have the chance yet to lookup the system information for the Mac Mini but it seems it is not required any more.

If you find something what we should do on our side of the CMake toolchain to make XCode bugs easier, just let us know!

Best regards,
Michael

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest