[CMake] [vtkusers] Windows: Correctly linking the debug and release libraries in a CMake-based project

John Drescher drescherjm at gmail.com
Tue Jan 26 11:50:29 EST 2010


>> When you build VTK using CMake the .lib .dll may have the same name
>> but they are in different folders. CMake understands this and will
>> properly link your application with the correct .lib. This happens if
>> you do build both debug and release vtk.
>>
>> John
>
> I think he is talking about having the vtk libs have "_debug" or "_D" or "D"
> in the name when they are built as debug versus Release builds. What works
> for ITK is to actually build both the debug and release versions but DO NOT
> install them. Then set an environment variable VTK_DIR to point to the build
> directory of VTK. CMake will do the rest. This at least worked for me with
> ITK and allowed me to switch between debug and release builds in my own
> project without getting all the linker warnings/errors in MSVC. The other
> suggestion was to build "Release W/Debug Info" and install that.
>
Oh I see. I do not INSTALL VTK or ITK I just do as you mention..

John


More information about the CMake mailing list