[vtkusers] How to specify the path to VTK in CMake?

Cyrille Faucheux cyrille.faucheux at etu.univ-tours.fr
Wed Jul 21 12:03:25 EDT 2010


Here is the CMakeLists.txt from an example.

-----------------
PROJECT(Medical4)

cmake_minimum_required(VERSION 2.8)

FIND_PACKAGE(VTK)
IF(VTK_FOUND)
     INCLUDE( ${USE_VTK_FILE} )
ENDIF(VTK_FOUND)

INCLUDE_DIRECTORIES(
     ${Medical4_SOURCE_DIR}
)

ADD_EXECUTABLE(Medical4 main.cpp)
TARGET_LINK_LIBRARIES(Medical4
     vtkRendering vtkGraphics vtkHybrid
     vtkImaging vtkIO vtkFiltering vtkCommon
     vtkVolumeRendering
)
-----------------

You may need to rebuild you app from zero if you want to change from 
win32 to x64.

Cyrille


Le 21/07/2010 16:25, Michael Xanadu a écrit :
> Hi Dave,
>
> thank you for your help. I did what you told me without success.
> I replaced
>
>    FIND_PACKAGE(VTK)
>
> with
>
>    FIND_PACKAGE(VTK REQUIRED)
>
> No success. Then I replaced the whole code block. No success. Then I 
> used a codeblock found in the internet:
>
>    FIND_PACKAGE(VTK REQUIRED)
>    INCLUDE(${VTK_USE_FILE})
>
> Always the same story. I can't set the path to VTK bin in CMake GUI & 
> CMake always links the (wrong) 32lib.
> There are VTKConfig.cmake + useVTK.cmake in the build directory 
> "c:\work\libs\vtk_bin_5.6.0_x64" but not in the build directory of my 
> own apllication. Do you have any further suggestions for me?
>
> With best regards,
> Michael
>
>
>
> 2010/7/21 Dave Partyka <dave.partyka at kitware.com 
> <mailto:dave.partyka at kitware.com>>
>
>     You shouldn't need to set a VTK_DIR environment variable. Also you
>     can simplify your logic slightly by using FIND_PACKAGE(VTK
>     REQUIRED) instead.
>
>      That said, the only thing you should have to do is set VTK_DIR in
>     the cmake gui to C:\WORK\LIBS\VTK_BIN_5.6.0_x64 and that should be
>     it. Are there definately VTKConfig.cmake and UseVTK.cmake files in
>     the root of your build directory?
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>    

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100721/36c4ccf5/attachment.htm>


More information about the vtkusers mailing list