Llinking ITK(Insight Toolkit)到C ++ VS2008解决方案,而不使用CMake? [英] Llinking ITK (Insight Toolkit) to C++ VS2008 solution without using CMake?

查看:316
本文介绍了Llinking ITK(Insight Toolkit)到C ++ VS2008解决方案,而不使用CMake?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题



有一个简单直接的方式将ITK库包含在我的项目中 > > 我刚刚开始研究ITK本周。到目前为止,我成功编译ITK& VTK并获得WikiExamples编译(和运行)。我的下一个目标是将任何ITK功能包含在我自己的项目中。除非在安装过程中使用它,否则我没有CMake的经验。



我自己的项目代码本身是一个相当复杂的SDK环境, VS2008解决方案我只想添加一点ITK功能。因为我已经建立了ITK,我可以简单地设置包括到.h文件,并添加lib目录到链接器?



是否有一个这样做,因为.h文件分布在整个ITK代码树上?



我意识到这个问题是类似的,但给定的答案对我来说太含糊了,对不起。



编辑:第2次和第3次读取后,实际上不是。

$ p

解决方案

当使用CMake(或cmake-gui)配置ITK时,可以设置变量 CMAKE_INSTALL_PREFIX 到所有输出的目的地。默认值为 C:/ Programm Files(x84)/ itk





配置 strong>已成功执行,解决方案文件( ITK.sln )已在给定的在哪里构建二进制文件目录中创建,并且可以在Visual Studi0 2008中打开。该解决方案具有默认项目 ALL_BUILD 构建解决方案,但它也具有默认跳过的 INSTALL 项目。



img src =http://i.stack.imgur.com/PYV0z.jpgalt =VS 2008 solution>



构建此解决方案(ALL_BUILD之后)将所有需要的lib,.h,.dll等文件复制到之前指定的路径。





这个文件夹结构是将我自己的项目链接到的地方。





链接到您自己的项目



在VS Studio的自己项目您的项目属性中包含include文件:





您必须修改项目属性以包含用于链接的库文件:



img src =http://i.stack.imgur.com/hLG28.pngalt =输入图片说明here>>


Question

Is there an easy, straight forward way of including the ITK libraries into my project (VS2008 solution) without using CMake?

Background

I have just started looking into ITK this week. So far I successfully compiled ITK & VTK and got the WikiExamples to compile (and run) as well. My next goal is to include any ITK functionality into my own project. I have no experiences with CMake except the use of it during the documented installation process.

My own project codebase is in itself a rather complicated, SDK environment in rather large, complex VS2008 solution to which I only want to add a bit of ITK functionality. As I have built ITK already, can I simply set includes to the .h files and add the lib directories to the linker?

Is there a good way to do this, as the .h files are spread over the whole ITK code tree?

I've realized that this question is similar, but the given answer was too cryptic for me, sorry.

Edit: After a 2nd and 3rd read, it actually wasn't. It led to my answer below.

解决方案

When configuring ITK with CMake (or cmake-gui) one can set the variable CMAKE_INSTALL_PREFIX to a destination for all output. The default value is C:/Programm Files (x84)/itk

After Configure and Generate have been performed successfully, the solution file (ITK.sln) has been created in the given "Where to build the binaries" directory and can be opened in Visual Studi0 2008. The solution has the default project ALL_BUILD which builds the solution, but it also has a INSTALL project which is skipped by default.

Building this solution (after ALL_BUILD) copies all required lib, .h, .dll etc. files into the path specified before.

This folder structure is the place to link my own project up to.

Linking in your own project

In your own project of VS Studio (I'm on VS 2008) you have to modify your project properties to include the include files:

And you have to modify your project properties to include the library files for linking:

这篇关于Llinking ITK(Insight Toolkit)到C ++ VS2008解决方案,而不使用CMake?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆