Skip to content

Custom OpenIGTLink and OpenH264 build

Étienne Léger edited this page Jul 13, 2026 · 1 revision

An arm64 build of OpenIGTLink and OpenH264 is provided with MARIN in the lib folder. If a custom build is required, here is a typical build procedure:

On a Mac with Xcode installed, clone the OpenIGTLink project by executing the following commands within a base directory:

git clone https://github.com/openigtlink/OpenIGTLink.git
mkdir OpenIGTLink-build

Next, using CMake (3.23.1), configure the OpenIGTLink project with Xcode as the generator and with video streaming and H264 enabled: **

fig1

Be sure that the OpenH264_INCLUDE_DIR is pointing to the wels folder rather than the outdated svc folder. Then, within the ./OpenIGTLink-build directory, clone the openh264 repository and build it by executing the following commands:

cd OpenIGTLink-build/Deps
git clone https://github.com/cisco/openh264.git

Then, build the openh264 project for the OS and architecture of your target device (which in this case is an iPad Pro (12.9-inch) (5th generation)) as follows:

cd openh264
make OS=ios ARCH=arm64

At this points, the following libraries should have been created:

  • ./OpenIGTLink-build/Deps/openh264/libcommon.a
  • ./OpenIGTLink-build/Deps/openh264/libdecoder.a
  • ./OpenIGTLink-build/Deps/openh264/libencoder.a
  • ./OpenIGTLink-build/Deps/openh264/libopenh264.a
  • ./OpenIGTLink-build/Deps/openh264/libprocessing.a

Now, back in CMake, configure once again and generate the OpenIGTLink project. Verify that the Xcode project file ./OpenIGTLink-build/OpenIGTLink.xcodeproj was created and open it in Xcode. Select the OpenIGTLink project in the project navigator (left pane). From the drop down menu in the main pane, change the default ALL_BUILD target to the OpenIGTLink-lib project. Under Build Settings → Architectures, change the Base SDK to iOS and change Architectures to Standard Architectures (arm64, armv7). Plug your iPad to your Mac and ensure that the your are building the OpenIGTLink project on your iPad (c.f. top window of the main pane in the next figure which should read OpenIGTLink > Your iPad). Then, add the following Xcode projects:

  • ./OpenIGTLink-build/Deps/openh264/codec/build/iOS/common/common.xcodeproj
  • ./OpenIGTLink-build/Deps/openh264/codec/build/iOS/dec/welsdec/welsdec.xcodeproj
  • ./OpenIGTLink-build/Deps/openh264/codec/build/iOS/enc/welsenc/welsenc.xcodeproj
  • ./OpenIGTLink-build/Deps/openh264/codec/build/iOS/openh264/openh264.xcodeproj
  • ./OpenIGTLink-build/Deps/openh264/codec/build/iOS/processing/processing.xcodeproj

as subprojects by dragging the files in the left pane under the OpenIGTLink project. Your Xcode window should look like this:

fig2

Next, add the subprojects as target dependencies in the Build Phases of the OpenIGTLink target which you must select from the drop down menu in the main pane:

fig3

Then, for the OpenIGTLink, common, welsdec, welsenc, openh264, and processing projects and targets, change Targeted Device Families to iPad (with code number 2) and the iOS Deployment Target to the iOS version of your iPad (e.g. iOS 15.5) under Build Settings → Deployment:

fig4

Next,

  1. To the OpenIGTLink target, add the path ./OpenIGTLink-build/Deps/openh264/codec/api/wels to the Header Search Paths under Build Settings→Search Paths (if not already listed)
  2. To the common target, add the path ./OpenIGTLink-build/Deps/openh264/codec/common/inc to the Header Search Paths under Build Settings→Search Paths
  3. To the welsdec target, add the path ./OpenIGTLink-build/Deps/openh264/codec/decoder/core/inc to the Header Search Paths under Build Settings→Search Paths

Finally, validate all project settings in the Issues Navigator (default left pane) and select Product→Build from the Xcode interface. If all goes well (fingers crossed), the following libraries will be created:

  • ./OpenIGTLink-build/lib/Debug/libOpenIGTLink.a
  • ./OpenIGTLink-build/Deps/openh264/codec/build/IOS/common/build/Debug-iphoneos/libcommon.a
  • ./OpenIGTLink-build/Deps/openh264/codec/build/IOS/dec/welsdec/build/Debug-iphoneos/libwelsdec.a
  • ./OpenIGTLink-build/Deps/openh264/codec/build/IOS/enc/welsenc/build/Debug-iphoneos/libwelsenc.a
  • ./OpenIGTLink-build/Deps/openh264/codec/build/IOS/processing/build/Debug-iphoneos/libprocessing.a

Clone this wiki locally