[vtkusers] How to introduce the VTK in the Microsoft Visual Studio 2008 MFC

小小 alicerocket001 at 163.com
Wed Mar 6 09:19:36 EST 2013


John ,Thank you for your reply
     I have already built VTK  .  But  how to use cmake to build MFC projects still do not understand.
    1.Suppose I have established the MFC single document project. This is  name" VTK_ext". Delete  VTK_ext.sln  and VTK_ext.ncb
    2.To find a file  ,its name is CMakeLists.txt  in VTK  DIR  (D:\vtk\vtk\Examples\GUI\Win32\vtkMFC\vtkSDI),
and modify this file. ( VTK_ext  instead of  vtkSDI ) .
   3.start Cmake.  soure code : "D:/Documents/Visual Studio 2008/Projects/VTK_ext"   (CMakeLists.txt  copy of this folder)
                          build  the  binaries: "D:/Documents/Visual Studio 2008/Projects/VTK_ext/VTK_ext"
     configure---> Generate--->
  4. Use  vc2008 to open  VTK_ext.sln    ,  press  F5 ,Pop-up window   (title is Executable For Debug Session)
   The above method which is not correct, please advice!
    alice



At 2013-03-06 20:04:26,"John Drescher" <drescherjm at gmail.com> wrote:
>On Wed, Mar 6, 2013 at 6:09 AM, Jon Haitz Legarreta
><jhlegarreta at vicomtech.org> wrote:
>> Hi there,
>> if you have already built VTK and you are looking for a way to use and link
>> a project of your own agains VTK, this is a good starting point:
>> http://www.vtk.org/Wiki/VTK/Tutorials/CMakeListsFile
>>
>> If you have not built VTK yet, this may be useful:
>> http://www.vtk.org/Wiki/VTK/Building
>>
>> When you run CMake, it will ask which compiler you will be using, and that
>> is where you will choose MS VS2008.
>>
>> It is highly recommended to use CMake because it will save you time in the
>> project configuration process.
>>
>
>I also (as a long time windows developer) highly recommend using CMake
>for project generation especially with Visual Studio. One of the
>biggest benefits is that it greatly simplifies the project
>configuration process with large libraries like vtk that have dozens
>to hundreds of modules. It also makes it very simple to switch
>compilers or to build the same source with multiple compilers at the
>same time. I recommend using a totally independent build tree from the
>source tree to facilitate this. On to of this CMake supports packaging
>with nsis and the builtin unit testing. I find these extremely useful
>for my projects. These are just a few of the added benefits of using
>CMake. I could not possibly list all in a single email..
>
>John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130306/7b05ef0b/attachment.htm>


More information about the vtkusers mailing list