Here you go…
My modified version of DCMTK will build the DCMTK libraries for use with iOS.
There are no custom shell scripts that produce this build. I’ve made small modifications to some of the CMake files in the standard DCMTK tree & I’ve added an iOS.cmake file to the top-level CMake directory.
My iOS.cmake file is derived from the iOS.cmake configuration file created by Google. Other projects, like OpenCV, have used the same file for their iOS build.
You can find my version of the DCMTK tree, here:
https://russes@bitbucket.org/afabsoftwa ... public.gitWhen you grab a copy, the afab branch contains the iOS modifications.
To build, let’s assume I have a copy of the DCMTK tree in the “latest_dcmtk” directory. To configure the build, I use these commands:
mkdir latest_dcmtk.iOS <<— in the same directory as latest_dcmtk
cd latest_dcmtk.iOS
cmake -DIOS_PLATFORM=SIMULATOR64 -G “Unix Makefiles” ../latest_dcmtk
- or -
cmake -DIOS_PLATFORM=SIMULATOR64 -G Xcode ../latest_dcmtk
Use the first cmake command to create a command-line build. Use the second cmake command to build using Xcode.
Most iOS developers will want to use the second cmake command.
To build the library:
make <<— command line build
- or -
open DCMTK.xcodeproj <<— to open under Xcode
To build on Xcode, use the ALL_BUILD scheme.
When the build is complete, you’ll want to either “make install” for a command line build or run the “INSTALL” scheme from Xcode. This will create an “install” directory in your build area, with the built installation tree installed there.
For most iOS developers, building under “SIMULATOR64” should get what you want. When you want to test on your device, clean the Xcode project and build for ARM on your device.
NOTE
There are lot of LLVM compiler options set to make this build proceed silently.
This build is brittle. If you change build options for iOS or macOS, you should test your modifications by performing a test build for the other platform.
I only build the iOS libraries. Command-line ARM binaries are verboten by Apple. You can make the command line build generate Command-line ARM binaries, but they won’t work.
The arithmetic tests that are part of the build are still done on Intel.
Google’s iOS.cmake file is single-architecture. If you try to modify this file to build multiple architectures at once, your build will most likely fail.
I’ve been working with Xcode 7 and the iOS 9.3 developer kit. If you’re trying to make this work with earlier version of Xcode & the iOS developer kit, you’re on your own.