[CMake] Problem with Debug target options in VS8

Bill Hoffman bill.hoffman at kitware.com
Mon Nov 20 17:32:19 EST 2006


J.D. Yamokoski wrote:
> Greetings,
>
> First I just want to say that I am a new cmake user and I am loving 
> it! Great stuff!
>
> On to my issue, I apologize if this is a known issue or posted before, 
> but I have had some trouble with with Cmake and VS8. The error I get 
> is that cmake generates two incompatible compiler options for the 
> Debug target of a certain open source library. Specifically, VS 
> complains:
>
> cl : Command line error D8016 : '/O2' and '/RTC1' command-line options 
> are incompatible
>
> I know what those options are and why they are incompatible but what I 
> don't know is whether this is a cmake problem or an issue with this 
> project's cmake files. I have already talked to the developers of the 
> library I am trying to compile. They state that they "only ever set 
> CMAKE_BUILD_TYPE to 'Debug' for Windows but certainly don't set any 
> flags anywhere".
>
> For the time being, I have circumvented the problem by changing my 
> target to a Release build. But I would like to find out how to turn 
> off code optimization for the Debug build.
This sounds like a bug in the CMakeLists.txt files of the project you 
are working with.   By default CMake does not do this.
However, it is possible to set the flags incorrectly in a CMakeLists.txt 
file to get this result.   You would have to post more information
about the project you are wrapping to get more help.

-Bill



More information about the CMake mailing list