ITK Configuring and Building in VisualStudio及hello world程序编译

1. ITK Configuring and Building in VisualStudio

With Visual Studio 2010 on Windows 7 (32-bit):

  • Launch the CMake GUI by starting a Visual Studio Command Prompt (Start->Programs-> Microsoft Visual Studio 2010->Visual Studio Tools->Visual Studio Command Prompt) and running "cmake-gui"
  • Next to "Where is the source code:", click "Browse Source..." and navigate to where you cloned the repository with Git.
  • Next to "Where to build the binaries:", select "Browse Build..." and select a place to build the ITK library. I like to use c:\build\ITK. This directory should NOT be inside the directory where you cloned the repository.
  • Click "Configure", and then specify "Visual Studio 10" as the generator for this project.
  • Choose your build options. I like to UNCHECK BUILD_EXAMPLES and BUILD_TESTING as they speed up the build process significantly.
  • Click "Generate".
  • Open Visual Studio 2010
  • Open Project
  • Navigate to the Build directory you specified through CMake
  • Open the ALL_BUILD project
  • From the Build menu, choose "Build Solution" (or "Build ALL_BUILD")


五、编译Helloword

(1)任意位置建立文件夹 hello, hello/bin, hello用来存放源程序, bin 为程序编译目标。拷贝ITK下的Examples\Installation中的CMakeLists.txt和HelloWorld.cxx到hello文件夹下。

    (2)使用 CMake 进行配置:打开Cmake,选择源文件夹和目标文件夹路径,

    Where is the source code: 点击 Browse, 选择   D:\Projects\ITK Projects\hello

    Where to build the binaries: 点击 Browse, 选择  D:\Projects\ITK Projects\hello\bin

如图6。

(3)点击Configure(如果没有找到 ITK 路径, 则需要手动指定),等所有条目都变成白色后再点击Generate生成项目,如图7。

(4)双击打开 hello/bin下生成的HelloWorld.sln, 自动进入VS 2010,如图8, 编译并运行项目,如图9,至此成功。


参考资料:

[1] http://www.itk.org/Wiki/ITK/Configuring_and_Building/VisualStudio

[2] http://www.bokeyi.com/ll/2014/04/06/itk%E5%9C%A8vs2010%E4%B8%8B%E7%BC%96%E8%AF%91%E5%AE%89%E8%A3%85%E4%BD%BF%E7%94%A8/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值