[CMake] How can I instrument code within CMake?

Mathieu Malaterre mathieu.malaterre at gmail.com
Fri Jul 27 05:32:40 EDT 2007

Hi Fons,

  I have not found any other way than to simple edit the file
CMakeImportBuildSettings.cmake and comment out the following two

          CACHE STRING "C++ compiler imported from

  You could also comment out the warning if you want.


On 7/27/07, Dijkstra, Fons <fons.dijkstra at oce.com> wrote:
> Hello,
> I want to use pre-compilers to insert analytic code before parsing it by the
> normal compiler. For example I want to use Insure++ to check on runtime
> errors like memory leaks. The way to do this is to use the insure.exe
> compiler instead of the cl.exe compiler (on Win32 that is),  The problem I'm
> facing with this is that when I override the CMAKE_CXX_COMPILER variable for
> a specific component that is dependant on already cl.exe build components, I
> get the following message:
> Warning: CMake is forcing CMAKE_CXX_COMPILER to "C:/Program Files/Microsoft
> Visual Studio 8/VC/bin/cl.exe" to match that imported from Bmm.BmmPP.  This
> is required because C++ projects must use the same compiler.  If this
> message appears for more than one imported project, you have conflicting C++
> compilers and will have to re-build one of those projects. Was set to
> C:/Program Files/ParaSoft/Insure++/bin.Win32/insure.exe
> As the Insure++ compiler is just a pre-compiler and the actual compilation
> is still done by the cl.exe compiler I'll have no problems with conflicting
> compilers.
> So my question is: How can I specify to build a specific component with a
> pre-compiler without CMake overruling it to the compiler already used by
> dependant components? It is no option to rebuild all dependant components
> with the pre-compiler.
> I hope you can help me, Fons
>  This message and attachment(s) are intended solely for use by the addressee
> and may contain information that is privileged, confidential or otherwise
> exempt from disclosure under applicable law. If you are not the intended
> recipient or agent thereof responsible for delivering this message to the
> intended recipient, you are hereby notified that any dissemination,
> distribution or copying of this communication is strictly prohibited. If you
> have received this communication in error, please notify the sender
> immediately by telephone and with a 'reply' message. Thank you for your
> co-operation.
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake


More information about the CMake mailing list