[Insight-users] Simple client program question
David Cole
dlrdave at aol.com
Fri Feb 1 17:08:05 EST 2013
OK, then, the famous "answer your own question 10 minutes later" gambit:
I re-thought it, and said to myself, "Hey, my teeny little tiny test program only really needs ITKCommon, so why am I not just asking for just that...?"
I changed my find_package call to:
find_package(ITK 4.4 COMPONENTS ITKCommon REQUIRED)
And now ITK_LIBRARIES only lists the ITKCommon lib and its dependents rather than everything under the sun. So it works now, with no linker error.
Good way to end the week, I think...
(And, please, please, please, ... don't call me a "guru")
:-)
D
-----Original Message-----
From: Matt McCormick <matt.mccormick at kitware.com>
To: Bill Lorensen <bill.lorensen at gmail.com>
Cc: David Cole <dlrdave at aol.com>; insight-users <insight-users at itk.org>
Sent: Fri, Feb 1, 2013 4:55 pm
Subject: Re: [Insight-users] Simple client program question
On Fri, Feb 1, 2013 at 9:54 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
> Dave,
>
> This has come up before. If you have built ITK with
> Module_ITKVtkGlue:BOOL=ON, a client program needs to find VTK. If you
> know a way to solve this problem, oh great cmake guru, we would all
> appreciate it.
+1
>
> Bill
>
>
> On Fri, Feb 1, 2013 at 4:39 PM, David Cole <dlrdave at aol.com> wrote:
>> Simple ITK client program CMakeLists.txt file:
>> ===========================================
>> cmake_minimum_required(VERSION 2.8)
>> project(itkClient)
>>
>> find_package(ITK 4.4)
>> include(${ITK_USE_FILE})
>>
>> add_executable(itkClient itkClientMain.cxx)
>> target_link_libraries(itkClient ${ITK_LIBRARIES})
>>
>> Question:
>> ===========================================
>> Should I have to mention VTK in this CMakeLists.txt file if I built ITK:
>> with static libraries, -DBUILD_SHARED_LIBS:BOOL=OFF,
>> and -DModule_ITKVtkGlue:BOOL=ON,
>> and I am trying to link itkClient against the *install* tree of ITK?
>>
>> Or should it be optional/not-required, or automatically handled if it is
>> required?
>>
>> (right now, in 'master', it appears to be required, with CMake 2.8.10.2,
>> even if itkClient does not do any VTK stuff... I get the linker error pasted
>> below about "vtksys.lib"... ITK_LIBRARIES does not include "vtksys")
>>
>>
>> Thanks,
>> David
>>
>>
>> Linker error
>> ===========================================
>> 3: Run Build Command:ninja
>> 3: [1/2] Building CXX object CMakeFiles\itkClient.dir\itkClientMain.cxx.obj
>> 3: [2/2] Linking CXX executable itkClient.exe
>> 3: FAILED: cmd.exe /c cd . && "C:\Program Files (x86)\CMake
>> 2.8\bin\cmake.exe" -E vs_link_exe C:\PROGRA~2\MICROS~1.0\VC\
>> bin\cl.exe /nologo /DWIN32 /D_WINDOWS /W3 /Zm1000 /GR /EHsc /bigobj
>> /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 /FeitkClient.exe
>> /FditkClient.pdb @CMakeFiles/itkClient.rsp /link /implib:itkClient.lib
>> /version:0.0 /STACK:10000000 /machine:X86 /de
>> bug /INCREMENTAL /subsystem:console && cd .
>> 3: LINK : fatal error LNK1104: cannot open file 'vtksys.lib'
>>
>>
>> ITK_LIBRARIES
>> ===========================================
>> ITK_LIBRARIES='itksys;itkvnl_algo;itkvnl;itkv3p_netlib;ITKCommon;itkNetlibSlatec;ITKStatistics;ITKIOImageBase;ITKMesh;itkzlib;ITKMetaIO;ITKSpatialObjects;ITKPath;ITKLabelMap;ITKQuadEdgeMesh;ITKOptimizers;ITKPolynomials;ITKBiasCorrection;ITKBioCell;ITKDICOMParser;ITKEXPAT;ITKIOXML;ITKIOSpatialObjects;ITKFEM;itkopenjpeg;gdcmDICT;gdcmMSFF;ITKznz;ITKniftiio;ITKgiftiio;itkhdf5_cpp;itkhdf5;ITKIOBMP;ITKIOBioRad;ITKIOCSV;ITKIOGDCM;ITKIOIPL;ITKIOGE;ITKIOGIPL;ITKIOHDF5;itkjpeg;ITKIOJPEG;itktiff;ITKIOTIFF;ITKIOLSM;ITKIOMesh;ITKIOMeta;ITKIONIFTI;ITKNrrdIO;ITKIONRRD;itkpng;ITKIOPNG;ITKIOSiemens;ITKIOStimulate;ITKIOTransformBase;ITKIOTransformHDF5;ITKIOTransformInsightLegacy;ITKIOTransformMatlab;ITKIOVTK;ITKKLMRegionGrowing;ITKOptimizersv4;ITKVTK;ITKWatersheds;ITKReview;ITKVideoCore;ITKVideoIO;ITKVtkGlue'
>>
>>
>> _____________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Kitware offers ITK Training Courses, for more information visit:
>> http://www.kitware.com/products/protraining.php
>>
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.itk.org/mailman/listinfo/insight-users
>>
>
>
>
> --
> Unpaid intern in BillsBasement at noware dot com
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130201/2c5049dc/attachment.htm>
More information about the Insight-users
mailing list