[CMake] Building a Debug Project against a Release VTK

Mike Jackson mike.jackson at imts.us
Tue Oct 10 09:10:35 EDT 2006


Mike Jackson wrote:
> I just tried to have CMake generate a "debug" build of my project but when cmake ran it gave me the warning that Cmake was forcing my build type to Release since that is what VTK was built with. I _understand_ the error. What I need to know is if there is a way to actually build my code with Debug ON but leave VTK in release mode? I do this on other platforms (OS X) so this just seems like I am missing something simple.
> 
> I am on WinXP, using MinGW (although MSYS is installed also). I Built VTK 5.0.2 with MinGW in Release mode. I did not do an "Install" of VTK as I am just trying to link against VTK in its build location? Should I install VTK somewhere else instead?

This is actually a question for the VTK users list.  The UseVTK.cmake
file provided by VTK is *very* strict about matching compiler settings.
 That is what is creating the warnings, not CMake itself.  You can
probably avoid the problem by not using UseVTK.cmake directly.  Instead do

FIND_PACKAGE(VTK)

and then use the resulting variables for link directories and include
directories yourself in calls to LINK_DIRECTORIES and INCLUDE_DIRECTORIES.

-Brad

That is what I was looking for. Sorry for the post to cmake as it _seemed_ like a cmake problem to me. I have since taken the advice here and performed two actions:
 1: I built VTK in Debug mode.
 2: I did a "make Install" of VTK and now use the findpackage(VTK) command in my cmake files.

Thanks for the help.
Mike Jackson





More information about the CMake mailing list