[CMake] Building a Debug Project against a Release VTK

Brad King brad.king at kitware.com
Mon Oct 9 20:21:55 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


More information about the CMake mailing list