<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Now I call vtk from CMakeLists like this:</div><div class="gmail_default"><font face="verdana, sans-serif">FIND_PACKAGE(VTK 6.0 REQUIRED COMPONENTS vtkGUISupportQtOpenGL NO_MODULE)</font><br>
</div><div class="gmail_default"><font face="verdana, sans-serif"><br></font></div><div class="gmail_default" style><font face="verdana, sans-serif">but when compiling the project I still get</font><span style="font-family:verdana,sans-serif"> LNK1181 with vtkTestingGenericBridge.lib </span><span style="font-family:verdana,sans-serif">if I keep BUILD_TESTING set to off.</span></div>
<div class="gmail_default" style><font face="verdana, sans-serif"><br></font></div><div class="gmail_default" style><span style="font-family:verdana,sans-serif">Setting BUILD_TESTING to 1 solves the issue (regardless of the way how find_package is called). But I think it is stupid to require users to enable building of internal tests just so their normal applications can link properly.</span><font face="verdana, sans-serif"><br>
</font></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 23, 2013 at 4:51 PM, Marcus D. Hanwell <span dir="ltr"><<a href="mailto:marcus.hanwell@kitware.com" target="_blank">marcus.hanwell@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The Qt QVTK kit was split into several modules, depending on what you<br>
want vtkGUISupportQt contains several of the standard classes,<br>
vtkGUISupportQtOpenGL a few more, and then vtkGUISupportQtSQL or<br>
vtkGUISupportQtWebkit may have what you want. It sounds like the<br>
testing issues are linked to building examples with testing disabled.<br>
If you enable the Qt group in the CMake GUI then you should get the<br>
appropriate modules in your VTK_LIBRARIES variable,<br>
<br>
<a href="http://vtk.org/Wiki/VTK/Build_System_Migration" target="_blank">http://vtk.org/Wiki/VTK/Build_System_Migration</a> contains more<br>
information on finding and linking to VTK modules in your application.<br>
I can add some notes there about Qt.<br>
<div class="HOEnZb"><div class="h5"><br>
On Thu, May 23, 2013 at 4:43 AM, Dženan Zukić <<a href="mailto:dzenanz@gmail.com">dzenanz@gmail.com</a>> wrote:<br>
> When I remove QVTK from CMakeLists, the following 3 libraries cannot be<br>
> found:<br>
> vtkTestingGenericBridge.lib<br>
> vtkTestingIOSQL.lib<br>
> vtkTestingRendering.lib<br>
><br>
> The rest of the VTK libraries are specified with full path, like this:<br>
> D:\SDK\vtk-6.0.0\lib\Release\vtkalglib-6.0.lib<br>
> D:\SDK\vtk-6.0.0\lib\Release\vtkChartsCore-6.0.lib<br>
><br>
> If I remove those 3 offending libraries from dependency list, the program<br>
> fully links and runs properly. And it does not matter whether it VTK was<br>
> compiled as static or dynamic libraries.<br>
><br>
> Also, if I enable BUILD_TESTING, then it works without additional<br>
> modifications.<br>
><br>
> Bottom line: some of the testing modules were needlessly referenced by other<br>
> modules, and QVTK must no longer be specified in project's CMakeLists.<br>
><br>
><br>
> On Wed, May 22, 2013 at 10:23 PM, Dženan Zukić <<a href="mailto:dzenanz@gmail.com">dzenanz@gmail.com</a>> wrote:<br>
>><br>
>> I currently have this:<br>
>> TARGET_LINK_LIBRARIES(<br>
>> MyProject<br>
>> ${VTK_LIBRARIES} QVTK)<br>
>><br>
>> When I switched from naming all libs to ${VTK_LIBRARIES} approach, I<br>
>> remember I needed to add QVTK because it was not working otherwise. I am now<br>
>> at home, I will check tomorrow whether it works if I remove QVTK.<br>
>><br>
>><br>
>> On Wed, May 22, 2013 at 9:28 PM, David Doria <<a href="mailto:daviddoria@gmail.com">daviddoria@gmail.com</a>> wrote:<br>
>>><br>
>>> On Wed, May 22, 2013 at 12:48 PM, Dženan Zukić <<a href="mailto:dzenanz@gmail.com">dzenanz@gmail.com</a>> wrote:<br>
>>>><br>
>>>> With VTK6 itself compiled, I tried switching my project to the new<br>
>>>> version.<br>
>>>> I first tried building with static settings. When I started getting<br>
>>>> error:<br>
>>>> LINK : fatal error LNK1181: cannot open input file 'QVTK.lib'<br>
>>>><br>
>>>> I looked around for solutions. This is what I found:<br>
>>>> <a href="http://www.vtk.org/Wiki/VTK/Tutorials/QtSetup" target="_blank">http://www.vtk.org/Wiki/VTK/Tutorials/QtSetup</a> (VTK_Group_Qt and<br>
>>>> BUILD_SHARED_LIBS)<br>
>>>> but even after following this, the error remains.<br>
>>>><br>
>>>> Does anyone have suggestions about what to do?<br>
>>><br>
>>><br>
>>> Do you have a<br>
>>><br>
>>> target_link_libraries(YourProject [something] QVTK)<br>
>>> ?<br>
>>><br>
>>> If so, you can replace it with simply<br>
>>> target_link_libraries(YourProject ${VTK_LIBRARIES})<br>
>>><br>
>>> and QVTK will work (assuming you are still doing what you mentioned about<br>
>>> turning on VTK_Group_Qt, etc.)<br>
>>><br>
>>> David<br>
>>><br>
>><br>
>><br>
><br>
><br>
</div></div><div class="HOEnZb"><div class="h5">> _______________________________________________<br>
> Powered by <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>
> Please keep messages on-topic and check the VTK FAQ at:<br>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
><br>
</div></div></blockquote></div><br></div>