<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none"><!--P{margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Thanks Francois, that makes it all clear. Yes, I did build VTK on a different computer, and have upgraded Qt. Since it is simpler to just delete the unwanted Qt libraries in VS than to customise all the cmake files, I'll just stick to what I'm doing.</p>
<p><br>
</p>
<p>Cheers, Gib <br>
</p>
<div style="color: rgb(33, 33, 33);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" color="#000000" face="Calibri, sans-serif"><b>From:</b> Francois Budin <francois.budin@kitware.com><br>
<b>Sent:</b> Wednesday, 23 August 2017 1:32 a.m.<br>
<b>To:</b> Gib Bogle<br>
<b>Cc:</b> insight-users@itk.org<br>
<b>Subject:</b> Re: [ITK-users] VS input library files</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>
<div>Hello Gib,<br>
<br>
</div>
It seems that you built ITK with the VTK bridge (CMake option Module_ITKVtkGlue), and you probably built VTK with Qt support. It is surprising that the Qt libraries do not match the Qt version on your computer. Did you build VTK on a different computer?<br>
To be able to compile any project that you link against ITK, CMake needs to know of all the dependencies of ITK. Because ITK is still using the CMake 2 paradigm (project based dependencies, vs CMake 3 that is target based), if you do not specify which module
needs to be loaded, all the dependencies will be added to all your targets.<br>
</div>
If you want to limit the number of dependencies, you can specify the ITK components that are loaded by CMake:<br>
</div>
find_package(ITK COMPONENTS {add required components here} )<br>
<br>
</div>
Another solution is to rebuild ITK without VTK support.<br>
</div>
Hope this helps,<br>
</div>
Francois<br>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Aug 22, 2017 at 12:02 AM, Gib Bogle <span dir="ltr">
<<a href="mailto:g.bogle@auckland.ac.nz" target="_blank">g.bogle@auckland.ac.nz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div dir="ltr" style="font-size:12pt; color:#000000; background-color:#ffffff; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>I am building applications using ITK on Windows 7, with cmake and Visual Studio 2010. The CMakeLists.txt file is very simple:</p>
<p><br>
</p>
<p>PROJECT(compress)<br>
FIND_PACKAGE(ITK)<br>
IF(ITK_FOUND)<br>
INCLUDE(${ITK_USE_FILE})<br>
ELSE(ITK_FOUND)<br>
MESSAGE(FATAL_ERROR<br>
"ITK not found. Please set ITK_DIR.")<br>
ENDIF(ITK_FOUND)<br>
<br>
set(PROJECTNAME "compress")<br>
ADD_EXECUTABLE(${PROJECTNAME} compress.cpp)<br>
TARGET_LINK_LIBRARIES(${<wbr>PROJECTNAME} ${ITK_LIBRARIES} )<br>
</p>
<p><br>
</p>
<p>and the cmake command is:</p>
<p><br>
</p>
<p>cmake -G "Visual Studio 10 Win64"</p>
<p><br>
</p>
<p>The .vcproj file created has, in the Linker > Input > Additional Dependencies list not only what looks like all the ITK libraries (about 78) but also a whole lot of VTK libraries (about 35) and 3 Qt libraries. This is for a program that uses neither VTK
nor Qt. I don't understand why all these libraries are included. I guess it doesn't really matter, since they don't finish up in the .exe, but it is a nuisance because for some reason the Qt libraries that it expects are a different version from those on
the computer, which means I have to either delete those libraries from the list or change the version number. If I was having to do this just a couple of times it wouldn't be worth worrying about, but I am rebuilding on a new machine a large number of programs
that all have this issue.<br>
</p>
<p><br>
</p>
<p>It would help to have a better understanding of the system that generates this list. Maybe there is a simple way to prevent unwanted libraries from getting into the list.<br>
</p>
</div>
<br>
______________________________<wbr>_______<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" 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" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>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" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>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" rel="noreferrer" target="_blank">http://www.itk.org/Wiki/ITK_<wbr>FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/insight-users" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/insight-users</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</body>
</html>