Results 1 to 7 of 7

Thread: vtk integration with Qt 5.5

  1. #1
    Join Date
    Feb 2016
    Posts
    1
    Qt products
    Qt5

    Default vtk integration with Qt 5.5

    Hi,

    I am using vtk 6.3.0, Qt 5.5 and Cmake 3.2.3. I want to integrate vtk and Qt and run them in Vs 2013. After VTK_group_Qt was selected, I hit generate but it thew me an error:

    Could not find a package configuration file provided by "Qt5" with any of
    the following names:
    Qt5Config.cmake
    qt5-config.cmake
    Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR"
    to a directory containing one of the above files. If "Qt5" provides a
    separate development package or SDK, be sure it has been installed.

    I added CMAKE_PREFIX_PATH in environment variable as F:\Program\Qt\5.5\msvc2013_64\\, but this does not help. I am very frustrated with this problem. Can anybody help me a little bit?

    Thanks,
    Kuo

  2. #2
    Join Date
    Feb 2016
    Posts
    5
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: vtk integration with Qt 5.5

    I'm in the same boat, except I'm using VS2015. I'd also be interested in a solution to this.

    What are you installing VTK for? I am installing it for PCL.

  3. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: vtk integration with Qt 5.5

    I've done this before with an earlier version of VTK. I've just downloaded the latest and will try it again. Once I get it working I will let you know what I did.

    By the way, the current release of Qt5 will complain if you try to use it with VS2015. If you want to use it, you have to change the VS project settings to build using the VS2013 toolset.

  4. #4
    Join Date
    Feb 2016
    Posts
    5
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: vtk integration with Qt 5.5

    I managed to get it to compile, using the process here http://doc.qt.io/qt-5/windows-building.html, and set all my environment vars like this :

    REM Set up \Microsoft Visual Studio 2013, where <arch> is \c amd64, \c x86, etc.
    CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64
    SET _ROOT=C:\qt\qt-4.8.6
    echo --ROOT
    echo %_ROOT%
    SET PATH=%_ROOT%\qtbase\bin;%_ROOT%\gnuwin32\bin;C:\Py thon27;C:\Perl64;C:\Ruby22-x64;%PATH%
    REM Uncomment the below line when using a git checkout of the source repository
    REM SET PATH=%_ROOT%\qtrepotools\bin;%PATH%
    SET QMAKESPEC=win32-msvc2015
    echo --QMAKESPEC
    echo %QMAKESPEC%
    SET _ROOT=


    Didn't get any errors when I compiled are you saying I will have trouble once I start trying to use it in VS2015? I have compiled all my other dependencies using vs2015, should I go back and use 2013 for everything? Again this is all for PCL usage.

  5. #5
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: vtk integration with Qt 5.5

    Qt 5.5 binary distributions are up to VS 2013 only. There is a test for the compiler version in one of the Qt header files that will complain if VS 2015 is detected. If you tell VS 2015 to target the 2013 toolset, these complaints go away. I don't know what happens if you build Qt yourself from source. I think the complaints will still be there unless you edit the include file to update the test for the VS version.

    What I don't know is whether the Qt binary libraries (built using VS 2013) are compatible when linked to binaries compiled using VS 2015 with the default VS 2015 toolset.

    SET _ROOT=C:\qt\qt-4.8.6
    My comments are based on Qt 5, not Qt 4. I don't know what happens in this case.

    And the OP is talking about building VTK, not Qt.

    Here is what I did just now to build VTK using VS2013 as the compiler and target for the CMake generator:

    - be sure that your Qt bin and Python directories are in your environment PATH
    - unzipped source distribution
    - ran CMake GUI
    - set unzip VTK top-level directory for "where is the source code""
    - specified new "build" directory under this for "where to build the binaries"
    - selected VS 2013 x64 as the generator target
    - clicked Configure
    - after completion, selected the following checkboxes:
    - build examples
    - build shared libs
    - module vtk gui support Qt
    - module vtk gui support Qt OpenGL
    - modulr vtk python
    - module vtk python interpreter
    - module vtk rendering Qt
    - module vtk rendering volume OpenGL
    - module vtk views Qt
    - VTK group Qt
    - VTK wrap python
    - clicked Configure again
    - fixed errors (mostly paths and conflicting options)
    - changed VTK_QT_VERSION to 5
    - continued to click Configure until no errors reported
    - clicked Generate
    - when done, started VS2013, opened the VTK.sln in my "build" directory
    - loaded (in my case) 343 projects
    - selected the ALL_BUILD project
    - clicked "build"

    It takes a long time to build, especially the Python wrappings. I have Python 2.7 installed as a static library, and CMake complained that it couldn't find the Python27.dll file (because it doesn't exist in my install). I set the PYTHON_DEBUG_LIBRARY variable to empty and it stopped complaining. I do not know if VTK will work with a static Python. I'll test that later.

    After the build completed, there were 92 projects that failed to build. These are all related to Python, probably because of my static library build. I'll try it again with a DLL version of the Python libraries.

  6. #6
    Join Date
    Feb 2016
    Posts
    5
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: vtk integration with Qt 5.5

    Oops, yeah I had changed that trying to get it to work with QT4(because I had a tutorial that used QT4, I decided not to actually compile it), but yes I am using QT5 also. Yes I compiled it from source, I was told on another forum I shouldn't have any issues compiling using VS2015. https://forum.qt.io/topic/64384/comp...ws-10-msvc14/2

    I found the issue that was causing my problem I was picking the wrong directory for Qt5_DIR

    I had to go to qt-5.5.1/qtbase/lib/cmake/QT5 to find the file.

    -----

    Now I'm getting another error asking about Qt5UiPluginConfig.cmake, I've searched the whole directory and can't find the cmake file, all the others that I needed were in that .../lib/cmake directory but that one seems to be missing.

    Here's there Error

    Qt Code:
    1. CMake Error at C:/QT/qt-5.5.1/qtbase/lib/cmake/Qt5/Qt5Config.cmake:26 (find_package):
    2. Could not find a package configuration file provided by "Qt5UiPlugin" with
    3. any of the following names:
    4.  
    5. Qt5UiPluginConfig.cmake
    6. qt5uiplugin-config.cmake
    7.  
    8. Add the installation prefix of "Qt5UiPlugin" to CMAKE_PREFIX_PATH or set
    9. "Qt5UiPlugin_DIR" to a directory containing one of the above files. If
    10. "Qt5UiPlugin" provides a separate development package or SDK, be sure it
    11. has been installed.
    To copy to clipboard, switch view to plain text mode 

    ---

    I was looking at Qt5Config.cmake:26 and on that line it appears to be looping through the modules but I don't see this module as a variable in cmake?

    Any ideas? Thanks for the help btw.

  7. #7
    Join Date
    Feb 2016
    Posts
    5
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: vtk integration with Qt 5.5

    Just a quick follow up to the error

    Qt Code:
    1. CMake Error at C:/QT/qt-5.5.1/qtbase/lib/cmake/Qt5/Qt5Config.cmake:26 (find_package):
    2. Could not find a package configuration file provided by "Qt5UiPlugin" with
    3. any of the following names:
    4.  
    5. Qt5UiPluginConfig.cmake
    6. qt5uiplugin-config.cmake
    7.  
    8. Add the installation prefix of "Qt5UiPlugin" to CMAKE_PREFIX_PATH or set
    9. "Qt5UiPlugin_DIR" to a directory containing one of the above files. If
    10. "Qt5UiPlugin" provides a separate development package or SDK, be sure it
    11. has been installed
    To copy to clipboard, switch view to plain text mode 
    I decided to recompile QT, this time I used nmake instead of jom, don't know if that is what made the difference. Then I recompiled VTK using cmake, and that warning was gone.

Similar Threads

  1. QT + MFC ( integration is possible ? )
    By andre_teprom in forum Newbie
    Replies: 2
    Last Post: 1st September 2011, 02:05
  2. VS Integration
    By GrahamLabdon in forum Qt Programming
    Replies: 3
    Last Post: 25th March 2010, 08:06
  3. qwt integration with qt
    By sandhyarani in forum Qt Programming
    Replies: 0
    Last Post: 31st July 2009, 08:21
  4. Eclipse Integration sans Integration
    By ChrisW67 in forum Qt Tools
    Replies: 3
    Last Post: 17th March 2009, 07:29
  5. Qt Integration
    By ToddAtWSU in forum Newbie
    Replies: 4
    Last Post: 23rd January 2006, 17:54

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.