[Paraview] Detecting build type in C++ code

Chris Cameron heyitschriscameron at gmail.com
Tue Sep 2 10:55:50 EDT 2008


Thank you for your help,

I successfully used (without parentheses)

ifndef NDEBUG

to detect release build.



On Thu, Aug 7, 2008 at 5:25 PM, Dominik Szczerba <dominik at itis.ethz.ch>wrote:

> You can add a definition equal to the current setting of CMAKE_BUILD_TYPE:
>
> ADD_DEFINITIONS(-DCMAKE_BUILD_TYPE_IS_${CMAKE_BUILD_TYPE}).
>
> Then you can catch if with ifdefs inside the code.
> -- Dominik
>
> Chris Cameron wrote:
>
>> Hi,
>>
>> I'm looking for a cross-platform way of detecting the build type from C++
>> code.
>>
>> The idea is that if the code is being compiled for release, that certain
>> testing things we do can be eliminated from the release build of our
>> Paraview.
>>
>> Something like
>>
>> #ifdef (CMAKE_RELEASE)
>>  // do some stuff
>> #else
>>  // do other stuff
>> #endif
>>
>> would do the trick. Does anyone know the name of the define that I'm
>> looking for?
>>
>> --
>> Chris Cameron
>> Mirarco Mining Innovation - e2vo
>> 705-675-1151
>> x5113
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> ParaView mailing list
>> ParaView at paraview.org
>> http://www.paraview.org/mailman/listinfo/paraview
>>
>
> --
> Dominik Szczerba, Ph.D.
> Foundation for Research
> on Information Technologies in Society
> http://www.itis.ethz.ch
>



-- 
Chris Cameron
Mirarco Mining Innovation - e2vo
705-675-1151
x5113
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20080902/79e5eb02/attachment.htm>


More information about the ParaView mailing list