<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1" style="word-wrap:break-word">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi Brad,<br>
<br>
Maybe it does, but not the way I'm doing it. I am building with Qt Creator. In CMakeLists.txt I have:<br>
OPTION(BUILD_SHARED_LIBS "Build package with shared libraries." OFF)<br>
and in CMakeCache.txt I see:<br>
BUILD_SHARED_LIBS:BOOL=OFF<br>
but the executable is still built using all shared libraries.<br>
<br>
I also set<br>
OPTION(CMAKE_EXE_LINKER_FLAGS "-static")<br>
but this seems to have no effect as well.<br>
<br>
Is this something to do with Qt Creator, which under the hood uses qmake?<br>
<br>
Thanks<br>
Gib<br>
<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF617386"><font color="#000000" face="Tahoma" size="2"><b>From:</b> Bradley Lowekamp [blowekamp@mail.nih.gov]<br>
<b>Sent:</b> Thursday, 21 May 2015 1:38 a.m.<br>
<b>To:</b> Gib Bogle<br>
<b>Cc:</b> insight-users@itk.org<br>
<b>Subject:</b> Re: [ITK-users] Link ITK libraries statically<br>
</font><br>
</div>
<div></div>
<div>Hello,
<div><br>
</div>
<div>Does the CMake variable BUILD_SHARED_LIBS meet your needs?</div>
<div><br>
</div>
<div>Brad</div>
<div><br>
<div>
<div>On May 20, 2015, at 12:49 AM, Gib Bogle <<a href="mailto:g.bogle@auckland.ac.nz" target="_blank">g.bogle@auckland.ac.nz</a>> wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">
<div style="direction:ltr; font-family:Tahoma; font-size:10pt">I am using cmake and VS2010 to build an ITK application on Windows (also using Qt, but that is not relevant I think). I want to give the executable to a colleague, but I'd rather not have to transfer
the 16 ITK DLLs as well. Is there a way to build my application so that the ITK libraries are linked statically? <span class="Apple-converted-space"> </span><br>
A related question: I am using ITK in this program only to read and write tiff images. Is there a way to limit the libraries that are linked to just those that are needed?<br>
<br>
Thanks<br>
Gib<br>
</div>
_____________________________________<br>
Powered by<span class="Apple-converted-space"> </span><a href="http://www.kitware.com/" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/insight-users" target="_blank">http://public.kitware.com/mailman/listinfo/insight-users</a></div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</body>
</html>