[Insight-users] how do i deal with 32 and 64 bit builds

John Drescher drescherjm at gmail.com
Wed Dec 7 17:00:48 EST 2011


> I think you need to make sure that the environmental variable ITK_DIR points
> to the place where you built the ITK version (32-bit or 64-bit).  E.g. you
> might have
>
> ITK_DIR=D:\ITK64
>
> which might need to be changed to
>
> ITK_DIR=D:\ITK32
>
> to build 32-bit applications.
>

That will help solve the case where the CMake finders finds the wrong
version. I now do this on my builds.

Inside each binary root for example:

x:\64bit\vc.100

I have a shortcut to the visual studio x64 command prompt for Visual
Studio 2010. And also a batch file that sets several variables. Here
is what I am setting for my stuff in the batch file:

set CMAKE_SYSTEM_BUILD_ROOT=%CD%
set CMAKE_SYSTEM_INSTALL_ROOT=%CD%\Install
pushd %CD%\..\..\CMakeBased
set CMAKE_SYSTEM_SOURCE_ROOT=%CD%
popd

pushd %CD%\..\..\QMakeBased
set CMAKE_SYSTEM_QMAKE_SOURCE_ROOT=%CD%
popd

pushd %CD%\..\..\Other
set CMAKE_SYSTEM_BJAM_SOURCE_ROOT=%CD%
popd

set CMAKE_GENERATOR=Visual Studio 10 2010 Win64
set CMAKE_DEFAULT_CONFIGURATIONS=Debug;Release;RelWithDebInfo
set QT_VERSION=4.7.4
set VTK_VERSION=5.8.0
set ITK_VERSION=3.20.1
set GDCM_VERSION=2.0.14
set BOOST_VERSION=1.47.0
set QWT_VERSION=6.0.0
set QXT_VERSION=6.1.0
set CLAPACK_VERSION=3.2.1

set QMAKESPEC=win32-msvc2010
SET PATH=%PATH%;"%CMAKE_SYSTEM_BUILD_ROOT%\Libraries\Qt-%QT_VERSION%\bin"
SET QT_DIR=%CMAKE_SYSTEM_BUILD_ROOT%\Libraries\Qt-%QT_VERSION%
SET QTDIR=%QT_DIR%
set ITK_DIR=%CMAKE_SYSTEM_BUILD_ROOT%\Libraries\InsightApplications-%ITK_VERSION%
set VTK_DIR=%CMAKE_SYSTEM_BUILD_ROOT%\Libraries\vtk-%VTK_VERSION%
set GDCM_DIR=%CMAKE_SYSTEM_BUILD_ROOT%\Libraries\gdcm-%GDCM_VERSION%
set BOOST_ROOT=%CMAKE_SYSTEM_BUILD_ROOT%\Libraries\boost-%BOOST_VERSION%
set vtkINRIA3D_DIR=%CMAKE_SYSTEM_BUILD_ROOT%\Libraries\vtkINRIA3D


After I open the Visual Studio Command Prompt. I first launch my setup
batch file then run cmake-gui inside the command prompt so that CMake
pulls in the environment I set from the batch.

John


More information about the Insight-users mailing list