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

Dave Partyka dave.partyka at kitware.com
Wed Jul 21 08:15:44 EDT 2010


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?

On Wed, Jul 21, 2010 at 7:32 AM, Michael Xanadu <
xanadu.michael at googlemail.com> wrote:

> Hi,
> I built two different VTK binaries with the same source (using CMake) - one
> 32bit, the other one 64bit. For example:
>
> C:\WORK\LIBS\VTK_SRC_5.6.0
> C:\WORK\LIBS\VTK_BIN_5.6.0_x32
> C:\WORK\LIBS\VTK_BIN_5.6.0_x64
>
> Then I built my own application with linking 32bit-version of VTK
> successfully. But now I want to build another application with linking
> 64bit-version. But that fails because CMake always links the 32bit-version?!
> I messed around with the CMakeLists.txt, VTK_DIR environment variable,
> FindVTK.cmake and so on - without success.
> The question is: How can I specify the path to VTK binaries in CMake (for
> my own)?
> Here's the part of my CMakeLists.txt so far:
>
>
> FIND_PACKAGE(VTK)
> IF(NOT VTK_DIR)
>   MESSAGE(FATAL_ERROR "Please set VTK_DIR.")
> ENDIF(NOT VTK_DIR)
> INCLUDE(${VTK_USE_FILE})
> SET( VTK_LIBRARIES
>   ${VTK_LIBRARIES}
>   vtkHybrid
>   vtkVolumeRendering
>   vtkRendering
>   QVTK
> )
>
> _______________________________________________
> 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/2c54bc2e/attachment.htm>


More information about the vtkusers mailing list