<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"MS Mincho";
panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@MS Mincho";
panose-1:2 2 6 9 4 2 5 8 3 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.pl-k
{mso-style-name:pl-k;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">I’m attempting to build VTK (v7.1.1) for iOS and I’ve run into problems. In looking at the top level CMakeLists.txt file I see a stanza that says:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">option(VTK_IOS_BUILD "Build vtk.framework for iOS" OFF)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">if (VTK_IOS_BUILD)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> include(vtkiOS)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> return()<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">endif()<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The only instructions I see for building VTK for iOS are <a href="https://blog.kitware.com/building-vtk-for-mobile-architectures/">
here</a>. These instructions say to set <span style="font-family:"Courier New"">VTK_IOS_BUILD=ON</span> and a few other variables.<o:p></o:p></p>
<p class="MsoNormal">However, if <span style="font-family:"Courier New"">VTK_IOS_BUILD=ON</span>, the stanza above causes CMake to “return”, or quit processing the top-level CMakeLists.txt file. Yet further down in the same CMakeLists.txt file I see:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span class="pl-k"><span style="font-family:"Courier New"">if</span></span><span style="font-family:"Courier New""> (ANDROID
<span class="pl-k">OR</span> APPLE_IOS)</span> …<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">and <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span class="pl-k"><span style="font-family:"Courier New"">if</span></span><span style="font-family:"Courier New""> (APPLE_IOS)</span>…<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">These two conditionals seem to be targeting iOS, but will never be reached if
<span style="font-family:"Courier New"">VTK_IOS_BUILD=ON</span>. I see nowhere where
<span style="font-family:"Courier New"">APPLE_IOS</span> is set, nor instructions to set it.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">For my case I changed the first stanza to:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">option(VTK_IOS_BUILD "Build vtk.framework for iOS" OFF)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">if (VTK_IOS_BUILD)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:13.5pt"><span style="font-family:"Courier New"">include(vtkiOS)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:13.5pt"><span style="font-family:"Courier New"">SET (APPLE_IOS 1)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> #return()<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">endif()<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Configure, generate, and the build seems to get much further, but the build still breaks when building for the simulator (in vtkGL2PSExporter.cxx because it’s not finding vtk_gl2ps.h).<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">A framework is produced, but it appears to be incomplete. Specifically, vtkInteractorStyleMultiTouchCamera.h is not included, which may be caused by
<span style="font-family:"Courier New"">APPLE_IOS</span> being set. Because of this the iOS example GLPaint cannot be built.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Is there anyone who is having success building VTK 7.1.1 for iOS who can shed some light on this or provide more thorough instructions? Would a different version have more success? A VTK Framework does appear to have been produced.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">For reference I’m building VTK 7.1.1, using CMake version 3.8.0. I’m building on a Macbook air running MacOS 10.12.4 (Sierra), with Xcode 8.3.1.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Glen Brooksby<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>