CMake VTK_DIR-NOTFOUND

Although the currently accepted answer is a good way of debugging, it looks like you're building Point Cloud Library (PCL) with the binaries from unancyowen. In which case I suggest ensuring your system environment variables are setup correctly which will automate the process you are currently going through and facilitate the job of the find_package() methods. Assuming you installed everything in the same directory (i.e. where you have already linked to FLANN and Eigen) the following default PCL 3rd Party Libraries should be added to Path:

C:\Program Files\PCL 1.7.2\3rdParty\FLANN\bin

C:\Program Files\PCL 1.7.2\3rdParty\VTK\bin

C:\Program Files\PCL 1.7.2\3rdParty\Eigen

C:\Program Files\PCL 1.7.2\3rdParty\Boost

Then Qt, OpenNI etc. which are installed separately.

And you can also add:

BOOST_INCLUDEDIR : C:\Program Files\PCL 1.7.2\3rdParty\Boost\include\boost-X_XX\boost (Replace X_XX with your version number)

BOOST_LIBRARYDIR : C:\Program Files\PCL 1.7.2\3rdParty\Boost\lib

BOOST_ROOT : C:\Program Files\PCL 1.7.2\3rdParty\Boost

EIGEN_ROOT : C:\Program Files\PCL 1.7.2\3rdParty\Eigen


The first thing I would check is what is the actual find_package() command being invoked where the error occurs? Perhaps that call is something a bit unusual or explicitly has the MODULE keyword (this would prevent the VTKConfig.cmake file from being found).

If that looks okay, check to see if something is modifying the VTK_DIR variable. Insert the following near the top of your top-most CMakeLists.txt file:

variable_watch(VTK_DIR)

This should tell you what, if anything, is modifying it in ways you didn't expect.

Assuming VTK_DIR is not actually being changed, the next thing you could try is setting CMAKE_PREFIX_PATH to the directory containing the VTKConfig.cmake file (you can add this in the CMake GUI if it isn't there already). Maybe also try variable_watch(CMAKE_PREFIX_PATH) too just in case something is modifying that internally in unexpected was as well.

If that still doesn't reveal anything, then it would seem likely that there is something wrong with either your CMake or VTK installation. Perhaps try an earlier CMake version and see if you get any different behaviour.

Tags:

Cmake

Vtk