0
votes

I have successfully build PCL for 64 bit windows using CMake and Visual Studio 2013. I have build all dependencies by my own (boost, Flann, QHull and VTK). Now I need to create a 32 bit version. Unfortunately CMake has problems to reference the VTK libraries. For 64 bits it adds the full path to the visual studio project files e.g. "D:\path\to\vtk\64\vtk-6.1.lib". But for 32 bits it only adds "vtk.lib". Even the version number is missing which is always part of the filename. The compiler has no chance to find it. It would be very cumbersome to patch all the PCL projects by my own.

I have already compared the CMakeCache.txt files for 32 and 64 bit. Except the 32/64 bit differences they are equal.

Has anybody an idea what I have might done wrong?

1
Please, provide minimal example which reproduces this behaviour. Also, how do you compile 32-bit package on 64-bit platform? Are you use crosscompiling? If so, provide code of CMake toolchain file you use.Tsyvarev
Unfortunately I cannot provide a minimal example. The PCL Library together with its dependencies is several Giga Bytes big. Building 32 bit libraries on 64 bit windows is not a problem. You can just point CMake either to Visual Studio 2015 or Visual Studio 2015 x64. But I was able to find a solution now but not the root cause. Please read below …chuchu42

1 Answers

0
votes

The PCL CMake script loads the VTK using the find_package(VTK) command. The path to the package is specified by the VTK_DIR variable. This variable points to the folder where the VTKConfig.cmake is. For x64 and x86 you will have different folders. For some reason the x86 version of the VTKTargets.cmake file which belongs to the VTKConfig.cmake was empty. After copy and paste the content from its x64 counterpart and some search and replace I was able to compile the project. So the root cause was that the VTKTargets.cmake was empty. But I do not know why it was empty. I had build the VTK in x64 and x86 mode.