[ITK] Multiple ITK-builds and CMake

Matt McCormick matt.mccormick at kitware.com
Fri Sep 12 09:54:31 EDT 2014


Hi Mikael,

A few pointers:

- Only a single source per project directory is needed.
- Set ITK_DIR in the cmake-gui explicitly for each configuration --
don't try to use environmental variables, etc.

More details on how find_package works can be found here [1] and here [2].

Hope this helps,
Matt

[1] http://www.cmake.org/cmake/help/v3.0/command/find_package.html#command:find_package

[2] http://www.cmake.org/cmake/help/v3.0/manual/cmake-packages.7.html

On Fri, Sep 12, 2014 at 8:48 AM, Eriksson, Mikael
<mikael.k.eriksson at philips.com> wrote:
> Hello,
>
>
>
> I’m experiencing some problems trying to build BRAINSTools
> (https://github.com/BRAINSia/BRAINSTools), from where I wanted to run the
> registration algorithms implemented in the 3DSlicer gui from the command
> line. The initial situation was: I had ITK (4.5) and VTK built from
> downloaded files in debug mode on my computer. I managed to build the
> modules that I wanted from BRAINSTools (BRAINSFit and BRAINSDemonWarp and
> their dependencies) in debug mode. Everything was fine until I tried running
> a registration – I hadn’t realized until then that debug mode would make the
> registrations run really slowly.
>
>
>
> So, since I now have git on my computer, I cloned fresh versions of ITK and
> VTK to new source folders at the same levels as the old source folders, and
> built one debug version and one release version for both ITK and VTK, into
> separate folders. So my directory structure looked like this.
>
>
>
> C:/          -              ITK/        -              srcOld (ITK 4.5, from
> files)
>
>                                                                 binOld
> (debug)
>
> srcNewDebug (ITK 4.7, from source)
>
> srcNewRelease (ITK 4.7, from source)
>
> binNewDebug
>
> binNewRelease
>
>
>
> C:/          -              VTK/      -              corresponding…
>
>
>
> I probably have an unnecessary amount of builds and folders, but I was
> afraid to ruin any previous work.
>
>
>
> Now I tried to build BRAINSTools again with CMake. The problem here is that
> there is no option to specify ITK_DIR in the CMakeGUI, as there is in other
> programs. So I’m not sure how CMake finds and chooses an ITK-build, but I
> think it fails, because when compiling the BRAINSTools solution in Visual
> Studio 2010 as usual, using release mode this time, I got linking errors
> saying that some ITK-libraries couldn’t be found:
>
>
>
> error LNK1181: cannot open input file '..\..\lib\Release\ITKCommon-4.7.lib'
>
>
>
> I changed my environment variables ITK_DIR to C:/ITK/binNewRelease and
> changed the old ITK and VTK entries in the PATH variables to the new ones
> (changed C:\ITK\binOld\bin\debug to C:\ITK\binNewRelease\bin\Release and
> same for VTK). The same problem persisted however. Can anybody, give any
> suggestions for how to solve this particular problem? Also, I would be very
> happy for an explanation or a good link for how CMake and ITK interconnect,
> and especially, how CMake chooses an ITK build. I looked at the
> findITK.CMake files, and the ITKConfig.cmake and useITK.cmake files and read
> the documentation for the find_package function, but it’s still not clear to
> me how it works.
>
>
>
> Best regards,
>
> Mikael
>
>
>
> ………………………………………………………………………………………….
>
> Mikael Eriksson
>
> R&D Physicist Trainee
>
> Philips Medical Systems MR Finland, Feasibility studies
>
> mikael.k.eriksson at philips.com
>
> ………………………………………………………………………………………….
>
>
>
>
> ________________________________
> The information contained in this message may be confidential and legally
> protected under applicable law. The message is intended solely for the
> addressee(s). If you are not the intended recipient, you are hereby notified
> that any use, forwarding, dissemination, or reproduction of this message is
> strictly prohibited and may be unlawful. If you are not the intended
> recipient, please contact the sender by return e-mail and destroy all copies
> of the original message.
>
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/mailman/listinfo/community
>



More information about the Community mailing list