在不使用 CMake 的情况下将 ITK(Insight Toolkit)链接到 C++ VS2008 解决方案? [英] Llinking ITK (Insight Toolkit) to C++ VS2008 solution without using CMake?

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

问题描述

是否有一种简单、直接的方法可以在不使用 CMake 的情况下将 ITK 库包含到我的项目中(VS2008 解决方案)?

我这周才开始研究 ITK.到目前为止,我成功编译了 ITK &VTK 并获得了 WikiExamples 来编译(和运行).我的下一个目标是将任何 ITK 功能包含到我自己的项目中.除了在记录的安装过程中使用 CMake 之外,我没有任何使用 CMake 的经验.

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.

我自己的项目代码库本身就是一个相当复杂的 SDK 环境,位于相当大、复杂的 VS2008 解决方案中,我只想向其中添加一些 ITK 功能.由于我已经构建了 ITK,我可以简单地将包含设置到 .h 文件并将 lib 目录添加到链接器吗?

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?

是否有一种好的方法可以做到这一点,因为 .h 文件分布在整个 ITK 代码树中?

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.

在第二次和第三次阅读后,它实际上不是.这导致了我在下面的回答.

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

推荐答案

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

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

成功执行配置生成后,在给定的Where tobuild the binaries" 目录,可以在 Visual Studi0 2008 中打开.该解决方案具有用于构建解决方案的默认项目 ALL_BUILD,但它也有一个被跳过的 INSTALL 项目默认情况下.

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.

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

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.

在您自己的项目中链接

在您自己的 VS Studio 项目(我使用的是 VS 2008)中,您必须修改项目属性以包含包含文件:

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:

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

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