[CMake] Problem using VTK with CMake

David Cole david.cole at kitware.com
Thu Jul 7 10:17:55 EDT 2011


On Thu, Jul 7, 2011 at 9:13 AM, tog <guillaume.alleon at gmail.com> wrote:

> Hi
>
> I want to build a package with my own VTK version. I have therefore
> compiled VTK and I have the following directories:
> sources -> /Users/alleon/PROJECTS/vtk-5.6.1
> build tree -> /Users/alleon/PROJECTS/vtk-5.6.1_build
> install tree -> /Users/alleon/PROJECTS/vtk-5.6.1_install
>
> I have the files:
> oggy:~ alleon$ ls -lrt
> /Users/alleon/PROJECTS/vtk-5.6.1_install/lib/vtk-5.6/VTKConfig.cmake
>  -rw-r--r--  1 alleon  staff  8613 Jun 10 15:37
> /Users/alleon/PROJECTS/vtk-5.6.1_install/lib/vtk-5.6/VTKConfig.cmake
> oggy:~ alleon$ ls -lrt
> /Users/alleon/PROJECTS/vtk-5.6.1_install/lib/vtk-5.6/UseVTK.cmake
> -rw-r--r--  1 alleon  staff  1315 Jun 10 15:36
> /Users/alleon/PROJECTS/vtk-5.6.1_install/lib/vtk-5.6/UseVTK.cmake
>
>
> In my project CMake, I have set
>
> SET(VTK_DIR PATH "/Users/alleon/PROJECTS/vtk-5.6.1_install/")
> FIND_PACKAGE(VTK REQUIRED)
> INCLUDE(${VTK_USE_FILE})
>
> and got this error (Not of those files are in the directory indicated):
>
> CMake Warning at /Applications/CMake
> 2.8-4.app/Contents/share/cmake-2.8/Modules/FindVTK.cmake:63 (IF):
>    given arguments:
>
>      "EXISTS" "PATH"
> "/Users/alleon/PROJECTS/vtk-5.6.1_install//UseVTK.cmake" "AND" "NOT"
> "EXISTS" "PATH" "/Users/alleon/PROJECTS/vtk-5.6.1_install//VTKConfig.cmake"
>
>    Unknown arguments specified
>  Call Stack (most recent call first):
>    CMakeLists.txt:16 (FIND_PACKAGE)
>
> If I make the change in CMakeLists.txt to have:
>
> SET(VTK_DIR PATH "/Users/alleon/PROJECTS/vtk-5.6.1_install/lib/vtk-5.6") <-
> where the expected files can be found
> FIND_PACKAGE(VTK REQUIRED)
> INCLUDE(${VTK_USE_FILE})
>
>
> I get this new error:
>
> CMake Warning at /Applications/CMake
> 2.8-4.app/Contents/share/cmake-2.8/Modules/FindVTK.cmake:63 (IF):
>    given arguments:
>
>      "EXISTS" "PATH"
> "/Users/alleon/PROJECTS/vtk-5.6.1_install/lib/vtk-5.6/UseVTK.cmake" "AND"
> "NOT" "EXISTS" "PATH"
>  "/Users/alleon/PROJECTS/vtk-5.6.1_install/lib/vtk-5.6/VTKConfig.cmake"
>
>    Unknown arguments specified
>  Call Stack (most recent call first):
>    CMakeLists.txt:15 (FIND_PACKAGE)
>
>
> What the hell am I doing wrong ?
>
> Thanks
> Guillaume
>
> _______________________________________________
> 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 CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>

Try:
SET(VTK_DIR "/Users/alleon/PROJECTS/vtk-5.6.1_install")

without the "PATH" and without the trailing "/"...


HTH,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110707/47490f9a/attachment.htm>


More information about the CMake mailing list