What I would like to do is build ITK once, and then each member of the team can just copy the built version for building our projects linking to ITK, rather than everyone building locally. However I have not been able to get this to work with both Debug and Release builds, though I’ve tried a few things. I hope there is something basic I am missing and someone can help me with that.
I originally tried setting CMAKE_INSTALL_PREFIX to some directory, going through the ITK build process with cmake and Visual Studio, and distributing the output in CMAKE_INSTALL_PREFIX. Then, in the CMakeLists.txt of our project linking to ITK, ITK_DIR is set to this output dir, e.g.
The problem is, this will only be a single build type, release or debug. So when building our project in VS, we get build errors if, say ITK was built as release and we try to build debug. The only workaround was to have both and comment out one at a time, e.g.
and go through build process again. But this is pretty awkward, ideally we could build either by simply switching within Visual Studio.
The next attempt was to simply copy the entire ITK build directory after building both debug and release, so in our project CMakeLists.txt something like
This worked for whoever built it, but when transferring to someone else, because the build has many references to absolute paths of the original builders ITK location, the build fails since the second person won’t have that path.
It doesn’t seem like an odd thing to be doing, is there some standard approach to do this?