[vtkusers] Re: Linking to vtkLandmarkTransform with CMake

Trond Valen trondvalen at gmail.com
Mon Oct 24 08:37:27 EDT 2005


Found it out. This must be the most newbie question ever...

On 10/24/05, Trond Valen <trondvalen at gmail.com> wrote:
> Hi!
>
> I have a simple question (I hope). I'm a newbie who wants to use
> vtkLandmarkTransform in a project, using C++, CMake and MS Visual Stuidio
> .NET 7. The thing is I can't find out how to link to it in CMake.
>
> I have built VTK, with the Hybrid package, and made a project for testing.
> It consists of Main.cxx and CMakeLists.txt.
>
> Excerpts from Main.cxx:
> #include "vtkLandmarkTransform.h"
> vtkLandmarkTransform *vtkLMT = vtkLandmarkTransform::New();
>
> CMakeLists.txt is where I define dependencies, like vtkLandmarkTransform:
>
> PROJECT (TestCmake)
>
> INCLUDE (${CMAKE_ROOT}/Modules/FindVTK.cmake)
> IF (USE_VTK_FILE)
>   INCLUDE(${USE_VTK_FILE})
> ENDIF (USE_VTK_FILE)
>
> ADD_EXECUTABLE(Main Main.cxx)
>
> TARGET_LINK_LIBRARIES(Main vtkRendering vtkLandmarkTransform)
>
> I've also tried to use vtkHybrid in TARGET_LINK_LIBRARIES, but it keeps
> asking me for vtkHybrid.dll, while with vtkLandmarkTransform it asks for
> vtkLandmarkTransform.lib. I can't find either of these files, so there is
> probably a better way to do it. Please give me a tip or two :)
>
> Kind regards
> Trond Valen
>



More information about the vtkusers mailing list