[CMake] Forcing CHECK_CXX_SOURCE_RUNS_ARGS to compile in Release mode

Julien Malik julien.malik at c-s.fr
Thu Nov 3 11:08:12 EDT 2011


Hello,

I'm encountering some issues during configuration.
Config is :
- cmake 2.8.5
- Visual Studio 2008 Express


CHECK_CXX_SOURCE_RUNS_ARGS is used to compile and run a program, to 
verify that it does not segfault, and output a warning message if it does.

I'm encountering a runtime issue (an application has made an attempt to 
load the C runtime library incorrectly).
This stops the configuration process because of the popup showing the 
message.
CHECK_CXX_SOURCE_RUNS_ARGS seems to always compile the program in Debug 
mode (even though the CTEST_BUILD_CONFIGURATION is Release).
When built in Release, the same program runs OK with no runtime issues.

Side note :
- the program to test links to a lot of external libraries, compiled in 
Release mode (I already have a mix of different runtimes at that point : 
msvcr71 and msvcr90).
- I can see in Visual that running the Debug version of the try_compile 
program, I have both the release and debug version of msvcr90.dll and 
msvcp90.dll (which is logical, the release one come from the 
dependencies, the debug one from the build of the program)


Is there a way to tell cmake to run the "try_compile" in Release mode by 
default ?
Or do you know a way to avoid this annoying popup (i can't run nightly 
ctest submission because of this) ?

Thanks,
Julien


More information about the CMake mailing list