Probably I did something wrong than:<br><br><br>C:\tmp\CMCheckWhatEver&gt;cmake . -G&quot;MinGW Makefiles&quot;<br>-- The C compiler identification is GNU<br>-- Check for working C compiler: C:/MinGW/bin/gcc.exe<br>-- Check for working C compiler: C:/MinGW/bin/gcc.exe -- works<br>

-- Detecting C compiler ABI info<br>-- Detecting C compiler ABI info - done<br>-- Looking for snprintf<br>-- Looking for snprintf - found<br>-- Configuring done<br>-- Generating done<br>-- Build files have been written to: C:/tmp/CMCheckWhatEver<br>

<br><br>Determining if the function snprintf exists passed with the following output:<br>Change Dir: C:/tmp/CMCheckWhatEver/CMakeFiles/CMakeTmp<br><br>Run Build Command:C:/MinGW/bin/mingw32-make.exe &quot;cmTryCompileExec/fast&quot;<br>

C:/MinGW/bin/mingw32-make.exe -f CMakeFiles\cmTryCompileExec.dir\build.make CMakeFiles/cmTryCompileExec.dir/build<br><br>mingw32-make.exe[1]: Entering directory `C:/tmp/CMCheckWhatEver/CMakeFiles/CMakeTmp&#39;<br><br>&quot;C:\Program Files\CMake 2.7\bin\cmake.exe&quot; -E cmake_progress_report C:\tmp\CMCheckWhatEver\CMakeFiles\CMakeTmp\CMakeFiles 1<br>

<br>Building C object CMakeFiles/cmTryCompileExec.dir/CheckFunctionExists.c.obj<br><br>C:\MinGW\bin\gcc.exe  -DWHAT=ever -DCHECK_FUNCTION_EXISTS=snprintf -fno-builtin   -o CMakeFiles\cmTryCompileExec.dir\CheckFunctionExists.c.obj   -c &quot;C:\Program Files\CMake 2.7\share\cmake-2.7\Modules\CheckFunctionExists.c&quot;<br>

<br>Linking C executable cmTryCompileExec.exe<br><br>&quot;C:\Program Files\CMake 2.7\bin\cmake.exe&quot; -E cmake_link_script CMakeFiles\cmTryCompileExec.dir\link.txt --verbose=1<br><br>C:\MinGW\bin\gcc.exe     -DCHECK_FUNCTION_EXISTS=snprintf -fno-builtin   CMakeFiles\cmTryCompileExec.dir\CheckFunctionExists.c.obj  -o cmTryCompileExec.exe -Wl,--out-implib,libcmTryCompileExec.dll.a -Wl,--major-image-version,0,--minor-image-version,0  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 <br>

<br>mingw32-make.exe[1]: Leaving directory `C:/tmp/CMCheckWhatEver/CMakeFiles/CMakeTmp&#39;<br><br><br><br><div class="gmail_quote">2009/7/8 Eric Noulard <span dir="ltr">&lt;<a href="mailto:eric.noulard@gmail.com">eric.noulard@gmail.com</a>&gt;</span><br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">2009/7/8 Steven Van Ingelgem &lt;<a href="mailto:steven@vaningelgem.be">steven@vaningelgem.be</a>&gt;:<br>


&gt;<br>
&gt;<br>
</div><div><div></div><div class="h5">&gt; 2009/7/8 Eric Noulard &lt;<a href="mailto:eric.noulard@gmail.com">eric.noulard@gmail.com</a>&gt;<br>
&gt;<br>
&gt; -fno-builtin is not a definition, and try_compile (following the cmake docs)<br>
&gt; will add it to &quot;add_definitions()&quot;, maybe it will work, but I think that&#39;s<br>
&gt; also not a very clean solution ;).<br>
&gt; I tried your solution, but I didn&#39;t see the parameter added into the error<br>
&gt; log... So I think CMake only takes parameters starting with -D and /D?<br>
<br>
</div></div>That would definitely be a CMake bug,<br>
<div class="im"><br>
CMAKE_REQUIRED_FLAGS = string of compile command line flags<br>
CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)<br>
<br>
</div>CMAKE_REQUIRED_DEFINITIONS should  only work with -DBLAH=&lt;blahval&gt;<br>
<br>
but<br>
CMAKE_REQUIRED_FLAGS should accept any compile flags.<br>
<br>
Would you try the attached project.<br>
It works for me and the CMakeFiles/CMakeOutput.log reads:<br>
<br>
Building C object CMakeFiles/cmTryCompileExec.dir/CheckFunctionExists.c.o<br>
/usr/bin/gcc  -DWHAT=ever -DCHECK_FUNCTION_EXISTS=snprintf<br>
-fno-builtin   -o<br>
CMakeFiles/cmTryCompileExec.dir/CheckFunctionExists.c.o   -c<br>
/home/eric/CMake/cmake-V2_6/share/cmake-2.6/Modules/CheckFunctionExists.c<br>
<br>
which is the expect command line.<br>
<br>
However my test env is Linux + gcc 4.3.2.<br>
May be you can try that on your side?<br>
<div><div></div><div class="h5"><br>
--<br>
Erk<br>
Membre de l&#39;April - « promouvoir et défendre le logiciel libre » -<br>
<a href="http://www.april.org" target="_blank">http://www.april.org</a><br>
</div></div></blockquote></div><br>