Qt + VTK + Cmake
I'm running OSX 10.6 (Snow Leopard), Qt 4.6, VTK 5.4, and Cmake 2.8. I installed Qt, then VTK and Cmake. I configured VTK to use QT 4.6 (turned on VTK_USE_GUISUPPORT and VTK_USE_QVTK). The configuration and i开发者_JAVA技巧nstallation worked painlessly but if I run Cmake with Qt references the compilation fails during the subsequent make process because of failed dependency resolution.
As an example, I tried to build the Qt ImageViewer example (VTK/Examples/GUI/Qt/ImageViewer) and it failed to find qapplication.h (and all other qt headers). Any ideas about why this might be happening would be greatly appreciated!
CMake finds Qt by looking for qmake
(ironic, eh?). Make sure qmake
is in your path.
Also, make sure VTK and Qt 4.6 were compiled with the same version of gcc/g++. Weird runtime errors (like cout not working) can result.
First you should set DESIRED_QT_VERSION
to 4. When it's ready, you could chose QT_QMAKE_EXECUTABLE
to your qmake binary.
I find that the CMakeCache.txt in your build folder for cmake tends to have all the necessary diagnostics info for stuff like this. Almost certainly there's a string field for the include path that is blank right now due to not being found.
精彩评论